[dali_1.3.20] Merge branch 'devel/master'
[platform/core/uifw/dali-core.git] / dali / internal / event / common / object-registry-impl.h
index e57e75b..13f225f 100644 (file)
@@ -1,26 +1,24 @@
 #ifndef __DALI_INTERNAL_OBJECT_REGISTRY_H__
 #define __DALI_INTERNAL_OBJECT_REGISTRY_H__
 
-//
-// Copyright (c) 2014 Samsung Electronics Co., Ltd.
-//
-// Licensed under the Flora License, Version 1.0 (the License);
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-//     http://floralicense.org/license/
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an AS IS BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-//
+/*
+ * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
 
 // INTERNAL INCLUDES
-#ifdef DEBUG_ENABLED
-#include <dali/public-api/common/set-wrapper.h>
-#endif
 #include <dali/public-api/object/ref-object.h>
 #include <dali/public-api/object/object-registry.h>
 #include <dali/public-api/object/base-object.h>
@@ -58,9 +56,12 @@ public:
   static ObjectRegistryPtr New();
 
   /**
-   * Registers the Object into the Object Registry, Which notifies
-   * about this object creation to its observers.
+   * Registers the Object into the Object Registry, which notifies
+   * about this object creation to its observers using signals. As
+   * the signals use a BaseHandle, the object must already have a
+   * ref-count > 0, otherwise it will get deleted on signal completion.
    * @pre The object is not already registered.
+   * @pre the object is ref counted (held in an intrusive pointer)
    * @param[in] object Pointer to the object.
    */
   void RegisterObject( Dali::BaseObject* object );
@@ -76,17 +77,17 @@ public:
   /**
    * @copydoc Dali::ObjectRegistry::ObjectCreatedSignal()
    */
-  Dali::ObjectRegistry::ObjectCreatedSignalV2& ObjectCreatedSignal()
+  Dali::ObjectRegistry::ObjectCreatedSignalType& ObjectCreatedSignal()
   {
-    return mObjectCreatedSignalV2;
+    return mObjectCreatedSignal;
   }
 
   /**
    * @copydoc Dali::ObjectRegistry::ObjectDestroyedSignal()
    */
-  Dali::ObjectRegistry::ObjectDestroyedSignalV2& ObjectDestroyedSignal()
+  Dali::ObjectRegistry::ObjectDestroyedSignalType& ObjectDestroyedSignal()
   {
-    return mObjectDestroyedSignalV2;
+    return mObjectDestroyedSignal;
   }
 
   /**
@@ -114,12 +115,8 @@ private:
 
 private:
 
-  Dali::ObjectRegistry::ObjectCreatedSignalV2 mObjectCreatedSignalV2;
-  Dali::ObjectRegistry::ObjectDestroyedSignalV2 mObjectDestroyedSignalV2;
-
-#ifdef DEBUG_ENABLED
-  std::set< Dali::BaseObject* > mDebugRegistry; ///< This allows us to assert that an object is only registered once (debug builds only)
-#endif
+  Dali::ObjectRegistry::ObjectCreatedSignalType mObjectCreatedSignal;
+  Dali::ObjectRegistry::ObjectDestroyedSignalType mObjectDestroyedSignal;
 
 };