GAMS  1.2.2
PlatformFactoryRepository.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_PLATFORMS_PLATFORM_FACTORY_REPOSITORY_H_
55 #define _GAMS_PLATFORMS_PLATFORM_FACTORY_REPOSITORY_H_
56 
57 #include "gams/GamsExport.h"
60 #include "gams/variables/Self.h"
61 #include "gams/variables/Sensor.h"
62 #include "madara/knowledge/KnowledgeBase.h"
63 #include "PlatformFactory.h"
64 
65 namespace gams
66 {
67  namespace platforms
68  {
69 
70  typedef std::map <std::string, PlatformFactory *> FactoryMap;
71 
76  {
77  public:
86  madara::knowledge::KnowledgeBase * knowledge = 0,
87  variables::Sensors * sensors = 0,
88  variables::Platforms * platforms = 0,
89  variables::Self * self = 0);
90 
95 
103  void add (const std::vector <std::string> & aliases,
104  PlatformFactory * factory);
105 
112  BasePlatform * create (const std::string & type,
113  const madara::knowledge::KnowledgeMap & args = madara::knowledge::KnowledgeMap ());
114 
119  void set_knowledge (madara::knowledge::KnowledgeBase * knowledge);
120 
125  void set_platforms (variables::Platforms * platforms);
126 
131  void set_self (variables::Self * self);
132 
137  void set_sensors (variables::Sensors * sensors);
138 
142  void initialize_default_mappings (void);
143 
144  private:
145 
147  madara::knowledge::KnowledgeBase * knowledge_;
148 
151 
154 
157 
159  FactoryMap factory_map_;
160  };
161 
169  }
170 }
171 
172 #endif // _GAMS_PLATFORMS_PLATFORM_FACTORY_REPOSITORY_H_
Copyright (c) 2014 Carnegie Mellon University.
variables::Platforms * platforms_
platform variables
std::map< std::string, Sensor * > Sensors
a map of sensor names to the sensor information
Definition: Sensor.h:238
madara::knowledge::KnowledgeBase * knowledge_
knowledge base containing variables
variables::Self * self_
self-referencing variables
The base platform for all platforms to use.
Definition: BasePlatform.h:190
Copyright (c) 2014 Carnegie Mellon University.
Copyright (c) 2014 Carnegie Mellon University.
GAMS_EXPORT PlatformFactoryRepository * global_platform_factory()
A globally accessible platform factory.
std::map< std::string, PlatformFactory * > FactoryMap
Contains all GAMS-related tools, classes and code.
A container for self referencing information.
Definition: Self.h:69
Copyright (c) 2014 Carnegie Mellon University.
std::map< std::string, PlatformStatus > Platforms
a map of sensor names to the sensor information
FactoryMap factory_map_
a map of all aliases to factories
variables::Sensors * sensors_
sensor variables
#define GAMS_EXPORT
Definition: GamsExport.h:20
Base class for platform factories to create BasePlatforms.
Copyright (c) 2014 Carnegie Mellon University.
The controller&#39;s platform factory.