25 #ifndef PXR_BASE_TRACE_EVENT_LIST_H 26 #define PXR_BASE_TRACE_EVENT_LIST_H 30 #include "pxr/base/trace/dataBuffer.h" 31 #include "pxr/base/trace/dynamicKey.h" 32 #include "pxr/base/trace/event.h" 33 #include "pxr/base/trace/eventContainer.h" 36 #include <unordered_set> 38 PXR_NAMESPACE_OPEN_SCOPE
67 using const_reverse_iterator = TraceEventContainer::const_reverse_iterator;
68 const_reverse_iterator rbegin()
const {
return _events.rbegin();}
69 const_reverse_iterator rend()
const {
return _events.rend();}
73 bool IsEmpty()
const {
return _events.empty();}
77 template <
class... Args>
79 return _events.emplace_back(std::forward<Args>(args)...);
87 KeyCache::const_iterator it = _caches.front().insert(key).first;
97 template <
typename T>
98 decltype(std::declval<TraceDataBuffer>().
StoreData(std::declval<T>()))
113 std::unordered_set<TraceDynamicKey, TraceDynamicKey::HashFunctor>;
114 std::list<KeyCache> _caches;
119 PXR_NAMESPACE_CLOSE_SCOPE
121 #endif //PXR_BASE_TRACE_EVENT_LIST_H bool IsEmpty() const
Returns whether there are any events in the list.
Bidirectional iterator of TraceEvents.
This class stores copies of data that are associated with TraceEvent instances.
This class stores data used to create dynamic keys which can be referenced in TraceEvent instances.
TRACE_API void Append(TraceEventList &&other)
Appends the given list to the end of this list.
decltype(std::declval< TraceDataBuffer >().StoreData(std::declval< T >())) StoreData(const T &value)
Copy data to the buffer and return a pointer to the cached data that is valid for the lifetime of the...
TRACE_API TraceEventList()
Constructor.
This represents an event recorded by a TraceCollector.
TraceKey CacheKey(const TraceDynamicKey &key)
For speed the TraceEvent class holds a pointer to a TraceStaticKeyData.
TraceEventList & operator=(TraceEventList &&)=default
Move Assignment.
This class represents an ordered collection of TraceEvents and the TraceDynamicKeys and data that the...
const T * StoreData(const T &value)
Makes a copy of value and returns a pointer to it.
Holds TraceEvent instances.
const TraceEvent & EmplaceBack(Args &&... args)
Construct a TraceEvent at the end on the list.
A wrapper around a TraceStaticKeyData pointer that is stored in TraceEvent instances.