#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.
-//
-
-// EXTERNAL INCLUDES
-#ifdef DEBUG_ENABLED
-#include <set>
-#endif
+/*
+ * 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
#include <dali/public-api/object/ref-object.h>
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 );
/**
* @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;
}
/**
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;
};