[osg-users] osg::Referenced - reference count notification

sherman wilcox wilcox.sherman at gmail.com
Thu Jul 17 09:01:15 PDT 2008


I have a class that derives from osg::Referenced. This class contains
a pointer to a block of compressed data. What I'd like to do is
"automatically" decompress the block of data when the reference count
exceeds a threshold (in this case anything higher than 1). Also, when
the reference count is <= a given threshold (again, anything <= 1) I'd
like this class to compress the data. What I'm not seeing is any way
to hook into the reference counting system to receive notifications
when the count changes. I see that there is a mechanism to notify
"observers" when the object is delete, but this isn't quite what I'm
after. Suggestions?



More information about the osg-users mailing list