8#ifndef PXR_BASE_TRACE_EVENT_NODE_H
9#define PXR_BASE_TRACE_EVENT_NODE_H
13#include "pxr/base/trace/api.h"
14#include "pxr/base/trace/event.h"
15#include "pxr/base/trace/eventData.h"
24PXR_NAMESPACE_OPEN_SCOPE
41 using AttributeMap = std::multimap<TfToken, AttributeData>;
45 static TraceEventNodeRefPtr
New() {
47 TfToken(
"root"), TraceCategory::Default, 0.0, 0.0, {},
false);
54 const TimeStamp beginTime,
55 const TimeStamp endTime,
56 TraceEventNodeRefPtrVector&& children,
57 const bool separateEvents) {
58 return TfCreateRefPtr(
77 void Append(TraceEventNodeRefPtr node);
119 return _fromSeparateEvents;
129 TraceEventNodeRefPtrVector&& children,
133 , _category(category)
134 , _beginTime(beginTime)
136 , _children(
std::move(children))
137 , _fromSeparateEvents(separateEvents)
143 TimeStamp _beginTime;
145 TraceEventNodeRefPtrVector _children;
146 bool _fromSeparateEvents;
148 AttributeMap _attributes;
151PXR_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...