Loading...
Searching...
No Matches
TraceEvent Class Reference

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

#include <event.h>

Public Types

enum class  EventType : uint8_t {
  Unknown , Begin , End , Timespan ,
  Marker , CounterDelta , CounterValue , ScopeData
}
 Valid event types. More...
 
enum class  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".
 
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.
 
TRACE_API TimeStamp GetTimeStamp () const
 Return the time stamp associated with this event.
 
TRACE_API double GetCounterValue () const
 Return the counter value associated with this event.
 
TraceCategoryId GetCategory () const
 Returns the event's category id.
 
TRACE_API TimeStamp GetStartTimeStamp () const
 Returns the start time of a timespan event.
 
TRACE_API TimeStamp GetEndTimeStamp () const
 Returns the end time of a timespan event.
 
TRACE_API std::pair< TimeStamp, TimeStampGetTimeSpanStamps () const
 Return both the start and end time of a timespan event by GetStartTimeStamp() and GetEndTimeStamp().
 
TRACE_API TraceEventData GetData () const
 Returns the data stored in a data event.
 
TRACE_API EventType GetType () const
 Returns the type of the event.
 
 TraceEvent (const TraceEvent &)=delete
 
TraceEventoperator= (const TraceEvent &)=delete
 
 TraceEvent (TraceEvent &&)=default
 
TraceEventoperator= (TraceEvent &&)=default
 
void SetTimeStamp (TimeStamp time)
 Sets the events timestamp to time.
 
Constructors
 TraceEvent (BeginTag, const Key &key, TraceCategoryId cat)
 Constructor for Begin events that will automatically set the timestamp from the current time.
 
 TraceEvent (BeginTag, const Key &key, TimeStamp ts, TraceCategoryId cat)
 Constructor for Begin events that takes a specific TimeStamp ts.
 
 TraceEvent (EndTag, const Key &key, TraceCategoryId cat)
 Constructor for End events that will automatically set the timestamp from the current time.
 
 TraceEvent (EndTag, const Key &key, TimeStamp ts, TraceCategoryId cat)
 Constructor for End events that takes a specific TimeStamp ts.
 
 TraceEvent (TimespanTag, const Key &key, TimeStamp startTime, TimeStamp endTime, TraceCategoryId cat)
 Constructor for Timespan events that takes the start time and end time.
 
 TraceEvent (MarkerTag, const Key &key, TraceCategoryId cat)
 Constructor for Marker events that will automatically set the timestamp from the current time.
 
 TraceEvent (MarkerTag, const Key &key, TimeStamp ts, TraceCategoryId cat)
 Constructor for Mark events that takes a specific TimeStamp ts.
 
 TraceEvent (CounterDeltaTag, const Key &key, double value, TraceCategoryId cat)
 Constructor for Counter delta events.
 
 TraceEvent (CounterValueTag, const Key &key, double value, TraceCategoryId cat)
 Constructor for Counter value events.
 
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 32 of file event.h.

Member Typedef Documentation

◆ Key

using Key = TraceKey

Definition at line 36 of file event.h.

◆ TimeStamp

using TimeStamp = uint64_t

Time in "ticks".

Definition at line 35 of file event.h.

Member Enumeration Documentation

◆ BeginTag

enum BeginTag

Definition at line 40 of file event.h.

◆ CounterDeltaTag

enum CounterDeltaTag

Definition at line 44 of file event.h.

◆ CounterValueTag

enum CounterValueTag

Definition at line 45 of file event.h.

◆ DataTag

enum DataTag

Definition at line 46 of file event.h.

◆ DataType

enum class 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 63 of file event.h.

◆ EndTag

enum EndTag

Definition at line 41 of file event.h.

◆ EventType

enum class 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 50 of file event.h.

◆ MarkerTag

enum MarkerTag

Definition at line 43 of file event.h.

◆ TimespanTag

enum TimespanTag

Definition at line 42 of file event.h.

Constructor & Destructor Documentation

◆ TraceEvent() [1/15]

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

◆ TraceEvent() [2/15]

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

Constructor for Begin events that takes a specific TimeStamp ts.

Definition at line 113 of file event.h.

◆ TraceEvent() [3/15]

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

◆ TraceEvent() [4/15]

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

Constructor for End events that takes a specific TimeStamp ts.

Definition at line 133 of file event.h.

◆ TraceEvent() [5/15]

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

◆ TraceEvent() [6/15]

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

◆ TraceEvent() [7/15]

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

Constructor for Mark events that takes a specific TimeStamp ts.

Definition at line 165 of file event.h.

◆ TraceEvent() [8/15]

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

Constructor for Counter delta events.

Definition at line 176 of file event.h.

◆ TraceEvent() [9/15]

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

Constructor for Counter value events.

Definition at line 188 of file event.h.

◆ TraceEvent() [10/15]

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

Definition at line 201 of file event.h.

◆ TraceEvent() [11/15]

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

Definition at line 210 of file event.h.

◆ TraceEvent() [12/15]

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

Definition at line 219 of file event.h.

◆ TraceEvent() [13/15]

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

Definition at line 228 of file event.h.

◆ TraceEvent() [14/15]

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

Definition at line 237 of file event.h.

◆ TraceEvent() [15/15]

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

Definition at line 246 of file event.h.

Member Function Documentation

◆ GetCategory()

TraceCategoryId GetCategory ( ) const
inline

Returns the event's category id.

Definition at line 82 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 73 of file event.h.

◆ GetStartTimeStamp()

TRACE_API TimeStamp GetStartTimeStamp ( ) const

Returns the start time of a timespan event.

◆ GetTimeSpanStamps()

TRACE_API std::pair< TimeStamp, TimeStamp > GetTimeSpanStamps ( ) const

Return both the start and end time of a timespan event by GetStartTimeStamp() and GetEndTimeStamp().

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


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