Pyrogenesis  trunk
Macros
Component.h File Reference
#include "simulation2/system/CmpPtr.h"
#include "simulation2/system/Components.h"
#include "simulation2/system/ComponentManager.h"
#include "simulation2/system/IComponent.h"
#include "simulation2/system/ParamNode.h"
#include "simulation2/system/SimContext.h"
#include "simulation2/serialization/ISerializer.h"
#include "simulation2/serialization/IDeserializer.h"
Include dependency graph for Component.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

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

Macro Definition Documentation

#define DEFAULT_COMPONENT_ALLOCATOR (   cname)
Value:
static IComponent* Allocate(ScriptInterface&, JS::HandleValue) { return new CCmp##cname(); } \
static void Deallocate(IComponent* cmp) { delete static_cast<CCmp##cname*> (cmp); } \
virtual int GetComponentTypeId() const \
{ \
return CID_##cname; \
}
Definition: IComponent.h:33
shared_ptr< u8 > Allocate(size_t size)
Definition: shared_ptr.cpp:55
Abstraction around a SpiderMonkey JSContext.
Definition: ScriptInterface.h:71
#define DEFAULT_MOCK_COMPONENT ( )
Value:
virtual int GetComponentTypeId() const \
{ \
return -1; \
} \
virtual void Init(const CParamNode& UNUSED(paramNode)) \
{ \
} \
virtual void Deinit() \
{ \
} \
virtual void Serialize(ISerializer& UNUSED(serialize)) \
{ \
} \
virtual void Deserialize(const CParamNode& UNUSED(paramNode), IDeserializer& UNUSED(deserialize)) \
{ \
} \
An entity initialisation parameter node.
Definition: ParamNode.h:148
#define UNUSED(param)
mark a function parameter as unused and avoid the corresponding compiler warning. ...
Definition: code_annotation.h:38
Serialization interface; see serialization overview.
Definition: ISerializer.h:120
static Status Init()
Definition: h_mgr.cpp:744
Deserialization interface; see serialization overview.
Definition: IDeserializer.h:34
#define DEFAULT_SCRIPT_WRAPPER (   cname)
#define REGISTER_COMPONENT_SCRIPT_WRAPPER (   cname)
Value:
void RegisterComponentType_##cname(CComponentManager& mgr) \
{ \
mgr.RegisterComponentTypeScriptWrapper(CCmp##cname::GetInterfaceId(), CID_##cname, CCmp##cname::Allocate, CCmp##cname::Deallocate, #cname, CCmp##cname::GetSchema()); \
CCmp##cname::ClassInit(mgr); \
}
shared_ptr< u8 > Allocate(size_t size)
Definition: shared_ptr.cpp:55
Definition: ComponentManager.h:40
#define REGISTER_COMPONENT_TYPE (   cname)
Value:
void RegisterComponentType_##cname(CComponentManager& mgr) \
{ \
mgr.RegisterComponentType(CCmp##cname::GetInterfaceId(), CID_##cname, CCmp##cname::Allocate, CCmp##cname::Deallocate, #cname, CCmp##cname::GetSchema()); \
CCmp##cname::ClassInit(mgr); \
}
shared_ptr< u8 > Allocate(size_t size)
Definition: shared_ptr.cpp:55
Definition: ComponentManager.h:40