[osg-users] Meta-data in core OSG - project started

Sukender suky0001 at free.fr
Wed Apr 27 07:09:23 PDT 2011


Hi Peter, hi all,

We're working on impementing the meta-data system. We found that there was very few feedback, and feel it's a bad sign of inacceptance of it... Anyone?

Peter, when you told about immutability, it was with a database backend in mind, right? If so, I think it may be better not to have immutable Values. Indeed, DescriptionList and more generally user data may be mutable. So to get this database backend wokring properly, I think one should:
- Define a "ValueDB", derivate from ValueBase.
- Define a "DBProxy", derivate from ComponentContainer (well, we renamed it ValueContainer to avoid misinterpretation)
- Make DBProxy give ValueDB when getting
- Make ValueDB know DBProxy so that modifying a ValueDB will call appropriate method in DBProxy
- Make DBProxy also accept Value<T> as an input, and convert it to appropriate SQL/request/whatever
Thoughts?

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

----- "Sukender" <suky0001 at free.fr> a écrit :

> Hi all,
> 
> From your feedback and our first tests/prototypes, here is the revised
> document.
> Please comment!
> 
> Sukender
> PVLE - Lightweight cross-platform game engine -
> http://pvle.sourceforge.net/
> 
> ----- "Peter Amstutz" <peter.amstutz at tseboston.com> a écrit :
> 
> > Immutable means "cannot be changed".  So I mean that the "Value"
> > class
> > should not have a "set" method and all "get" methods should be
> const. 
> > E.g.
> > 
> > template<T>
> > class Value {
> > private:
> >   T v;
> > 
> > public:
> >   Value(const T& _v) : v(_v) { }
> > 
> >   const T& get() { return v; }
> > 
> >   // type conversion operator, so you can write
> >   // Value<int> a(5);
> >   // int b = a;
> >   const T& operator T () { return v; }
> > };
> > 
> > 
> > On 4/19/2011 5:46 AM, Sukender wrote:
> > > Hi Peter,
> > >
> > > Okay, we'll certainely try your ideas. I guess ValueBase is meant
> to
> > be derived, but Value<T> isn't.
> > >
> > > However, I'm not sure I understand the "immutable" thing. Do you
> > mean you preference goes to
> > >    function( someParam )
> > > rather than
> > >    function( Value<SomeType>(someParam) )
> > > ?
> > >
> > > If so, yes. And that's of course easier to write and read.
> > 
> > -- 
> > Peter Amstutz
> > Senior Software Engineer
> > Technology Solutions Experts
> > Natick, MA
> > 02131
> > 
> > _______________________________________________
> > 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-openscenegraph.org



More information about the osg-users mailing list