HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_PerfMonTimedEvent Class Reference

#include <UT_PerfMonTimedEvent.h>

+ Inheritance diagram for UT_PerfMonTimedEvent:

Public Member Functions

 UT_PerfMonTimedEvent (int id, const UT_StringHolder &name, const UT_StringHolder &object, bool auto_nest_events, UT_PerfMonCategory category, UT_PerfMonObjectType object_type, const UT_StringHolder &object_icon=UT_StringHolder::theEmptyString, const UT_StringHolder &extra_info=UT_StringHolder::theEmptyString, int frame_num=UT_PERFORMANCE_INVALID_FRAME)
 
 ~UT_PerfMonTimedEvent () override
 
bool isTimedEvent () const override
 Return true if the event is a timed event. More...
 
void startTaskTimer (const UT_TaskScope *task)
 Start timing a threaded task. More...
 
void stopTaskTimer (const UT_TaskScope *task)
 Stop timing a threaded task. Calculate the elapsed time and store it. More...
 
void overrideTime (fpreal time)
 
const SYS_TimeValstartTime () const
 
const SYS_TimeValstopTime () const
 
fpreal time () const
 
fpreal selfTime () const
 
int threadId () const
 Return the thread id in which the event occured. More...
 
void getThreadIds (UT_IntArray &thread_ids) const
 
fpreal totalTimeForThread (int thread_id) const
 Return the total time spent in the given thread. More...
 
void getFormattedString (UT_PerfMonLogTimeFormat time_format, UT_String &str_event) const override
 Format the event into a pretty string that can be outputted in a log. More...
 
- Public Member Functions inherited from UT_PerfMonEvent
 UT_PerfMonEvent (int id, const UT_StringHolder &name, const UT_StringHolder &object, bool auto_nest_events, UT_PerfMonCategory category, UT_PerfMonEventType type, UT_PerfMonObjectType object_type, const UT_StringHolder &object_icon=UT_StringHolder::theEmptyString, const UT_StringHolder &extra_info=UT_StringHolder::theEmptyString, int frame_num=UT_PERFORMANCE_INVALID_FRAME)
 
virtual ~UT_PerfMonEvent ()
 
 UT_PerfMonEvent (const UT_PerfMonEvent &)=delete
 
UT_PerfMonEventoperator= (const UT_PerfMonEvent &)=delete
 
int id () const
 Return the unique id assigned by the performance monitor. More...
 
int frameNum () const
 Return the frame number in which the event occured. More...
 
const char * name () const
 Return the event name. More...
 
const char * object () const
 Return the object that the event applies to. More...
 
void setObject (const UT_StringHolder &object)
 Set the object that the event applies to. More...
 
const char * objectIcon () const
 
const char * extraInfo () const
 
void setExtraInfo (const UT_StringHolder &extra_info)
 
UT_PerfMonEventType type () const
 Return the event type. More...
 
UT_PerfMonObjectType objectType () const
 Return the event object type. More...
 
bool isAutoNestEnabled () const
 Return true if this event has automatic child event nesting enabled. More...
 
UT_PerfMonCategory category () const
 Return the category. More...
 
void start ()
 
void stop ()
 
bool isRunning () const
 
fpreal value () const
 
fpreal selfValue () const
 
void setValue (fpreal val)
 Set the event value. More...
 
void overrideValue (fpreal value)
 
void calculateSelfValue ()
 
void appendChild (UT_PerfMonEvent *event)
 Add a child event. More...
 
void removeChild (UT_PerfMonEvent *event)
 
void removeChildren ()
 Remove all child events. More...
 
int numChildren () const
 Return the number of child events. More...
 
const UT_PerfMonEventgetChild (int index) const
 Return the child at the given index. More...
 
UT_PerfMonEventgetChild (int index)
 
void appendParent (UT_PerfMonEvent *event)
 Add a parent event. More...
 
void removeParent (UT_PerfMonEvent *event)
 
void removeParents ()
 Remove all parent events. More...
 
int numParents () const
 Return the number of parent events. More...
 
const UT_PerfMonEventgetParent (int index) const
 Return the parent at the given index. More...
 
UT_PerfMonEventgetParent (int index)
 
virtual void getUniversalLogEntry (UT_UniversalLogEntry &logentry) const
 Format the event for the universal logging system. More...
 

Protected Member Functions

void subclassStart_ () override
 Perform work when the event is started. More...
 
void subclassStop_ () override
 Perform work when the event is stopped. More...
 
void subclassOverrideValue_ () override
 Perform work when the event's value has been overridden. More...
 
fpreal subclassCalculateSelfValue_ () override
 
void subclassCollectDataFromChild_ (const UT_PerfMonEvent *child) override
 
- Protected Member Functions inherited from UT_PerfMonEvent
bool isValueOverridden_ () const
 Return true if the value has been overridden. More...
 
void getFormattedObjectPathAndExtraInfo_ (bool enclose_obj_path_in_parens, UT_String &object_path, UT_String &extra_info) const
 Pass back a formatted string of this event's object path and extra info. More...
 

Detailed Description

Definition at line 28 of file UT_PerfMonTimedEvent.h.

Constructor & Destructor Documentation

UT_PerfMonTimedEvent::UT_PerfMonTimedEvent ( int  id,
const UT_StringHolder name,
const UT_StringHolder object,
bool  auto_nest_events,
UT_PerfMonCategory  category,
UT_PerfMonObjectType  object_type,
const UT_StringHolder object_icon = UT_StringHolder::theEmptyString,
const UT_StringHolder extra_info = UT_StringHolder::theEmptyString,
int  frame_num = UT_PERFORMANCE_INVALID_FRAME 
)
UT_PerfMonTimedEvent::~UT_PerfMonTimedEvent ( )
override

Member Function Documentation

void UT_PerfMonTimedEvent::getFormattedString ( UT_PerfMonLogTimeFormat  time_format,
UT_String str_event 
) const
overridevirtual

Format the event into a pretty string that can be outputted in a log.

Reimplemented from UT_PerfMonEvent.

void UT_PerfMonTimedEvent::getThreadIds ( UT_IntArray thread_ids) const
bool UT_PerfMonTimedEvent::isTimedEvent ( ) const
inlineoverridevirtual

Return true if the event is a timed event.

Reimplemented from UT_PerfMonEvent.

Definition at line 44 of file UT_PerfMonTimedEvent.h.

void UT_PerfMonTimedEvent::overrideTime ( fpreal  time)
inline

Override the event's elapsed time. Handy when you know the event's elapsed time but not its start time nor stop time.

Definition at line 56 of file UT_PerfMonTimedEvent.h.

fpreal UT_PerfMonTimedEvent::selfTime ( ) const
inline

Return the time it took to complete the event excluding the time it took to complete any child events. Return 0 if the self time has not been calculated yet.

Definition at line 77 of file UT_PerfMonTimedEvent.h.

void UT_PerfMonTimedEvent::startTaskTimer ( const UT_TaskScope task)

Start timing a threaded task.

const SYS_TimeVal* UT_PerfMonTimedEvent::startTime ( ) const

Return the start time. Return NULL if the event has not started or if its time has been overridden.

void UT_PerfMonTimedEvent::stopTaskTimer ( const UT_TaskScope task)

Stop timing a threaded task. Calculate the elapsed time and store it.

const SYS_TimeVal* UT_PerfMonTimedEvent::stopTime ( ) const

Return the stop time. Return NULL if the event has not stopped or if its time has been overridden.

fpreal UT_PerfMonTimedEvent::subclassCalculateSelfValue_ ( )
overrideprotectedvirtual

Calculate the event's self value (time). Return the self value.

Reimplemented from UT_PerfMonEvent.

void UT_PerfMonTimedEvent::subclassCollectDataFromChild_ ( const UT_PerfMonEvent child)
overrideprotectedvirtual

Collect the data from the given child event and merge it into this event's children data.

Reimplemented from UT_PerfMonEvent.

void UT_PerfMonTimedEvent::subclassOverrideValue_ ( )
overrideprotectedvirtual

Perform work when the event's value has been overridden.

Reimplemented from UT_PerfMonEvent.

void UT_PerfMonTimedEvent::subclassStart_ ( )
overrideprotectedvirtual

Perform work when the event is started.

Reimplemented from UT_PerfMonEvent.

void UT_PerfMonTimedEvent::subclassStop_ ( )
overrideprotectedvirtual

Perform work when the event is stopped.

Reimplemented from UT_PerfMonEvent.

int UT_PerfMonTimedEvent::threadId ( ) const

Return the thread id in which the event occured.

fpreal UT_PerfMonTimedEvent::time ( ) const
inline

Return the time it took to complete the event. Return 0 if the event has not started and stopped.

Definition at line 71 of file UT_PerfMonTimedEvent.h.

fpreal UT_PerfMonTimedEvent::totalTimeForThread ( int  thread_id) const

Return the total time spent in the given thread.


The documentation for this class was generated from the following file: