hebiros_group_registry.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include "hebiros_group.h"
4 
5 namespace hebiros {
6 
7  // This class contains a list of named groups.
9  public:
10  // TODO: right now this is a singleton during refactoring; this should be
11  // changed and owned by the node at a later point, and the singleton removed
13 
14  // Takes ownership of this group, and adds it to the registry of groups.
15  void addGroup(const std::string& name, std::unique_ptr<HebirosGroup> group);
16 
17  // Returns nullptr on "not found". Ownership is not transferred!
18  HebirosGroup* getGroup(const std::string& name); // Should I just make this const instead?
19  // Returns nullptr on "not found". Ownership is not transferred!
20  const HebirosGroup* getGroup(const std::string& name) const;
21 
22  void removeGroup(const std::string& name);
23 
24  bool hasGroup(const std::string& name) const;
25 
26  private:
27 
28  // Note -- after refactoring so this isn't a singleton, this should probably
29  // become public.
30  HebirosGroupRegistry() = default;
31 
32  std::map<std::string, std::unique_ptr<HebirosGroup>> _groups{};
33 
35 
36  };
37 
38 } // namespace hebiros
void removeGroup(const std::string &name)
void addGroup(const std::string &name, std::unique_ptr< HebirosGroup > group)
static HebirosGroupRegistry _instance
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