Behaviour factory.
More...
#include <BehaviourFactory.h>
|
enum | ModuleType { kNone = -1
, kNative = 0
, kScript = 1
} |
|
typedef Behaviour *(* | creatorFn) () |
|
Behaviour factory.
Factory used to create Behaviours.
◆ createBehaviour()
Behaviour* Atoms::BehaviourFactory::createBehaviour |
( |
const std::string & |
name | ) |
|
Creates a behaviour.
- Parameters
-
- Returns
- Pinter to the behaviour created
◆ deregisterBehaviour()
bool Atoms::BehaviourFactory::deregisterBehaviour |
( |
const std::string & |
name | ) |
|
Deregisters a Behaviour type from the factory.
- Parameters
-
- Returns
- True if the Behaviour is removed from the map
◆ getBehaviourCategory()
const std::string Atoms::BehaviourFactory::getBehaviourCategory |
( |
const std::string & |
moduleName | ) |
|
Gets a registered behaviour category.
- Returns
- String representing the behaviour category, the string will be empty if this module has no category
◆ getRegisteredBehaviours()
std::vector<std::string> Atoms::BehaviourFactory::getRegisteredBehaviours |
( |
| ) |
|
Gets all registered behaviour modules.
- Returns
- List of all behaviour registered
◆ isRegistered()
bool Atoms::BehaviourFactory::isRegistered |
( |
const std::string & |
name | ) |
|
Check if a behaviour is registered.
- Parameters
-
- Returns
- Return true if the behaviour module is already registered
◆ registerBehaviour()
bool Atoms::BehaviourFactory::registerBehaviour |
( |
const std::string & |
moduleName, |
|
|
creatorFn |
func, |
|
|
unsigned int |
moduleType = kNative , |
|
|
bool |
replace = false , |
|
|
const std::string |
category = "" |
|
) |
| |
Registers a behaviour in the factory.
- Parameters
-
name | Behavioir name |
func | creator function |
replace | Replace if it already exists |
- Returns
- True if the behaviour is added to the map
The documentation for this class was generated from the following file: