LRT14  1.0
 All Classes Namespaces Functions Variables Enumerations Enumerator
DataPool.h
1 #ifndef RHESUS_COMPONENT_DATA_MANAGER_H_
2 #define RHESUS_COMPONENT_DATA_MANAGER_H_
3 
4 #include "DataUnit.h"
5 #include "../Tasks/lock_on.h"
6 
7 #include <hash_map>
8 #include <string>
9 
10 namespace Rhesus
11 {
12 namespace Toolkit
13 {
14 namespace InterCommunication
15 {
16 
22  class DataPool
23  {
24  public:
29  static void AddUnit(std::string name);
30 
35  static DataUnit& Get(std::string unit);
36 
43  template<typename T>
44  static void Set(std::string unit, std::string key, T value);
45 
49  static void Clear();
50 
51  private:
52 
53  static std::hash_map<std::string, DataUnit> s_componentMap;
54 
55  static Rhesus::Toolkit::Tasks::Mutex s_syncObject;
56 
57  static bool KeyExists(std::string c);
58 
59  };
60 }
61 }
62 }
63 
64 #endif