GAMS  1.4.0
gams::platforms::PlatformFactoryRepository Class Reference

The controller's platform factory. More...

#include <PlatformFactoryRepository.h>

Public Member Functions

 PlatformFactoryRepository (madara::knowledge::KnowledgeBase *knowledge=0, variables::Sensors *sensors=0, variables::Platforms *platforms=0, variables::Self *self=0)
 Constructor. More...
 
 ~PlatformFactoryRepository ()
 Destructor. More...
 
void add (const std::vector< std::string > &aliases, PlatformFactory *factory)
 Adds an algorithm factory. More...
 
BasePlatformcreate (const std::string &type, const madara::knowledge::KnowledgeMap &args=madara::knowledge::KnowledgeMap())
 Creates a platform. More...
 
bool exists (const std::string &prefix) const
 Checks if a platform type exists in the repository. More...
 
void initialize_default_mappings (void)
 Initializes factories for all supported GAMS algorithms. More...
 
void set_knowledge (madara::knowledge::KnowledgeBase *knowledge)
 Sets the knowledge base. More...
 
void set_platforms (variables::Platforms *platforms)
 Sets the map of platform names to platform information. More...
 
void set_self (variables::Self *self)
 Sets self-referencing variables. More...
 
void set_sensors (variables::Sensors *sensors)
 Sets the map of sensor names to sensor information. More...
 

Private Attributes

FactoryMap factory_map_
 a map of all aliases to factories More...
 
madara::knowledge::KnowledgeBase * knowledge_
 knowledge base containing variables More...
 
variables::Platformsplatforms_
 platform variables More...
 
variables::Selfself_
 self-referencing variables More...
 
variables::Sensorssensors_
 sensor variables More...
 

Detailed Description

The controller's platform factory.

Definition at line 75 of file PlatformFactoryRepository.h.

Constructor & Destructor Documentation

◆ PlatformFactoryRepository()

gams::platforms::PlatformFactoryRepository::PlatformFactoryRepository ( madara::knowledge::KnowledgeBase *  knowledge = 0,
variables::Sensors sensors = 0,
variables::Platforms platforms = 0,
variables::Self self = 0 
)

Constructor.

Parameters
knowledgeknowledge base
sensorsmap of sensor names to sensor information
platformsmap of platform names to platform information
selfagent variables that describe self state

◆ ~PlatformFactoryRepository()

gams::platforms::PlatformFactoryRepository::~PlatformFactoryRepository ( )

Destructor.

Member Function Documentation

◆ add()

void gams::platforms::PlatformFactoryRepository::add ( const std::vector< std::string > &  aliases,
PlatformFactory factory 
)

Adds an algorithm factory.

Parameters
aliasesthe named aliases for the factory. All aliases will be converted to lower case
factorythe factory for creating an algorithm
Returns
the new algorithm

◆ create()

BasePlatform* gams::platforms::PlatformFactoryRepository::create ( const std::string &  type,
const madara::knowledge::KnowledgeMap &  args = madara::knowledge::KnowledgeMap() 
)

Creates a platform.

Parameters
typetype of platform to create
argsa vector of Knowledge Record arguments
Returns
the new platform

◆ exists()

bool gams::platforms::PlatformFactoryRepository::exists ( const std::string &  prefix) const

Checks if a platform type exists in the repository.

Parameters
typetype of platform
Returns
true, if the platform has a factory associated with it

◆ initialize_default_mappings()

void gams::platforms::PlatformFactoryRepository::initialize_default_mappings ( void  )

Initializes factories for all supported GAMS algorithms.

◆ set_knowledge()

void gams::platforms::PlatformFactoryRepository::set_knowledge ( madara::knowledge::KnowledgeBase *  knowledge)

Sets the knowledge base.

Parameters
knowledgethe knowledge base to use

◆ set_platforms()

void gams::platforms::PlatformFactoryRepository::set_platforms ( variables::Platforms platforms)

Sets the map of platform names to platform information.

Parameters
platformsmap of platform names to platform information

◆ set_self()

void gams::platforms::PlatformFactoryRepository::set_self ( variables::Self self)

Sets self-referencing variables.

Parameters
selfself-referencing variables

◆ set_sensors()

void gams::platforms::PlatformFactoryRepository::set_sensors ( variables::Sensors sensors)

Sets the map of sensor names to sensor information.

Parameters
sensorsmap of sensor names to sensor information

Member Data Documentation

◆ factory_map_

FactoryMap gams::platforms::PlatformFactoryRepository::factory_map_
private

a map of all aliases to factories

Definition at line 166 of file PlatformFactoryRepository.h.

◆ knowledge_

madara::knowledge::KnowledgeBase* gams::platforms::PlatformFactoryRepository::knowledge_
private

knowledge base containing variables

Definition at line 154 of file PlatformFactoryRepository.h.

◆ platforms_

variables::Platforms* gams::platforms::PlatformFactoryRepository::platforms_
private

platform variables

Definition at line 157 of file PlatformFactoryRepository.h.

◆ self_

variables::Self* gams::platforms::PlatformFactoryRepository::self_
private

self-referencing variables

Definition at line 160 of file PlatformFactoryRepository.h.

◆ sensors_

variables::Sensors* gams::platforms::PlatformFactoryRepository::sensors_
private

sensor variables

Definition at line 163 of file PlatformFactoryRepository.h.


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