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" 41 PXR_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;
168 PXR_NAMESPACE_CLOSE_SCOPE
170 #endif // PXR_BASE_TRACE_EVENT_NODE_H Standard pointer typedefs.
const TraceEventNodeRefPtrVector & GetChildrenRef()
Returns references to the children of this node.
TraceEventNode is used to represents call tree of a trace.
uint64_t TimeStamp
Time in "ticks".
bool IsFromSeparateEvents() const
Returns whether this node was created from a Begin-End pair or a single Timespan event.
Enable a concrete base class for use with TfRefPtr.
Token for efficient comparison, assignment, and hashing of known strings.
TimeStamp GetBeginTime()
Returns the time that this scope started.
const AttributeMap & GetAttributes() const
Return the data associated with this node.
static TraceEventNodeRefPtr New()
Creates a new root 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.
void AddAttribute(const TfToken &key, const AttributeData &attr)
Add data to this node.
This class holds data that can be stored in TraceEvents.
TimeStamp GetEndTime()
Returns the time that this scope ended.
TfToken GetKey()
Returns the name of this node.
void SetBeginAndEndTimesFromChildren()
Sets this node's begin and end time to the time extents of its direct children.
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.
#define TF_DECLARE_REF_PTRS(type)
Define standard ref pointer types.
uint32_t TraceCategoryId
Categories that a TraceReporter can use to filter events.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
TraceCategoryId GetCategory() const
Returns the category of this node.