Loading...
Searching...
No Matches
lazyContainerDataSource.h
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
10#include "pxr/imaging/hd/dataSource.h"
11
12PXR_NAMESPACE_OPEN_SCOPE
13
20{
21public:
22 HD_DECLARE_DATASOURCE(HdLazyContainerDataSource);
23
24 using Thunk = std::function<HdContainerDataSourceHandle()>;
25
26 HD_API
28 HD_API
29 HdDataSourceBaseHandle Get(const TfToken &name) override;
30
31 HD_API
33
34protected:
35 HD_API
36 HdLazyContainerDataSource(const Thunk &thunk);
37
38private:
39 HdContainerDataSourceHandle _GetSrc();
40
41 Thunk _thunk;
42 HdContainerDataSourceAtomicHandle _src;
43};
44
45PXR_NAMESPACE_CLOSE_SCOPE
46
47#endif
A datasource representing structured (named, hierarchical) data, for example a geometric primitive or...
Definition: dataSource.h:99
A container data source lazily evaluating the given thunk to forward all calls to the container data ...
HD_API TfTokenVector GetNames() override
Returns the list of names for which Get(...) is expected to return a non-null value.
HD_API HdDataSourceBaseHandle Get(const TfToken &name) override
Returns the child datasource of the given name.
Token for efficient comparison, assignment, and hashing of known strings.
Definition: token.h:71
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440