-#ifndef __DALI_INTERNAL_OBJECT_REGISTRY_H__
-#define __DALI_INTERNAL_OBJECT_REGISTRY_H__
+#ifndef DALI_INTERNAL_OBJECT_REGISTRY_H
+#define DALI_INTERNAL_OBJECT_REGISTRY_H
/*
- * Copyright (c) 2014 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2019 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.
*/
// 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>
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;
};
} // namespace Dali
-#endif // __DALI_INTERNAL_OBJECT_REGISTRY_H__
+#endif // DALI_INTERNAL_OBJECT_REGISTRY_H