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

Class to profile the number of instances of Objects in the system. More...

#include <object-profiler.h>

Inheritance diagram for Dali::Internal::Adaptor::ObjectProfiler:
Inheritance graph
[legend]
Collaboration diagram for Dali::Internal::Adaptor::ObjectProfiler:
Collaboration graph
[legend]

Public Member Functions

 ObjectProfiler (unsigned int timeInterval)
 Constructor. More...
 
 ~ObjectProfiler ()
 Destructor. More...
 
void DisplayInstanceCounts ()
 Display a list of types with the current number of instances in the system. More...
 
- Public Member Functions inherited from Dali::ConnectionTracker
 ConnectionTracker ()
 Constructor. More...
 
virtual ~ConnectionTracker ()
 Virtual destructor. More...
 
void DisconnectAll ()
 Disconnect all signals from this object. More...
 
virtual void SignalConnected (SlotObserver *slotObserver, CallbackBase *callback)
 Called when a signal is connected. More...
 
virtual void SignalDisconnected (SlotObserver *slotObserver, CallbackBase *callback)
 This method is called when the signal is disconnecting. More...
 
std::size_t GetConnectionCount () const
 returns the connection count .0 More...
 
- Public Member Functions inherited from Dali::ConnectionTrackerInterface
 ConnectionTrackerInterface ()
 Constructor. More...
 
virtual ~ConnectionTrackerInterface ()
 Virtual destructor. More...
 
- Public Member Functions inherited from Dali::SignalObserver
 SignalObserver ()
 Constructor. More...
 
virtual ~SignalObserver ()
 Virtual destructor. More...
 

Private Types

typedef std::map< std::string,
int > 
InstanceCountMap
 
typedef std::pair< const
std::string, int > 
InstanceCountPair
 
typedef InstanceCountMap::iterator InstanceCountMapIterator
 
typedef std::pair< BaseObject
*, std::string > 
InstanceTypePair
 
typedef std::vector
< InstanceTypePair
InstanceTypes
 

Private Member Functions

bool OnTimeout ()
 If timer is running, display the instance counts. More...
 
void OnObjectCreated (BaseHandle handle)
 Callback used when objects are created. More...
 
void OnObjectDestroyed (const Dali::RefObject *object)
 Callback used when objects are created. More...
 
int GetMemorySize (const std::string &name, int count)
 Get the memory size of the given object. More...
 

Private Attributes

Dali::ObjectRegistry mObjectRegistry
 
Dali::Timer mTimer
 
InstanceCountMap mInstanceCountMap
 
InstanceTypes mInstanceTypes
 

Detailed Description

Class to profile the number of instances of Objects in the system.

Definition at line 40 of file object-profiler.h.

Member Typedef Documentation

typedef std::map<std::string, int> Dali::Internal::Adaptor::ObjectProfiler::InstanceCountMap
private

Definition at line 84 of file object-profiler.h.

typedef InstanceCountMap::iterator Dali::Internal::Adaptor::ObjectProfiler::InstanceCountMapIterator
private

Definition at line 86 of file object-profiler.h.

typedef std::pair<const std::string, int> Dali::Internal::Adaptor::ObjectProfiler::InstanceCountPair
private

Definition at line 85 of file object-profiler.h.

Definition at line 87 of file object-profiler.h.

Definition at line 88 of file object-profiler.h.

Constructor & Destructor Documentation

Dali::Internal::Adaptor::ObjectProfiler::ObjectProfiler ( unsigned int  timeInterval)

Constructor.

Parameters
timeIntervalto specify the frequency of reporting

Definition at line 41 of file object-profiler.cpp.

References Dali::Stage::GetCurrent(), Dali::Stage::GetObjectRegistry(), and Dali::Timer::New().

Here is the call graph for this function:

Dali::Internal::Adaptor::ObjectProfiler::~ObjectProfiler ( )

Destructor.

Definition at line 55 of file object-profiler.cpp.

Member Function Documentation

void Dali::Internal::Adaptor::ObjectProfiler::DisplayInstanceCounts ( )

Display a list of types with the current number of instances in the system.

Definition at line 59 of file object-profiler.cpp.

References Dali::Integration::Log::DebugInfo, Dali::ImageActor::DownCast(), Dali::ImageActor::GetStyle(), Dali::Integration::Log::LogMessage(), and Dali::ImageActor::STYLE_QUAD.

Here is the call graph for this function:

int Dali::Internal::Adaptor::ObjectProfiler::GetMemorySize ( const std::string &  name,
int  count 
)
private
void Dali::Internal::Adaptor::ObjectProfiler::OnObjectCreated ( BaseHandle  handle)
private

Callback used when objects are created.

Increases instance count for that object type

Parameters
[in]handleof the created object

Definition at line 109 of file object-profiler.cpp.

References DALI_LOG_ERROR, Dali::BaseHandle::GetBaseObject(), and Dali::BaseHandle::GetTypeName().

Here is the call graph for this function:

void Dali::Internal::Adaptor::ObjectProfiler::OnObjectDestroyed ( const Dali::RefObject object)
private

Callback used when objects are created.

Decreases instance count for that object type

Parameters
[in]objectThe object being destroyed

Definition at line 132 of file object-profiler.cpp.

bool Dali::Internal::Adaptor::ObjectProfiler::OnTimeout ( )
private

If timer is running, display the instance counts.

Definition at line 103 of file object-profiler.cpp.

Member Data Documentation

InstanceCountMap Dali::Internal::Adaptor::ObjectProfiler::mInstanceCountMap
private

Definition at line 92 of file object-profiler.h.

InstanceTypes Dali::Internal::Adaptor::ObjectProfiler::mInstanceTypes
private

Definition at line 93 of file object-profiler.h.

Dali::ObjectRegistry Dali::Internal::Adaptor::ObjectProfiler::mObjectRegistry
private

Definition at line 90 of file object-profiler.h.

Dali::Timer Dali::Internal::Adaptor::ObjectProfiler::mTimer
private

Definition at line 91 of file object-profiler.h.


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