Dali 3D User Interface Engine
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
Dali::Internal::ObjectRegistry Class Reference

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

#include <object-registry-impl.h>

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

Public Member Functions

void RegisterObject (Dali::BaseObject *object)
 Registers the Object into the Object Registry, which notifies about this object creation to its observers using signals. More...
 
void UnregisterObject (Dali::BaseObject *object)
 Unregisters the Object from the Object Registry, Which notifies about this object destruction to its observers. More...
 
Dali::ObjectRegistry::ObjectCreatedSignalTypeObjectCreatedSignal ()
 This signal is emitted when an object is created. More...
 
Dali::ObjectRegistry::ObjectDestroyedSignalTypeObjectDestroyedSignal ()
 This signal is emitted when an object is destroyed. More...
 
- Public Member Functions inherited from Dali::BaseObject
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...
 
bool DoConnectSignal (ConnectionTrackerInterface *connectionTracker, const std::string &signalName, FunctorDelegate *functorDelegate)
 Not intended for application developers. More...
 
- Public Member Functions inherited from Dali::RefObject
void Reference ()
 Increment the object's reference count. More...
 
void Unreference ()
 Decrement the object's reference count. More...
 
int ReferenceCount ()
 Retrieve the object's reference count. More...
 

Static Public Member Functions

static ObjectRegistryPtr New ()
 Create the objectRegistry. More...
 
static bool DoConnectSignal (BaseObject *object, ConnectionTrackerInterface *tracker, const std::string &signalName, FunctorDelegate *functor)
 Connects a callback function with the object registry signals. More...
 

Private Member Functions

 ObjectRegistry ()
 Protected constructor; see also ObjectRegistry::New() More...
 
 ~ObjectRegistry ()
 A reference counted object may only be deleted by calling Unreference() More...
 

Private Attributes

Dali::ObjectRegistry::ObjectCreatedSignalType mObjectCreatedSignal
 
Dali::ObjectRegistry::ObjectDestroyedSignalType mObjectDestroyedSignal
 

Additional Inherited Members

- Protected Member Functions inherited from Dali::BaseObject
 BaseObject ()
 Default constructor. More...
 
virtual ~BaseObject ()
 A reference counted object may only be deleted by calling Unreference(). More...
 
void RegisterObject ()
 Registers the object as created with the Object registry. More...
 
void UnregisterObject ()
 Unregisters the object from Object registry. More...
 

Detailed Description

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

There is a single instance of Object registry for each Dali-core instance. All Dali Objects need to register with ObjectRegistry to be observed by feedback plugin's and other observers.

Definition at line 49 of file object-registry-impl.h.

Constructor & Destructor Documentation

Dali::Internal::ObjectRegistry::ObjectRegistry ( )
private

Protected constructor; see also ObjectRegistry::New()

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

Referenced by New().

Here is the caller graph for this function:

Dali::Internal::ObjectRegistry::~ObjectRegistry ( )
private

A reference counted object may only be deleted by calling Unreference()

Definition at line 60 of file object-registry-impl.cpp.

Member Function Documentation

bool Dali::Internal::ObjectRegistry::DoConnectSignal ( BaseObject object,
ConnectionTrackerInterface tracker,
const std::string &  signalName,
FunctorDelegate functor 
)
static

Connects a callback function with the object registry signals.

Parameters
[in]objectThe object providing the signal.
[in]trackerUsed to disconnect the signal.
[in]signalNameThe signal to connect to.
[in]functorA newly allocated FunctorDelegate.
Returns
True if the signal was connected.
Postcondition
If a signal was connected, ownership of functor was passed to CallbackBase. Otherwise the caller is responsible for deleting the unused functor.

Definition at line 78 of file object-registry-impl.cpp.

References ObjectCreatedSignal(), ObjectDestroyedSignal(), Dali::Internal::anonymous_namespace{object-registry-impl.cpp}::SIGNAL_OBJECT_CREATED, and Dali::Internal::anonymous_namespace{object-registry-impl.cpp}::SIGNAL_OBJECT_DESTROYED.

Here is the call graph for this function:

ObjectRegistryPtr Dali::Internal::ObjectRegistry::New ( )
static

Create the objectRegistry.

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

References ObjectRegistry().

Referenced by Dali::Internal::Stage::Initialize().

Here is the call graph for this function:

Here is the caller graph for this function:

Dali::ObjectRegistry::ObjectCreatedSignalType& Dali::Internal::ObjectRegistry::ObjectCreatedSignal ( )
inline

This signal is emitted when an object is created.

A callback of the following type may be connected:

void YourCallbackName(BaseHandle object);

.0

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

Definition at line 80 of file object-registry-impl.h.

References mObjectCreatedSignal.

Referenced by DoConnectSignal().

Here is the caller graph for this function:

Dali::ObjectRegistry::ObjectDestroyedSignalType& Dali::Internal::ObjectRegistry::ObjectDestroyedSignal ( )
inline

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 88 of file object-registry-impl.h.

References mObjectDestroyedSignal.

Referenced by DoConnectSignal().

Here is the caller graph for this function:

void Dali::Internal::ObjectRegistry::RegisterObject ( Dali::BaseObject object)

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.

Precondition
The object is not already registered.
the object is ref counted (held in an intrusive pointer)
Parameters
[in]objectPointer to the object.

Definition at line 64 of file object-registry-impl.cpp.

References mObjectCreatedSignal.

void Dali::Internal::ObjectRegistry::UnregisterObject ( Dali::BaseObject object)

Unregisters the Object from the Object Registry, Which notifies about this object destruction to its observers.

Precondition
The object is already registered.
Parameters
[in]objectPointer to the object.

Definition at line 73 of file object-registry-impl.cpp.

References mObjectDestroyedSignal.

Member Data Documentation

Dali::ObjectRegistry::ObjectCreatedSignalType Dali::Internal::ObjectRegistry::mObjectCreatedSignal
private

Definition at line 118 of file object-registry-impl.h.

Referenced by ObjectCreatedSignal(), and RegisterObject().

Dali::ObjectRegistry::ObjectDestroyedSignalType Dali::Internal::ObjectRegistry::mObjectDestroyedSignal
private

Definition at line 119 of file object-registry-impl.h.

Referenced by ObjectDestroyedSignal(), and UnregisterObject().


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