MyGUI_Instance.h File Reference

Go to the source code of this file.

Defines

#define MYGUI_INSTANCE_HEADER(type)
#define MYGUI_INSTANCE_IMPLEMENT(type)

Detailed Description

Author:
Albert Semenov
Date:
11/2007

Definition in file MyGUI_Instance.h.


Define Documentation

#define MYGUI_INSTANCE_HEADER ( type   ) 
Value:
private: \
        static type* msInstance; \
        bool mIsInitialise; \
    public: \
        type();\
        ~type();\
        static type& getInstance(); \
        static type* getInstancePtr();

Definition at line 26 of file MyGUI_Instance.h.

#define MYGUI_INSTANCE_IMPLEMENT ( type   ) 
Value:
const std::string INSTANCE_TYPE_NAME(#type); \
    type* type::msInstance = nullptr; \
    type* type::getInstancePtr() { return msInstance; } \
    type& type::getInstance() { MYGUI_ASSERT(0 != msInstance, "instance " << INSTANCE_TYPE_NAME << " was not created"); return (*msInstance); } \
    type::type() : mIsInitialise(false) { MYGUI_ASSERT(0 == msInstance, "instance " << INSTANCE_TYPE_NAME << " is exsist"); msInstance = this; } \
    type::~type() { msInstance = nullptr; }

Definition at line 37 of file MyGUI_Instance.h.


Generated on 3 Dec 2009 for MyGUI by  doxygen 1.6.1