Re: [osg-users] osg::ref_ptr<> used anymore

2009-06-01 Thread Rabbi Robinson
Hi, Ok, I started this thread, so I claim to have the right for the last words. I have used boost before, it looks like a pretty well maintained library. I used it because I was working on my coworker's code and in our case, he only used the file separator ("\" vs "/") from boost. For that it p

Re: [osg-users] osg::ref_ptr<> used anymore

2009-06-01 Thread Ismail Pazarbasi
able to transfer knowledge of one standard and apply it to > multiple projects with completely different environments. > > > James Killian > - Original Message - From: "Chris 'Xenon' Hanson" > > To: "OpenSceneGraph Users" > Sent: Sund

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread James Killian
etely different environments. James Killian - Original Message - From: "Chris 'Xenon' Hanson" To: "OpenSceneGraph Users" Sent: Sunday, May 31, 2009 8:21 PM Subject: Re: [osg-users] osg::ref_ptr<> used anymore Judd Tracy wrote: Boost only needs to be install

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Paul Martz
> Judd is right in that most of boost does its magic at compile-time > and doesn't need binary libraries at link-time. Everyone I talk to who actually uses Boost will agree with that statement, and they claim that Boost is a very lightweight dependency. Interestingly, everyone I talk to who _doe

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Judd Tracy
They do have a type that is somewhat similar to ref_ptr. I have not gone into the details of it to see how much it matches but it does use embedded reference counts. intrusive_ptr On Sun, May 31, 2009 at 9:21 PM, Chris 'Xenon

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Chris 'Xenon' Hanson
Judd Tracy wrote: > Boost only needs to be installed if you use certain features. Shared > pointers is not one of those features in which it needs to be > installed. I like boost myself, and have used parts of it in different projects. But, I want to clarify the sense of "installed" here. I

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Judd Tracy
Boost only needs to be installed if you use certain features. Shared pointers is not one of those features in which it needs to be installed. That was the point that Ismail was probably trying to bring forward. But boost shared pointers are a different beast from osg's. On Sun, May 31, 2009 at 4

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Ismail Pazarbasi
2009/5/31 Ulrich Hertlein : > On 31/5/09 9:06 PM, Ismail Pazarbasi wrote: >> >> 2009/5/31 Ulrich Hertlein: >>> >>> Maybe because boost isn't exactly a light dependency to carry around? >>> ... >> >> sorry but what's so heavy about boost to carry around? Do you use >> signal, thread or spirit, or fi

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Ulrich Hertlein
On 31/5/09 9:06 PM, Ismail Pazarbasi wrote: 2009/5/31 Ulrich Hertlein: Maybe because boost isn't exactly a light dependency to carry around? ... sorry but what's so heavy about boost to carry around? Do you use signal, thread or spirit, or files that require built shared libraries that need to

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Ismail Pazarbasi
2009/5/31 Ulrich Hertlein : > On 31/5/09 7:07 PM, James Killian wrote: >> >> Not ALL pointers need a reference count like those which are private >> (not intended to be shared), that's one reason why boost created the >> scoped pointer... too bad all the c++ programmers I know never use them. > > M

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread Ulrich Hertlein
On 31/5/09 7:07 PM, James Killian wrote: Not ALL pointers need a reference count like those which are private (not intended to be shared), that's one reason why boost created the scoped pointer... too bad all the c++ programmers I know never use them. Maybe because boost isn't exactly a light d

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-31 Thread James Killian
ad all the c++ programmers I know never use them. I use them faithfully (but not when using osg classes). James Killian - Original Message - From: "Paul Martz" To: Sent: Friday, May 29, 2009 10:21 AM Subject: Re: [osg-users] osg::ref_ptr<> used anymore I used to te

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-29 Thread Paul Martz
un...@lists.openscenegraph.org [mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Rabbi Robinson Sent: Friday, May 29, 2009 8:38 AM To: osg-users@lists.openscenegraph.org Subject: Re: [osg-users] osg::ref_ptr<> used anymore Hi, Thanks for the replies. They really clarified a lot. Looks

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-29 Thread Rabbi Robinson
Hi, Thanks for the replies. They really clarified a lot. Looks like for small pointer, it's all or none deal, e.g. it's best to use them every time a reference to the pointed object is needed. Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegrap

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jason Daly
Ismail Pazarbasi wrote: small correction, if you don't misunderstand; that will not decrease reference count, since ptr is void* and has no connection whatsoever with pointee (osg::Referenced). In following case: osg::ref_ptr pnode = new osg::Node; void* ptr = pnode; ptr = NULL; (this is what I

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Ismail Pazarbasi
2009/5/28 Jason Daly : > Rabbi Robinson wrote: [snip] >> If later I call, ptr = NULL, it doesn't seem that there is anyway to tell >> node to decrement the reference count in node. > > This will decrement the reference count in node.  If the reference count > goes to zero, it will be deleted. > > -

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jason Daly
Rabbi Robinson wrote: Hi, Thanks, that explains it. Correct me if I am wrong. So to use it, just create osg::ref_ptr<> and use it as regular pointer and the memory will be managed by osg::ref_ptr<>. In a simple case, I careate Node* node = osg::ref_ptr and, call void* ptr = node. I suppose th

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Paul Martz
I think you'd benefit from looking at some OSG examples (all of which use ref_ptr) and reading the memory management section in the OSG Quick Start Guide (http://stores.lulu.com/pmartz). Paul Martz Skew Matrix Software LLC http://www.skew-matrix.com +1 303 859 9466 ___

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jolley, Thomas P
Hi Rabbi, The URL wrapped around to the next line. Use the full URL. > -Original Message- > From: Rabbi Robinson [mailto:longa...@gmail.com] > Sent: Thursday, May 28, 2009 11:20 AM > To: osg-users@lists.openscenegraph.org > Subject: Re: [osg-users] osg::ref_ptr<>

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi, Sorry, 404 Thank you! Cheers, Rabbi -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=13110#13110 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listi

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jolley, Thomas P
Re: [osg-users] osg::ref_ptr<> used anymore > > Hi, > > Thanks, that explains it. Correct me if I am wrong. So to use > it, just create osg::ref_ptr<> and use it as regular pointer > and the memory will be managed by osg::ref_ptr<>. > > In a simple

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi, Thanks, that explains it. Correct me if I am wrong. So to use it, just create osg::ref_ptr<> and use it as regular pointer and the memory will be managed by osg::ref_ptr<>. In a simple case, I careate Node* node = osg::ref_ptr and, call void* ptr = node. I suppose the reference count in no

Re: [osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Jason Daly
Rabbi Robinson wrote: Since I did not use osg::ref_ptr<> in that code and it looks like reference count is kept somewhere in the node. My question is that if automatic memory management is used even without osg::ref_ptr<>. Short answer is yes. The longer explanation is that almost all OSG

[osg-users] osg::ref_ptr<> used anymore

2009-05-28 Thread Rabbi Robinson
Hi, I wonder osg::ref_ptr<> is used anymore for automatic memory management. I remember sometime ago I got an error from mishandling multiple inheritance, the error printed on the screen was that the reference count of a node is some non-sense number when the destructor of the node executes (so