Back to index

nux  3.0.0
Macros.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


#define NUX_GLOBAL_OBJECT_VARIABLE(Class)   Class m_##Class;
 GLOBAL OBJECT ///////////////////////////////////////////////////////////////////////.
#define NUX_GLOBAL_OBJECT_INSTANCE(Class)   Class::Instance()
#define NUX_GLOBAL_OBJECT_REFERENCE(Class)   Class::Instance()
#define NUX_IMPLEMENT_GLOBAL_OBJECT(Class)   Class* Class::pInstance = 0;
#define NUX_DECLARE_GLOBAL_OBJECT(Class, GlobalInitializer)
 A Global Object with a behavior similar to a singleton.
 Loki Singleton ////////////////////////////////////////////////////////////////////////////////////.
#define NUX_SINGLETON_CLASS_DECLARE(ClassImpl, SingletonClass)   typedef ::Loki::SingletonHolder<ClassImpl, ::Loki::CreateUsingNew, ::Loki::DefaultLifetime, ::Loki::ClassLevelLockable> SingletonClass;
#define NUX_SINGLETON_INSTANCE(SingletonClass)   SingletonClass::Instance()
#define NUX_UNUSED(parameter)   (void)parameter;

Define Documentation


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.

Definition at line 66 of file Macros.h.

#define NUX_DISABLE_OBJECT_COPY (   Class)
private:                                    \
    Class(const Class &);                       \
    const Class& operator = (const Class &);

Definition at line 28 of file Macros.h.

#define NUX_GLOBAL_OBJECT_INSTANCE (   Class)    Class::Instance()

Definition at line 35 of file Macros.h.

#define NUX_GLOBAL_OBJECT_REFERENCE (   Class)    Class::Instance()

Definition at line 36 of file Macros.h.

#define NUX_GLOBAL_OBJECT_VARIABLE (   Class)    Class m_##Class;

GLOBAL OBJECT ///////////////////////////////////////////////////////////////////////.

Definition at line 34 of file Macros.h.

#define NUX_IMPLEMENT_GLOBAL_OBJECT (   Class)    Class* Class::pInstance = 0;

Definition at line 38 of file Macros.h.

)    typedef ::Loki::SingletonHolder<ClassImpl, ::Loki::CreateUsingNew, ::Loki::DefaultLifetime, ::Loki::ClassLevelLockable> SingletonClass;

Definition at line 117 of file Macros.h.

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 ////////////////////////////////////////////////////////////////////////////////////.

Definition at line 106 of file Macros.h.

#define NUX_SINGLETON_INSTANCE (   SingletonClass)    SingletonClass::Instance()

Definition at line 118 of file Macros.h.

#define NUX_UNUSED (   parameter)    (void)parameter;

Definition at line 120 of file Macros.h.