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 }
armarx::armem::server::robot_state::exteroception::ConverterInterface
Definition: ConverterInterface.h:20
armarx::armem::server::robot_state::exteroception::ConverterRegistry::ConverterRegistry
ConverterRegistry()
Definition: ConverterRegistry.cpp:11
armarx::armem::server::robot_state::exteroception::ConverterRegistry::add
void add(const std::string &key, Args... args)
Definition: ConverterRegistry.h:21
ConverterInterface.h
armarx::armem::server::robot_state::exteroception::ConverterRegistry
Definition: ConverterRegistry.h:13
armarx::armem::server::robot_state::exteroception
Definition: ArmarDEConverter.cpp:18
armarx::armem::server::robot_state::exteroception::ConverterRegistry::getKeys
std::vector< std::string > getKeys() const
Definition: ConverterRegistry.cpp:26
armarx::armem::server::robot_state::exteroception::ConverterRegistry::get
ConverterInterface * get(const std::string &key) const
Definition: ConverterRegistry.cpp:19