25 #ifndef PXR_BASE_TRACE_COLLECTION_H
26 #define PXR_BASE_TRACE_COLLECTION_H
35 #include "pxr/base/tf/mallocTag.h"
38 #include <unordered_map>
123 using KeyTokenCache =
124 std::unordered_map<TraceKey, TfToken, TraceKey::HashFunctor>;
128 void _Iterate(
Visitor& visitor,
bool doReverse)
const;
133 void _IterateEvents(
Visitor&, KeyTokenCache&,
136 using EventTable = std::map<TraceThreadId, EventListPtr>;
138 EventTable _eventsPerThread;
143 #endif // PXR_BASE_TRACE_COLLECTION_H
virtual void OnEndCollection()=0
Called at the end of an iteration.
TRACE_API void ReverseIterate(Visitor &visitor) const
TraceCollection()=default
Constructor.
virtual void OnEvent(const TraceThreadId &threadId, const TfToken &key, const TraceEvent &event)=0
TF_MALLOC_TAG_NEW("Trace","TraceCollection")
virtual TRACE_API ~Visitor()
Destructor.
virtual void OnBeginCollection()=0
Called at the beginning of an iteration.
TRACE_API void Iterate(Visitor &visitor) const
virtual bool AcceptsCategory(TraceCategoryId categoryId)=0
TRACE_API void AddToCollection(const TraceThreadId &id, EventListPtr &&events)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
TraceCollection & operator=(TraceCollection &&)=default
Move assignment operator.
virtual void OnEndThread(const TraceThreadId &threadId)=0
std::unique_ptr< EventList > EventListPtr
uint32_t TraceCategoryId
Categories that a TraceReporter can use to filter events.
virtual void OnBeginThread(const TraceThreadId &threadId)=0