libaurum: apply smart pointer wider and extract impl out
[platform/core/uifw/aurum.git] / org.tizen.aurum-bootstrap / inc / ObjectMapper.h
index b1f127f..3e9dc50 100644 (file)
@@ -8,7 +8,8 @@
 
 class ObjectMapper {
 private:
-    std::map<std::string, std::unique_ptr<UiObject>> mObjectMap;
+    std::map<std::string, std::shared_ptr<UiObject>> mObjectMap;
+    std::map<std::shared_ptr<UiObject>, std::string> mObjectMapReverse;
     unsigned long long                               mObjCounter;
 
 private:
@@ -19,8 +20,13 @@ public:
 
 public:
     static ObjectMapper *getInstance();
-    std::string          addElement(std::unique_ptr<UiObject> object);
-    UiObject *           getElement(const std::string &key);
+    std::string addElement(std::shared_ptr<UiObject> object);
+
+    std::shared_ptr<UiObject> getElement(const std::string key);
+    std::string getElement(std::shared_ptr<UiObject> object);
+
+    bool removeElement(const std::string key);
+    bool removeElement(std::shared_ptr<UiObject> object);
 };
 
 #endif
\ No newline at end of file