ezEngine  Milestone 7
EnumerableClass.h File Reference

Go to the source code of this file.

Classes

class  ezEnumerable< Derived, Base >
 Base class to add the ability to another class to enumerate all active instance of it, across DLL boundaries. More...
 

Macros

#define EZ_DECLARE_ENUMERABLE_CLASS(self)   EZ_DECLARE_ENUMERABLE_CLASS_WITH_BASE(self, ezNoBase)
 Insert this macro in a class that is supposed to be enumerable, and pass the class name as the parameter. More...
 
#define EZ_DECLARE_ENUMERABLE_CLASS_WITH_BASE(self, base)
 Insert this macro in a class that is supposed to be enumerable, and pass the class name as the parameter. More...
 
#define EZ_ENUMERABLE_CLASS_IMPLEMENTATION(self)
 Insert this macro in a cpp file and pass the class name of the to-be-enumerable class as the parameter. More...
 

Macro Definition Documentation

#define EZ_DECLARE_ENUMERABLE_CLASS (   self)    EZ_DECLARE_ENUMERABLE_CLASS_WITH_BASE(self, ezNoBase)

Insert this macro in a class that is supposed to be enumerable, and pass the class name as the parameter.

See class ezEnumerable for more details.

#define EZ_DECLARE_ENUMERABLE_CLASS_WITH_BASE (   self,
  base 
)
Value:
private: \
typedef base ezEnumerableBase; \
friend class ezEnumerable<self, base>; \
static ezEnumerable<self, base>* s_pFirstInstance; \
static ezEnumerable<self, base>* s_pLastInstance; \
static ezUInt32 s_uiInstances; \
public: \
static self* GetFirstInstance() { return (self*) s_pFirstInstance; } \
self* GetNextInstance() { return (self*) m_pNextInstance; } \
private:

Insert this macro in a class that is supposed to be enumerable, and pass the class name as the parameter.

See class ezEnumerable for more details.

#define EZ_ENUMERABLE_CLASS_IMPLEMENTATION (   self)
Value:
ezEnumerable<self, self::ezEnumerableBase>* self::s_pFirstInstance = nullptr; \
ezEnumerable<self, self::ezEnumerableBase>* self::s_pLastInstance = nullptr; \
ezUInt32 self::s_uiInstances = 0

Insert this macro in a cpp file and pass the class name of the to-be-enumerable class as the parameter.

See class ezEnumerable for more details.