Moved the OSG_INIT_SINGLETON_PROXY macro into include/osg/Object to make it more generally useful and added it's usage into the RenderBinPrototypeList initialization.

This commit is contained in:
Robert Osfield
2012-09-05 13:48:23 +00:00
parent 3c9a0cdfd7
commit f5a3c40934
3 changed files with 7 additions and 1 deletions

View File

@@ -42,6 +42,9 @@ class UserDataContainer;
virtual const char* libraryName() const { return #library; }\
virtual const char* className() const { return #name; }
/** Helper macro that creates a static proxy object to call singleton function on it's construction, ensuring that the singleton gets initialized at startup.*/
#define OSG_INIT_SINGLETON_PROXY(ProxyName, Func) static struct ProxyName{ ProxyName() { Func; } } s_##ProxyName;
/** Base class/standard interface for objects which require IO support,
cloning and reference counting.
Based on GOF Composite, Prototype and Template Method patterns.