Pyrogenesis  trunk
Public Member Functions | Private Attributes | List of all members
ComponentTestHelper Class Reference

Class to test a single component. More...

#include <ComponentTest.h>

Collaboration diagram for ComponentTestHelper:
Collaboration graph
[legend]

Public Member Functions

 ComponentTestHelper (shared_ptr< ScriptRuntime > runtime)
 
ScriptInterfaceGetScriptInterface ()
 
CSimContextGetSimContext ()
 
template<typename T >
TAdd (EComponentTypeId cid, const std::string &xml, entity_id_t ent=10)
 Call this once to initialise the test helper with a component. More...
 
void AddMock (entity_id_t ent, EInterfaceId iid, IComponent &component)
 
void HandleMessage (IComponent *cmp, const CMessage &msg, bool global)
 
void Roundtrip (bool verbose=false)
 Checks that the object roundtrips through its serialize/deserialize functions correctly. More...
 

Private Attributes

CSimContext m_Context
 
CComponentManager m_ComponentManager
 
CParamNode m_Param
 
IComponentm_Cmp
 
EComponentTypeId m_Cid
 

Detailed Description

Class to test a single component.

Constructor & Destructor Documentation

ComponentTestHelper::ComponentTestHelper ( shared_ptr< ScriptRuntime runtime)
inline

Member Function Documentation

template<typename T >
T* ComponentTestHelper::Add ( EComponentTypeId  cid,
const std::string &  xml,
entity_id_t  ent = 10 
)
inline

Call this once to initialise the test helper with a component.

void ComponentTestHelper::AddMock ( entity_id_t  ent,
EInterfaceId  iid,
IComponent component 
)
inline
ScriptInterface& ComponentTestHelper::GetScriptInterface ( )
inline
CSimContext& ComponentTestHelper::GetSimContext ( )
inline
void ComponentTestHelper::HandleMessage ( IComponent cmp,
const CMessage msg,
bool  global 
)
inline
void ComponentTestHelper::Roundtrip ( bool  verbose = false)
inline

Checks that the object roundtrips through its serialize/deserialize functions correctly.

Computes the debug output, hash, and binary serialization; then deserializes into a new system and checks the serialization outputs are unchanged.

Member Data Documentation

EComponentTypeId ComponentTestHelper::m_Cid
private
IComponent* ComponentTestHelper::m_Cmp
private
CComponentManager ComponentTestHelper::m_ComponentManager
private
CSimContext ComponentTestHelper::m_Context
private
CParamNode ComponentTestHelper::m_Param
private

The documentation for this class was generated from the following file: