TraceEvent Class Reference

This represents an event recorded by a TraceCollector. More...

Public Types

enum  EventType : uint8_t {
  Unknown, Begin, End, Timespan,
  Marker, CounterDelta, CounterValue, ScopeData
}
 Valid event types. More...
 
enum  DataType : uint8_t {
  String, Boolean, Int, UInt,
  Float, 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)
 Constructor for Begin events that will automatically set the timestamp from the current time. More...
 
 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)
 Constructor for End events that will automatically set the timestamp from the current time. More...
 
 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, TraceCategoryId cat)
 Constructor for Timespan events that takes a TimeStamp starttime and automatically sets the end timestamp from the current time. 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)
 Constructor for Marker events that will automatically set the timestamp from the current time. More...
 
 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

◆ TimeStamp

using TimeStamp = uint64_t

Time in "ticks".

Definition at line 50 of file event.h.

Member Enumeration Documentation

◆ DataType

enum 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.

◆ EventType

enum 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.

Constructor & Destructor Documentation

◆ TraceEvent() [1/10]

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() [2/10]

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() [3/10]

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() [4/10]

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() [5/10]

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

Constructor for Timespan events that takes a TimeStamp starttime and automatically sets the end timestamp from the current time.

Definition at line 156 of file event.h.

◆ TraceEvent() [6/10]

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 166 of file event.h.

◆ TraceEvent() [7/10]

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 179 of file event.h.

◆ TraceEvent() [8/10]

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

Constructor for Mark events that takes a specific TimeStamp ts.

Definition at line 187 of file event.h.

◆ TraceEvent() [9/10]

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

Constructor for Counter delta events.

Definition at line 198 of file event.h.

◆ TraceEvent() [10/10]

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

Constructor for Counter value events.

Definition at line 210 of file event.h.

Member Function Documentation

◆ GetCategory()

TraceCategoryId GetCategory ( ) const
inline

Returns the event's category id.

Definition at line 97 of file event.h.

◆ GetCounterValue()

TRACE_API double GetCounterValue ( ) const

Return the counter value associated with this event.

◆ GetData()

TRACE_API TraceEventData GetData ( ) const

Returns the data stored in a data event.

◆ GetEndTimeStamp()

TRACE_API TimeStamp GetEndTimeStamp ( ) const

Returns the end time of a timespan event.

◆ GetKey()

const Key& GetKey ( ) const
inline

Return this event's key.

Definition at line 88 of file event.h.

◆ GetStartTimeStamp()

TRACE_API TimeStamp GetStartTimeStamp ( ) const

Returns the start time of a timespan event.

◆ GetTimeStamp()

TRACE_API TimeStamp GetTimeStamp ( ) const

Return the time stamp associated with this event.

◆ GetType()

TRACE_API EventType GetType ( ) const

Returns the type of the event.

◆ SetTimeStamp()

void SetTimeStamp ( TimeStamp  time)
inline

Sets the events timestamp to time.

Definition at line 288 of file event.h.


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