Pyrogenesis HEAD
Pyrogenesis, a RTS Engine
Component.h File Reference
Include dependency graph for Component.h:

Go to the source code of this file.

Macros

#define REGISTER_COMPONENT_TYPE(cname)
 
#define DEFAULT_COMPONENT_ALLOCATOR(cname)
 
#define DEFAULT_MOCK_COMPONENT()
 

Macro Definition Documentation

◆ DEFAULT_COMPONENT_ALLOCATOR

#define DEFAULT_COMPONENT_ALLOCATOR (   cname)
Value:
static IComponent* Allocate(const Script::Interface&, JS::HandleValue) { return new CCmp##cname(); } \
static void Deallocate(IComponent* cmp) { delete static_cast<CCmp##cname*> (cmp); } \
int GetComponentTypeId() const override \
{ \
return CID_##cname; \
}
Definition: IComponent.h:33
Definition: Interface.h:93
static io::BufferPtr Allocate(size_t size, size_t alignment=maxSectorSize)
Definition: io.h:74

◆ DEFAULT_MOCK_COMPONENT

#define DEFAULT_MOCK_COMPONENT ( )
Value:
int GetComponentTypeId() const override \
{ \
return -1; \
} \
void Init(const CParamNode&) override \
{ \
} \
void Deinit() override \
{ \
} \
void Serialize(ISerializer&) override \
{ \
} \
void Deserialize(const CParamNode&, IDeserializer&) override \
{ \
} \
bool Init(const CmdLineArgs &args, int flags)
Returns true if successful, false if Init is aborted early (for instance if mods changed,...
Definition: GameSetup.cpp:487
An entity initialisation parameter node.
Definition: ParamNode.h:153
Deserialization interface; see serialization overview.
Definition: IDeserializer.h:40
Serialization interface; see serialization overview.
Definition: ISerializer.h:126
Definition: SerializeTemplates.h:64

◆ REGISTER_COMPONENT_TYPE

#define REGISTER_COMPONENT_TYPE (   cname)
Value:
void RegisterComponentType_##cname(CComponentManager& mgr) \
{ \
IComponent::RegisterComponentType(mgr, CCmp##cname::GetInterfaceId(), CID_##cname, CCmp##cname::Allocate, CCmp##cname::Deallocate, #cname, CCmp##cname::GetSchema()); \
CCmp##cname::ClassInit(mgr); \
}
Definition: ComponentManager.h:46
static void RegisterComponentType(CComponentManager &mgr, EInterfaceId iid, EComponentTypeId cid, AllocFunc alloc, DeallocFunc dealloc, const char *name, const std::string &schema)
Definition: IComponent.cpp:36