libaurum: apply smart pointer wider and extract impl out
[platform/core/uifw/aurum.git] / org.tizen.aurum-bootstrap / inc / ObjectMapper.h
1 #ifndef OBJECT_MAPPER_H
2 #define OBJECT_MAPPER_H
3
4 #include <map>
5 #include <string>
6
7 #include "UiObject.h"
8
9 class ObjectMapper {
10 private:
11     std::map<std::string, std::shared_ptr<UiObject>> mObjectMap;
12     std::map<std::shared_ptr<UiObject>, std::string> mObjectMapReverse;
13     unsigned long long                               mObjCounter;
14
15 private:
16     ObjectMapper();
17
18 public:
19     ~ObjectMapper();
20
21 public:
22     static ObjectMapper *getInstance();
23     std::string addElement(std::shared_ptr<UiObject> object);
24
25     std::shared_ptr<UiObject> getElement(const std::string key);
26     std::string getElement(std::shared_ptr<UiObject> object);
27
28     bool removeElement(const std::string key);
29     bool removeElement(std::shared_ptr<UiObject> object);
30 };
31
32 #endif