I'm being dense today, I need beer
 

Best Regards

 

Gordon

__________________________________________________________

Gordon Tomlinson
Email         : gordon.tomlinson @ overwatch.com
YIM/AIM
       : Gordon3dBrit
MSN IM        : Gordon3dBrit @ 3dscenegraph.com

__________________________________________________________

"Self defence is not a function of learning tricks
but is a function of how quickly and intensely one
can arouse one's instinct for survival"
- Master Tambo Tetsura

 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]On Behalf Of Robert Osfield
Sent: Friday, October 06, 2006 10:42 AM
To: osg users
Subject: Re: [osg-users] These ref pointer things

On 10/6/06, Gordon Tomlinson <[EMAIL PROTECTED]> wrote:
I would not expect myList.push_back(object); to increase the ref count of
object

unless you provide your own overloaded list and method ::push_back

Um... the std::list is a list of ref_ptr<> when it copies the ref_ptr<> into the list in does use a copy constructor, and ref_ptr<> copy constructor *will* ensure that the ref count is upped.

osg::Group::addChild( osg::Node* ) knows that an osg::Node is a reference
count class so it can do a node->ref();

Actually osg::Group doesn't node its ref counted, it just adds it to an internal std::vector< ref_ptr<Node> >, just like in Olivers example.


But a std::list knows nothing about an osg::Node or osg::ref_ptr

I knows everything it needs to know - the ref_ptr<> constructors, destructor and copy operator, the rest happens automatically thanks to ref_ptr<> safely managing ref()/unref().

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to