25#ifndef PXR_BASE_TRACE_EVENT_NODE_H
26#define PXR_BASE_TRACE_EVENT_NODE_H
30#include "pxr/base/trace/api.h"
31#include "pxr/base/trace/event.h"
32#include "pxr/base/trace/eventData.h"
41PXR_NAMESPACE_OPEN_SCOPE
58 using AttributeMap = std::multimap<TfToken, AttributeData>;
62 static TraceEventNodeRefPtr
New() {
64 TfToken(
"root"), TraceCategory::Default, 0.0, 0.0, {},
false);
71 const TimeStamp beginTime,
72 const TimeStamp endTime,
73 TraceEventNodeRefPtrVector&& children,
74 const bool separateEvents) {
75 return TfCreateRefPtr(
94 void Append(TraceEventNodeRefPtr node);
136 return _fromSeparateEvents;
146 TraceEventNodeRefPtrVector&& children,
150 , _category(category)
151 , _beginTime(beginTime)
153 , _children(
std::move(children))
154 , _fromSeparateEvents(separateEvents)
160 TimeStamp _beginTime;
162 TraceEventNodeRefPtrVector _children;
163 bool _fromSeparateEvents;
165 AttributeMap _attributes;
168PXR_NAMESPACE_CLOSE_SCOPE
uint32_t TraceCategoryId
Categories that a TraceReporter can use to filter events.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
This class holds data that can be stored in TraceEvents.
uint64_t TimeStamp
Time in "ticks".
TraceEventNode is used to represents call tree of a trace.
bool IsFromSeparateEvents() const
Returns whether this node was created from a Begin-End pair or a single Timespan event.
void Append(TraceEventNodeRefPtr node)
Appends node as a child node.
TimeStamp GetBeginTime()
Returns the time that this scope started.
TfToken GetKey()
Returns the name of this node.
TimeStamp GetEndTime()
Returns the time that this scope ended.
void SetBeginAndEndTimesFromChildren()
Sets this node's begin and end time to the time extents of its direct children.
static TraceEventNodeRefPtr New()
Creates a new root node.
const AttributeMap & GetAttributes() const
Return the data associated with this node.
void AddAttribute(const TfToken &key, const AttributeData &attr)
Add data to this node.
TraceCategoryId GetCategory() const
Returns the category of this node.
const TraceEventNodeRefPtrVector & GetChildrenRef()
Returns references to the children of this node.
TraceEventNodeRefPtr Append(const TfToken &key, TraceCategoryId category, TimeStamp beginTime, TimeStamp endTime, bool separateEvents)
Appends a new child node with key, category, beginTime and endTime.
static TraceEventNodeRefPtr New(const TfToken &key, const TraceCategoryId category, const TimeStamp beginTime, const TimeStamp endTime, TraceEventNodeRefPtrVector &&children, const bool separateEvents)
Creates a new node with key, category, beginTime and endTime.
Standard pointer typedefs.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...