Go to the source code of this file.
Defines | |
#define | MYGUI_INSTANCE_HEADER(type) |
#define | MYGUI_INSTANCE_IMPLEMENT(type) |
Definition in file MyGUI_Instance.h.
#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.