Go to the source code of this file.
Define Documentation
#define NUX_DECLARE_GLOBAL_OBJECT |
( |
|
Class, |
|
|
|
GlobalInitializer |
|
) |
| |
A Global Object with a behavior similar to a singleton. Only one instance of this object can exist. The unique instance is created by a friend class: GlobalInitializer. Only GlobalInitializer can create this instance. example: class GlobalObject { NUX_DECLARE_GLOBAL_OBJECT(GlobalObject, , GlobalSingletonInitializer)
public: void foo(void); };
The macro also define a Constructor and Destructor method to be implemented:
- void Constructor()
- void Destructor() They are replacement for the real Constructor and Destructor.
#define NUX_DISABLE_OBJECT_COPY |
( |
|
Class | ) |
|
Value:private: \
Class(const Class &); \
const Class& operator = (const Class &);
#define NUX_GLOBAL_OBJECT_INSTANCE |
( |
|
Class | ) |
Class::Instance() |
#define NUX_GLOBAL_OBJECT_REFERENCE |
( |
|
Class | ) |
Class::Instance() |
#define NUX_GLOBAL_OBJECT_VARIABLE |
( |
|
Class | ) |
Class m_##Class; |
GLOBAL OBJECT ///////////////////////////////////////////////////////////////////////.
#define NUX_IMPLEMENT_GLOBAL_OBJECT |
( |
|
Class | ) |
Class* Class::pInstance = 0; |
#define NUX_SINGLETON_CLASS_DECLARE |
( |
|
ClassImpl, |
|
|
|
SingletonClass |
|
) |
| typedef ::Loki::SingletonHolder<ClassImpl, ::Loki::CreateUsingNew, ::Loki::DefaultLifetime, ::Loki::ClassLevelLockable> SingletonClass; |
#define NUX_SINGLETON_CLASS_INTERNAL |
( |
|
ClassImpl | ) |
|
Value:private: \
ClassImpl(); \
~ClassImpl(); \
ClassImpl(const ClassImpl &); \
ClassImpl& operator=(const ClassImpl &); \
ClassImpl* operator &(); \
friend struct Loki::CreateUsingNew<ClassImpl>; \
friend struct Loki::CreateUsingMalloc<ClassImpl>; \
friend struct Loki::CreateStatic<ClassImpl>;
Loki Singleton ////////////////////////////////////////////////////////////////////////////////////.
#define NUX_SINGLETON_INSTANCE |
( |
|
SingletonClass | ) |
SingletonClass::Instance() |
#define NUX_UNUSED |
( |
|
parameter | ) |
(void)parameter; |