Hi Sajjadul,
There are nothing in OSG to do this, but make a class a singleton is really
straightforward.
- make constructor protected or private,
- add a static getInstance function
MyClass & getInstance()
{
static MyClass * myClass = new MyClass();
return *myClass;
}
then use it in your code
MyClass::getInstance().doStuff();
alternatively, you can google 'boost+singleton' to see some examples of
implementation
HTH
David
2013/4/26 Sajjadul Islam <[email protected]>
> Hello forum,
>
> I have a class declaration and i want to create a singleton instance to it.
>
> Is there any utility class inside OSG that enables something like this?
>
> Thank you!
>
> Cheers,
> Sajjadul
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=53820#53820
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org