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

#include <event.h>

Public Types

enum  EventType : uint8_t {
  EventType::Unknown, EventType::Begin, EventType::End, EventType::Timespan,
  EventType::Marker, EventType::CounterDelta, EventType::CounterValue, EventType::ScopeData
}
 Valid event types. More...
 
enum  DataType : uint8_t {
  DataType::String, DataType::Boolean, DataType::Int, DataType::UInt,
  DataType::Float, DataType::Invalid
}
 The different types of data that can be stored in a TraceEvent instance. More...
 
using TimeStamp = uint64_t
 Time in "ticks". More...
 
using Key = TraceKey
 
Tag enums to select constructors
enum  BeginTag { Begin }
 
enum  EndTag { End }
 
enum  TimespanTag { Timespan }
 
enum  MarkerTag { Marker }
 
enum  CounterDeltaTag { CounterDelta }
 
enum  CounterValueTag { CounterValue }
 
enum  DataTag { Data }
 

Public Member Functions

const KeyGetKey () const
 Return this event's key. More...
 
TRACE_API TimeStamp GetTimeStamp () const
 Return the time stamp associated with this event. More...
 
TRACE_API double GetCounterValue () const
 Return the counter value associated with this event. More...
 
TraceCategoryId GetCategory () const
 Returns the event's category id. More...
 
TRACE_API TimeStamp GetStartTimeStamp () const
 Returns the start time of a timespan event. More...
 
TRACE_API TimeStamp GetEndTimeStamp () const
 Returns the end time of a timespan event. More...
 
TRACE_API TraceEventData GetData () const
 Returns the data stored in a data event. More...
 
TRACE_API EventType GetType () const
 Returns the type of the event. More...
 
 TraceEvent (const TraceEvent &)=delete
 
TraceEventoperator= (const TraceEvent &)=delete
 
 TraceEvent (TraceEvent &&)=default
 
TraceEventoperator= (TraceEvent &&)=default
 
void SetTimeStamp (TimeStamp time)
 Sets the events timestamp to time. More...
 
Constructors
 TraceEvent (BeginTag, const Key &key, TraceCategoryId cat)
 
 TraceEvent (BeginTag, const Key &key, TimeStamp ts, TraceCategoryId cat)
 Constructor for Begin events that takes a specific TimeStamp ts. More...
 
 TraceEvent (EndTag, const Key &key, TraceCategoryId cat)
 
 TraceEvent (EndTag, const Key &key, TimeStamp ts, TraceCategoryId cat)
 Constructor for End events that takes a specific TimeStamp ts. More...
 
 TraceEvent (TimespanTag, const Key &key, TimeStamp startTime, TimeStamp endTime, TraceCategoryId cat)
 Constructor for Timespan events that takes the start time and end time. More...
 
 TraceEvent (MarkerTag, const Key &key, TraceCategoryId cat)
 
 TraceEvent (MarkerTag, const Key &key, TimeStamp ts, TraceCategoryId cat)
 Constructor for Mark events that takes a specific TimeStamp ts. More...
 
 TraceEvent (CounterDeltaTag, const Key &key, double value, TraceCategoryId cat)
 Constructor for Counter delta events. More...
 
 TraceEvent (CounterValueTag, const Key &key, double value, TraceCategoryId cat)
 Constructor for Counter value events. More...
 
Constructors for data events
 TraceEvent (DataTag, const Key &key, bool data, TraceCategoryId cat)
 
 TraceEvent (DataTag, const Key &key, int data, TraceCategoryId cat)
 
 TraceEvent (DataTag, const Key &key, int64_t data, TraceCategoryId cat)
 
 TraceEvent (DataTag, const Key &key, uint64_t data, TraceCategoryId cat)
 
 TraceEvent (DataTag, const Key &key, double data, TraceCategoryId cat)
 
 TraceEvent (DataTag, const Key &key, const char *data, TraceCategoryId cat)
 

Detailed Description

This represents an event recorded by a TraceCollector. It contains a key (name), categoryId, timestamp, type, and optional metadata.

Definition at line 47 of file event.h.

Member Typedef Documentation

Definition at line 51 of file event.h.

using TraceEvent::TimeStamp = uint64_t

Time in "ticks".

Definition at line 50 of file event.h.

Member Enumeration Documentation

Enumerator
Begin 

Definition at line 55 of file event.h.

Enumerator
CounterDelta 

Definition at line 59 of file event.h.

Enumerator
CounterValue 

Definition at line 60 of file event.h.

Enumerator
Data 

Definition at line 61 of file event.h.

enum TraceEvent::DataType : uint8_t
strong

The different types of data that can be stored in a TraceEvent instance.

Enumerator
String 

The event is storing a string.

Boolean 

The event is storing a bool.

Int 

The event is storing an integer.

UInt 

The event is storing an unsigned integer.

Float 

The event is storing an double.

Invalid 

The event is not storing any data.

Definition at line 78 of file event.h.

Enumerator
End 

Definition at line 56 of file event.h.

enum TraceEvent::EventType : uint8_t
strong

Valid event types.

Enumerator
Unknown 

The event is an unknown type.

Begin 

The event represents the beginning timestamp of a scope.

End 

The event represents the ending timestamp of a scope.

Timespan 

The event represents begin and end timestamp of a scope.

Marker 

The event represents an marker without a duration.

CounterDelta 

The event represents a change in a counter.

CounterValue 

The event represents the value of a counter.

ScopeData 

The event stores data that is associated with its enclosing scope.

Definition at line 65 of file event.h.

Enumerator
Marker 

Definition at line 58 of file event.h.

Enumerator
Timespan 

Definition at line 57 of file event.h.

Constructor & Destructor Documentation

TraceEvent::TraceEvent ( BeginTag  ,
const Key key,
TraceCategoryId  cat 
)
inline

Constructor for Begin events that will automatically set the timestamp from the current time.

Definition at line 116 of file event.h.

TraceEvent::TraceEvent ( BeginTag  ,
const Key key,
TimeStamp  ts,
TraceCategoryId  cat 
)
inline

Constructor for Begin events that takes a specific TimeStamp ts.

Definition at line 124 of file event.h.

TraceEvent::TraceEvent ( EndTag  ,
const Key key,
TraceCategoryId  cat 
)
inline

Constructor for End events that will automatically set the timestamp from the current time.

Definition at line 136 of file event.h.

TraceEvent::TraceEvent ( EndTag  ,
const Key key,
TimeStamp  ts,
TraceCategoryId  cat 
)
inline

Constructor for End events that takes a specific TimeStamp ts.

Definition at line 144 of file event.h.

TraceEvent::TraceEvent ( TimespanTag  ,
const Key key,
TimeStamp  startTime,
TimeStamp  endTime,
TraceCategoryId  cat 
)
inline

Constructor for Timespan events that takes the start time and end time.

Definition at line 155 of file event.h.

TraceEvent::TraceEvent ( MarkerTag  ,
const Key key,
TraceCategoryId  cat 
)
inline

Constructor for Marker events that will automatically set the timestamp from the current time.

Definition at line 168 of file event.h.

TraceEvent::TraceEvent ( MarkerTag  ,
const Key key,
TimeStamp  ts,
TraceCategoryId  cat 
)
inline

Constructor for Mark events that takes a specific TimeStamp ts.

Definition at line 176 of file event.h.

TraceEvent::TraceEvent ( CounterDeltaTag  ,
const Key key,
double  value,
TraceCategoryId  cat 
)
inline

Constructor for Counter delta events.

Definition at line 187 of file event.h.

TraceEvent::TraceEvent ( CounterValueTag  ,
const Key key,
double  value,
TraceCategoryId  cat 
)
inline

Constructor for Counter value events.

Definition at line 199 of file event.h.

TraceEvent::TraceEvent ( DataTag  ,
const Key key,
bool  data,
TraceCategoryId  cat 
)
inline

Definition at line 212 of file event.h.

TraceEvent::TraceEvent ( DataTag  ,
const Key key,
int  data,
TraceCategoryId  cat 
)
inline

Definition at line 221 of file event.h.

TraceEvent::TraceEvent ( DataTag  ,
const Key key,
int64_t  data,
TraceCategoryId  cat 
)
inline

Definition at line 230 of file event.h.

TraceEvent::TraceEvent ( DataTag  ,
const Key key,
uint64_t  data,
TraceCategoryId  cat 
)
inline

Definition at line 239 of file event.h.

TraceEvent::TraceEvent ( DataTag  ,
const Key key,
double  data,
TraceCategoryId  cat 
)
inline

Definition at line 248 of file event.h.

TraceEvent::TraceEvent ( DataTag  ,
const Key key,
const char *  data,
TraceCategoryId  cat 
)
inline

Definition at line 257 of file event.h.

TraceEvent::TraceEvent ( const TraceEvent )
delete
TraceEvent::TraceEvent ( TraceEvent &&  )
default

Member Function Documentation

TraceCategoryId TraceEvent::GetCategory ( ) const
inline

Returns the event's category id.

Definition at line 97 of file event.h.

TRACE_API double TraceEvent::GetCounterValue ( ) const

Return the counter value associated with this event.

TRACE_API TraceEventData TraceEvent::GetData ( ) const

Returns the data stored in a data event.

TRACE_API TimeStamp TraceEvent::GetEndTimeStamp ( ) const

Returns the end time of a timespan event.

const Key& TraceEvent::GetKey ( ) const
inline

Return this event's key.

Definition at line 88 of file event.h.

TRACE_API TimeStamp TraceEvent::GetStartTimeStamp ( ) const

Returns the start time of a timespan event.

TRACE_API TimeStamp TraceEvent::GetTimeStamp ( ) const

Return the time stamp associated with this event.

TRACE_API EventType TraceEvent::GetType ( ) const

Returns the type of the event.

TraceEvent& TraceEvent::operator= ( const TraceEvent )
delete
TraceEvent& TraceEvent::operator= ( TraceEvent &&  )
default
void TraceEvent::SetTimeStamp ( TimeStamp  time)
inline

Sets the events timestamp to time.

Definition at line 277 of file event.h.


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