-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcpp.hint
10 lines (10 loc) · 1.91 KB
/
cpp.hint
1
2
3
4
5
6
7
8
9
10
// 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 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);
#define ClassInfoGetters const Entity::ClassInfo & GetClass() const { return m_sClass; } const std::string & GetClassName() const { return m_sClass.GetName(); }
#define EntityAllocation(TYPE) static void * operator new (size_t size) { return TYPE::m_sClass.GetPoolMemory(); } static void operator delete (void *instance) { TYPE::m_sClass.ReturnPoolMemory(instance); } 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 *instance) { free(instance); } static Entity * NewInstance() { return new TYPE; } Entity * Clone(Entity *cloneTo = 0) const override { TYPE *ent = cloneTo ? dynamic_cast<TYPE *>(cloneTo) : new TYPE(); RTEAssert(ent, "Tried to clone to an incompatible instance!"); if (cloneTo) { ent->Destroy(); } ent->Create(*this); return ent; }
#define ScriptFunctionNames(__VA_ARGS__) virtual std::vector<std::string> GetSupportedScriptFunctionNames() const { return {__VA_ARGS__}; }
#define AddScriptFunctionNames(PARENT, __VA_ARGS__) std::vector<std::string> GetSupportedScriptFunctionNames() const override { std::vector<std::string> functionNames = PARENT::GetSupportedScriptFunctionNames(); functionNames.insert(functionNames.end(), {__VA_ARGS__}); return functionNames; }
#define SerializableOverrideMethods int ReadProperty(std::string propName, Reader &reader) override; int Save(Writer &writer) const override;