MyGUI  3.0.1
Macros
MyGUI_Instance.h File Reference

Go to the source code of this file.

Macros

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

Detailed Description

Author
Albert Semenov
Date
11/2007

Definition in file MyGUI_Instance.h.

Macro Definition 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.