-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcpp.hint
More file actions
7 lines (7 loc) · 1.36 KB
/
cpp.hint
File metadata and controls
7 lines (7 loc) · 1.36 KB
1
2
3
4
5
6
7
// Hint files help the Visual Studio IDE interpret Visual C++ identifiers
// such as names of functions and macros.
// For more information see https://go.microsoft.com/fwlink/?linkid=865984
#define ENTITYALLOCATION(TYPE) static void * operator new (size_t size) { return TYPE::m_sClass.GetPoolMemory(); } static void operator delete (void *pInstance) { TYPE::m_sClass.ReturnPoolMemory(pInstance); } static void * operator new (size_t size, void *p) throw() { return p; } static void operator delete (void *, void *) throw() { } static void * Allocate() { return malloc(sizeof(TYPE)); } static void Deallocate(void *pInstance) { free(pInstance); } static Entity * NewInstance() { return new TYPE; } virtual Entity * Clone(Entity *pCloneTo = 0) const { TYPE *pEnt = pCloneTo ? dynamic_cast<TYPE *>(pCloneTo) : new TYPE(); RTEAssert(pEnt, "Tried to clone to an incompatible instance!"); if (pCloneTo) { pEnt->Destroy(); } pEnt->Create(*this); return pEnt; }
#define CLASSINFOGETTERS const Entity::ClassInfo & GetClass() const { return m_sClass; } const std::string & GetClassName() const { return m_sClass.GetName(); }
#define ABSTRACTCLASSINFO(TYPE, PARENT) Entity::ClassInfo TYPE::m_sClass(#TYPE, &PARENT::m_sClass);
#define CONCRETECLASSINFO(TYPE, PARENT, BLOCKCOUNT) Entity::ClassInfo TYPE::m_sClass(#TYPE, &PARENT::m_sClass, TYPE::Allocate, TYPE::Deallocate, TYPE::NewInstance, BLOCKCOUNT);