ConverterRegistry.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <map>
4 #include <memory>
5 #include <string>
6 #include <vector>
7 
8 #include "ConverterInterface.h"
9 
10 
12 {
14  {
15  public:
16 
18 
19 
20  template <class ConverterT, class ...Args>
21  void add(const std::string& key, Args... args)
22  {
23  converters[key].reset(new ConverterT(args...));
24  }
25 
26 
27  ConverterInterface* get(const std::string& key) const;
28  std::vector<std::string> getKeys() const;
29 
30 
31  private:
32 
33  std::map<std::string, std::unique_ptr<ConverterInterface>> converters;
34 
35  };
36 }
37 
armarx::armem::server::robot_state::proprioception
Definition: forward_declarations.h:78
armarx::armem::server::robot_state::proprioception::ConverterInterface
Definition: ConverterInterface.h:20
armarx::armem::server::robot_state::proprioception::ConverterRegistry
Definition: ConverterRegistry.h:13
armarx::armem::server::robot_state::proprioception::ConverterRegistry::ConverterRegistry
ConverterRegistry()
Definition: ConverterRegistry.cpp:11
armarx::armem::server::robot_state::proprioception::ConverterRegistry::add
void add(const std::string &key, Args... args)
Definition: ConverterRegistry.h:21
armarx::armem::server::robot_state::proprioception::ConverterRegistry::get
ConverterInterface * get(const std::string &key) const
Definition: ConverterRegistry.cpp:21
armarx::armem::server::robot_state::proprioception::ConverterRegistry::getKeys
std::vector< std::string > getKeys() const
Definition: ConverterRegistry.cpp:28
ConverterInterface.h