Dali 3D User Interface Engine
List of all members | Public Types | Public Member Functions
Dali::ObjectRegistry Class Reference

The ObjectRegistry notifies it's observers when an object is created. More...

#include <object-registry.h>

Inheritance diagram for Dali::ObjectRegistry:
Inheritance graph
[legend]
Collaboration diagram for Dali::ObjectRegistry:
Collaboration graph
[legend]

Public Types

typedef Signal< void(BaseHandle) > ObjectCreatedSignalType
 Object created signal .0. More...
 
typedef Signal< void(const
Dali::RefObject *) > 
ObjectDestroyedSignalType
 Object destroyed signal .0. More...
 
- Public Types inherited from Dali::BaseHandle
typedef void(BaseHandle::* BooleanType )() const
 Pointer-to-member type. More...
 

Public Member Functions

 ObjectRegistry ()
 Allows the creation of an empty objectRegistry handle. More...
 
 ~ObjectRegistry ()
 Destructor. More...
 
 ObjectRegistry (const ObjectRegistry &handle)
 This copy constructor is required for (smart) pointer semantics. More...
 
ObjectRegistryoperator= (const ObjectRegistry &rhs)
 This assignment operator is required for (smart) pointer semantics. More...
 
ObjectCreatedSignalTypeObjectCreatedSignal ()
 This signal is emitted when an object is created. More...
 
ObjectDestroyedSignalTypeObjectDestroyedSignal ()
 This signal is emitted when an object is destroyed. More...
 
DALI_INTERNAL ObjectRegistry (Internal::ObjectRegistry *objectRegistry)
 This constructor is used by Dali Get() method. More...
 
- Public Member Functions inherited from Dali::BaseHandle
 BaseHandle (Dali::BaseObject *handle)
 This constructor is used by Dali New() methods. More...
 
 BaseHandle ()
 This constructor provides an uninitialized Dali::BaseHandle. More...
 
 ~BaseHandle ()
 Dali::BaseHandle is intended as a base class. More...
 
 BaseHandle (const BaseHandle &handle)
 This copy constructor is required for (smart) pointer semantics. More...
 
BaseHandleoperator= (const BaseHandle &rhs)
 This assignment operator is required for (smart) pointer semantics. More...
 
template<class T >
bool ConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, const T &functor)
 Connects a void() functor to a specified signal. More...
 
bool DoAction (const std::string &actionName, const Property::Map &attributes)
 Perform action on this object with the given action name and attributes. More...
 
const std::string & GetTypeName () const
 Returns the type name for the Handle. More...
 
bool GetTypeInfo (Dali::TypeInfo &info) const
 Returns the type info for the Handle. More...
 
BaseObjectGetBaseObject ()
 Retrieve the internal Dali resource. More...
 
const BaseObjectGetBaseObject () const
 Retrieve the internal Dali resource. More...
 
void Reset ()
 Resets the handle. More...
 
 operator BooleanType () const
 Converts an handle to a BooleanType. More...
 
bool operator== (const BaseHandle &rhs) const
 Equality operator overload. More...
 
bool operator!= (const BaseHandle &rhs) const
 Inequality operator overload. More...
 
Dali::RefObjectGetObjectPtr () const
 Get the reference counted object pointer. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::BaseHandle
void ThisIsSaferThanReturningVoidStar () const
 Used by the safe bool idiom. More...
 

Detailed Description

The ObjectRegistry notifies it's observers when an object is created.

Handle to the created Object is passed in the call back function. The Handle is passed as Dali::Object handle, which can be DownCast to the appropriate type.

Care should be taken to not store the handle in the Observer, as this will have adverse effect on the life time of the Internal Object. The Handle should only be used to connect to signals

Usage: ObjectRegistry registry = Stage::GetObjectRegistry(); registry.ObjectCreatedSignal().Connect( ObjectCreatedCallbackFunc );

Signals

Signal Name Method
objectCreated ObjectCreatedSignal()
objectDestroyed ObjectDestroyedSignal()

.0

Definition at line 59 of file object-registry.h.

Member Typedef Documentation

Object created signal .0.

Definition at line 69 of file object-registry.h.

Object destroyed signal .0.

Definition at line 75 of file object-registry.h.

Constructor & Destructor Documentation

Dali::ObjectRegistry::ObjectRegistry ( )

Allows the creation of an empty objectRegistry handle.

To retrieve the current objectRegistry, this handle can be set using Stage::GetCurrent().GetObjectRegistry(). .0

Definition at line 27 of file object-registry.cpp.

Dali::ObjectRegistry::~ObjectRegistry ( )

Destructor.

This is non-virtual since derived Handle types must not contain data or virtual methods. .0

Definition at line 31 of file object-registry.cpp.

Dali::ObjectRegistry::ObjectRegistry ( const ObjectRegistry handle)

This copy constructor is required for (smart) pointer semantics.

.0

Parameters
[in]handleA reference to the copied handle

Definition at line 35 of file object-registry.cpp.

Dali::ObjectRegistry::ObjectRegistry ( Internal::ObjectRegistry objectRegistry)
explicit

This constructor is used by Dali Get() method.

.0

Parameters
[in]objectRegistryA pointer to a Dali resource

Definition at line 56 of file object-registry.cpp.

Member Function Documentation

ObjectRegistry::ObjectCreatedSignalType & Dali::ObjectRegistry::ObjectCreatedSignal ( )
ObjectRegistry::ObjectDestroyedSignalType & Dali::ObjectRegistry::ObjectDestroyedSignal ( )

This signal is emitted when an object is destroyed.

WARNING: Since this signal is emitted when the object is in the process of being destroyed, the RefObject pointer passed in the signal should not be modified in anyways. And should NOT be used to create an handle. which will affect the life time of this destroyed object and leads to undefined behaviour.

The only intended use is for Toolkit controls which want to keep track of objects being created and destroyed for internal bookkeeping.

A callback of the following type may be connected:

void YourCallbackName(const Dali::RefObject* objectPointer);

.0

Returns
The signal to connect to.
Precondition
The Object has been initialized.

Definition at line 51 of file object-registry.cpp.

References Dali::GetImplementation().

Referenced by Dali::Toolkit::Internal::KeyInputFocusManager::KeyInputFocusManager(), Dali::Internal::RelayoutController::Request(), UtcDaliObjectRegistrySignalActorCreated(), UtcDaliObjectRegistrySignalAnimationCreated(), UtcDaliObjectRegistrySignalCameraCreated(), UtcDaliObjectRegistrySignalImageActorCreated(), UtcDaliObjectRegistrySignalLayerCreated(), and UtcDaliObjectRegistrySignalShaderEffectCreated().

Here is the call graph for this function:

Here is the caller graph for this function:

ObjectRegistry & Dali::ObjectRegistry::operator= ( const ObjectRegistry rhs)

This assignment operator is required for (smart) pointer semantics.

.0

Parameters
[in]rhsA reference to the copied handle
Returns
A reference to this

Definition at line 40 of file object-registry.cpp.

References Dali::BaseHandle::operator=().

Here is the call graph for this function:


The documentation for this class was generated from the following files:
Dali Docs Home
Read more about Dali