Atoms Crowd  7.0.0
Atoms::SimulationEvents Class Reference

Simulation event factory. More...

#include <SimulationEvents.h>

Public Types

typedef SimulationEvent *(* creatorFn) (const std::string &parameter)
 

Public Member Functions

AtomsPtr< SimulationEventcreateSimulationEvent (const std::string &name)
 Creates a SimulationEvent. More...
 
SimulationEventcreateSimulationEventRawPtr (const std::string &name)
 Creates a SimulationEvent. More...
 
bool registerSimulationEvent (const std::string &eventName, creatorFn func, unsigned int moduleType=SimulationEvent::kNative, bool replace=false)
 Registers a behaviour module in the factory. More...
 
bool deregisterSimulationEvent (const std::string &name)
 Deregisters a SimulationEventtype from the factory. More...
 
std::vector< std::string > getRegisteredSimulationEvents ()
 Gets all Simulation Event modules. More...
 
bool isRegistered (const std::string &name)
 Checks if a Simulation Event is registered. More...
 
void clear ()
 Clears factory.
 
short eventType (const std::string &name)
 Gets the event type.
 

Static Public Member Functions

static SimulationEventsinstance ()
 Singleton access.
 

Detailed Description

Simulation event factory.

Factory used to create Simulation events.

Member Function Documentation

◆ createSimulationEvent()

AtomsPtr<SimulationEvent> Atoms::SimulationEvents::createSimulationEvent ( const std::string &  name)

Creates a SimulationEvent.

Parameters
nameSimulationEvent name
Returns
Smart pointer to the behaviour module created

◆ createSimulationEventRawPtr()

SimulationEvent* Atoms::SimulationEvents::createSimulationEventRawPtr ( const std::string &  name)

Creates a SimulationEvent.

Parameters
namebehaviour module name
Returns
Raw pointer to the behaviour module created

◆ deregisterSimulationEvent()

bool Atoms::SimulationEvents::deregisterSimulationEvent ( const std::string &  name)

Deregisters a SimulationEventtype from the factory.

Parameters
nameBehaviour module name
Returns
True if the module is removed from the map

◆ getRegisteredSimulationEvents()

std::vector<std::string> Atoms::SimulationEvents::getRegisteredSimulationEvents ( )

Gets all Simulation Event modules.

Returns
List of all behaviour module registered

◆ isRegistered()

bool Atoms::SimulationEvents::isRegistered ( const std::string &  name)

Checks if a Simulation Event is registered.

Parameters
nameBehaviour module name
Returns
Return true if the behaviour module is already registered

◆ registerSimulationEvent()

bool Atoms::SimulationEvents::registerSimulationEvent ( const std::string &  eventName,
creatorFn  func,
unsigned int  moduleType = SimulationEvent::kNative,
bool  replace = false 
)

Registers a behaviour module in the factory.

Parameters
nameSimulationEvent name
funccreator function
replaceReplace module if it already exists
Returns
True if the module is added to the map

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