hebiros_group_registry.cpp
Go to the documentation of this file.
2 
3 namespace hebiros {
4 
5  // TODO: temporary! remove!
7  {
8  static HebirosGroupRegistry s;
9  return s;
10  }
11 
12  void HebirosGroupRegistry::addGroup(const std::string& name, std::unique_ptr<HebirosGroup> group) {
13  _groups[name] = std::move(group);
14  }
15 
16  HebirosGroup* HebirosGroupRegistry::getGroup(const std::string& name) {
17  if (hasGroup(name))
18  return &*_groups[name];
19  return nullptr;
20  }
21 
22  const HebirosGroup* HebirosGroupRegistry::getGroup(const std::string& name) const {
23  if (hasGroup(name))
24  return &*(_groups.find(name)->second);
25  return nullptr;
26  }
27 
28  void HebirosGroupRegistry::removeGroup(const std::string& name) {
29  _groups.erase(name);
30  }
31 
32  bool HebirosGroupRegistry::hasGroup(const std::string& name) const {
33  return _groups.find(name) != _groups.end();
34  }
35 
36 } // namespace hebiros
void removeGroup(const std::string &name)
void addGroup(const std::string &name, std::unique_ptr< HebirosGroup > group)
XmlRpcServer s
static HebirosGroupRegistry & Instance()
HebirosGroup * getGroup(const std::string &name)
std::map< std::string, std::unique_ptr< HebirosGroup > > _groups
bool hasGroup(const std::string &name) const


hebiros
Author(s): Xavier Artache , Matthew Tesch
autogenerated on Thu Sep 3 2020 04:08:14