GAMS  1.2.2
GroupFactoryRepository.h
Go to the documentation of this file.
1 
54 #ifndef _GAMS_GROUPS_GROUP_FACTORY_REPOSITORY_H_
55 #define _GAMS_GROUPS_GROUP_FACTORY_REPOSITORY_H_
56 
57 #include <vector>
58 #include <string>
59 #include <map>
60 
61 #include "madara/knowledge/KnowledgeBase.h"
62 #include "GroupFactory.h"
63 
64 namespace gams
65 {
66  namespace groups
67  {
71  typedef std::map <GroupType, GroupFactory *> GroupFactoryMap;
72 
77  {
78  public:
83  GroupFactoryRepository (madara::knowledge::KnowledgeBase * knowledge = 0);
84 
88  virtual ~GroupFactoryRepository ();
89 
96  void add (GroupType type,
97  GroupFactory * factory);
98 
104  GroupBase * create (const std::string & prefix);
105 
111  GroupBase * create (GroupType type);
112 
117  void set_knowledge (madara::knowledge::KnowledgeBase * knowledge);
118 
119  protected:
120 
124  void init (void);
125 
127  madara::knowledge::KnowledgeBase * knowledge_;
128 
130  GroupFactoryMap factory_map_;
131  };
132  }
133 }
134 
135 #include "GroupFactoryRepository.inl"
136 
137 #endif // _GAMS_GROUPS_GROUP_FACTORY_REPOSITORY_H_
madara::knowledge::KnowledgeBase * knowledge_
knowledge base containing variables
GroupFactoryMap factory_map_
a mapping of types to group factories
Copyright (c) 2016 Carnegie Mellon University.
Contains all GAMS-related tools, classes and code.
Base class for a group of agents.
Definition: GroupBase.h:90
Base class for a group factory.
Definition: GroupFactory.h:71
#define GAMS_EXPORT
Definition: GamsExport.h:20
std::map< GroupType, GroupFactory * > GroupFactoryMap
Convenience typedef for a map of types to factories.
A repository for group factories.
madara::knowledge::KnowledgeRecord::Integer GroupType
convenience typedef for GroupType