[osg-users] About MixinVector

Paul Martz pmartz at skew-matrix.com
Thu Jun 26 08:19:20 PDT 2008


Thanks for the info, as this is not at all clear from the code comments at
the top of the class.

Where does the name "MixinVector" come from? Why was it chosen? It is not
descriptive, at least, not to me... :-( 
   -Paul 


> -----Original Message-----
> From: osg-users-bounces at lists.openscenegraph.org 
> [mailto:osg-users-bounces at lists.openscenegraph.org] On Behalf 
> Of Robert Osfield
> Sent: Thursday, June 26, 2008 9:08 AM
> To: OpenSceneGraph Users
> Subject: Re: [osg-users] About MixinVector
> 
> Hi Paul,
> 
> The change to use the MixinVector is to avoid using multiple 
> inheritance with std::vector, as std::vector doesn't have a 
> virtual destructor the destruction of the vector is undefined 
> w.r.t the C++ Standard.  What the MixinVector does is to 
> change the setup so that classes that subclass from 
> MixinVector "have a" std::vector, rather than inherit from 
> std::vector.
> 
> The MixinVector is still uses std::vector<> internally, and 
> delegates all functionality to std::vector<> via inline 
> methods.  So the OSG itself isn't moving away from STL in any 
> way, just working with it more correctly/robustly.
> 
> Robert.
> 
> On Thu, Jun 26, 2008 at 3:55 PM, Paul Martz 
> <pmartz at skew-matrix.com> wrote:
> > Can someone please explain the MixinVector change and why 
> it was necessary?
> > Also, please explain the name "MixinVector" -- what, 
> exactly, is a "Mixin"?
> > If this is a design pattern, I must admit I'm not familiar with it.
> >
> > I checked the archives and I see no discussion of this change, not 
> > even the submission. I see only Robert's change log post when 
> > requesting 2.5.3 testing, which shows this change was added 
> on June 19.
> >
> > I can see that the change apparently fixes some memory leaks. Are 
> > there test cases that reproduce the problem? If so, can 
> someone post them?
> >
> > If it seems that I'm overly concerned, it is because I feel 
> that one 
> > of OSG's strengths is its reliance on STL. So, changes that 
> move OSG 
> > away from STL worry me a bit. This change replaces a well-tested 
> > std::vector with a completely new MixinVector and therefore 
> > invalidates all testing on OSG's Array classes done over 
> the past 10 years.
> >
> > Paul Martz
> > Skew Matrix Software LLC
> > http://www.skew-matrix.com
> > +1 303 859 9466
> >
> > _______________________________________________
> > osg-users mailing list
> > osg-users at lists.openscenegraph.org
> > 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
> > org
> >
> >
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-opensce
negraph.org



More information about the osg-users mailing list