HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
reporterDataSourceCollection.h
Go to the documentation of this file.
1 //
2 // Copyright 2018 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_BASE_TRACE_REPORTER_DATA_SOURCE_COLLECTION_H
9 #define PXR_BASE_TRACE_REPORTER_DATA_SOURCE_COLLECTION_H
10 
11 #include "pxr/pxr.h"
12 
13 #include "pxr/base/trace/api.h"
16 
17 #include <vector>
18 
20 
21 ////////////////////////////////////////////////////////////////////////////////
22 /// \class TraceReporterDataSourceCollection
23 ///
24 /// This class is an implementation of TraceReporterDataSourceBase which provides
25 /// access to a set number of TraceCollection instances. This class is useful if
26 /// you want to generate reports from serialized TraceCollections.
27 ///
29 public:
31  using ThisRefPtr = std::unique_ptr<This>;
32 
33  static ThisRefPtr New(CollectionPtr collection) {
34  return ThisRefPtr(new This(collection));
35  }
36  static ThisRefPtr New(std::vector<CollectionPtr> collections) {
37  return ThisRefPtr(new This(std::move(collections)));
38  }
39 
40  /// Removes all references to TraceCollections.
41  TRACE_API void Clear() override;
42 
43  /// Returns the next TraceCollections which need to be processed.
44  TRACE_API std::vector<CollectionPtr> ConsumeData() override;
45 
46 private:
49  std::vector<CollectionPtr> collections);
50 
51  std::vector<CollectionPtr> _data;
52 };
53 
55 
56 #endif // PXR_BASE_TRACE_REPORTER_DATA_SOURCE_COLLECTION_H
shared_ptr< Collection > CollectionPtr
A shared pointer to a Collection.
Definition: Geom.h:53
TraceReporterDataSourceCollection This
static ThisRefPtr New(CollectionPtr collection)
TRACE_API std::vector< CollectionPtr > ConsumeData() override
Returns the next TraceCollections which need to be processed.
TRACE_API void Clear() override
Removes all references to TraceCollections.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
static ThisRefPtr New(std::vector< CollectionPtr > collections)
std::shared_ptr< TraceCollection > CollectionPtr
#define TRACE_API
Definition: api.h:23