i6engine  1.0
i6e::modules::ComponentFactory Class Reference

Factory in order to create Component. More...

#include <D:/Projekte/i6engine/libs/i6engine-modules/include/i6engine/modules/object/ComponentFactory.h>

Public Member Functions

 ComponentFactory ()
 used to easily create special Components More...
 
 ~ComponentFactory ()
 Destructor for ComponentsFactory. Clears the map of Create methods. More...
 
void registerCTemplate (const std::string &GOCType, const api::createGOCCallback &fn)
 register a new Template After a template is registered you can easily create new objects of that type with createGOC() More...
 
api::ComPtr createGOC (int64_t id, const std::string &GOCType, const api::attributeMap &params, const api::WeakGOPtr &owner) const
 Creates a new Component. More...
 
void enableTicking (bool allowTicking)
 sets whether newly created Components shall be allowed to tick or not default value is true More...
 

Detailed Description

Factory in order to create Component.

See also
api::Component

Definition at line 60 of file ComponentFactory.h.

Constructor & Destructor Documentation

i6e::modules::ComponentFactory::ComponentFactory ( )

used to easily create special Components

It is possible to register different Components at the factory with a string to identify them.
After registering, you can create this kind of Component by just calling the create function with the ID-String

i6e::modules::ComponentFactory::~ComponentFactory ( )

Destructor for ComponentsFactory. Clears the map of Create methods.

Member Function Documentation

api::ComPtr i6e::modules::ComponentFactory::createGOC ( int64_t  id,
const std::string &  GOCType,
const api::attributeMap params,
const api::WeakGOPtr owner 
) const

Creates a new Component.

Parameters
[in]GOCTypename of the Component to create.
[in]paramsa std::map<std::string, std::string> used to parameterize the creation process
Returns
a pointer to the created GOComponent
Exceptions
I6_FAILUREWhen GOCType is not registered at this factory.
void i6e::modules::ComponentFactory::enableTicking ( bool  allowTicking)
inline

sets whether newly created Components shall be allowed to tick or not default value is true

Definition at line 99 of file ComponentFactory.h.

void i6e::modules::ComponentFactory::registerCTemplate ( const std::string &  GOCType,
const api::createGOCCallback fn 
)

register a new Template After a template is registered you can easily create new objects of that type with createGOC()

See also
createGOCCallback()
Parameters
[in]namethe string used to identify this Template. The name must be unique.
[in]fnthe createGOCCallback function, which creates the Component

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