HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
lazyContainerDataSource.h
Go to the documentation of this file.
1 //
2 // Copyright 2022 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_IMAGING_HD_LAZY_CONTAINER_DATA_SOURCE_H
8 #define PXR_IMAGING_HD_LAZY_CONTAINER_DATA_SOURCE_H
9 
11 
13 
14 /// \class HdLazyContainerDataSource
15 ///
16 /// A container data source lazily evaluating the given thunk to
17 /// forward all calls to the container data source computed by the thunk.
18 ///
20 {
21 public:
23 
24  using Thunk = std::function<HdContainerDataSourceHandle()>;
25 
26  HD_API
27  TfTokenVector GetNames() override;
28  HD_API
29  HdDataSourceBaseHandle Get(const TfToken &name) override;
30 
31  HD_API
33 
34 protected:
35  HD_API
36  HdLazyContainerDataSource(const Thunk &thunk);
37 
38 private:
39  HdContainerDataSourceHandle _GetSrc();
40 
41  Thunk _thunk;
42  HdContainerDataSourceAtomicHandle _src;
43 };
44 
46 
47 #endif
#define HD_API
Definition: api.h:23
HD_API HdLazyContainerDataSource(const Thunk &thunk)
std::function< HdContainerDataSourceHandle()> Thunk
HD_DECLARE_DATASOURCE(HdLazyContainerDataSource)
Definition: token.h:70
HD_API TfTokenVector GetNames() override
HD_API HdDataSourceBaseHandle Get(const TfToken &name) override
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
GLuint const GLchar * name
Definition: glcorearb.h:786
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74