HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
mapContainerDataSource.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_MAP_CONTAINER_DATA_SOURCE_H
8 #define PXR_IMAGING_HD_MAP_CONTAINER_DATA_SOURCE_H
9 
11 
13 
14 /// \class HdMapContainerDataSource
15 ///
16 /// Applies function to all data sources in a container data source
17 /// (non-recursively).
19 {
20 public:
22 
23  using ValueFunction =
24  std::function<HdDataSourceBaseHandle(const HdDataSourceBaseHandle &)>;
25 
26  HD_API
27  ~HdMapContainerDataSource() override;
28 
29  HD_API
30  TfTokenVector GetNames() override;
31  HD_API
32  HdDataSourceBaseHandle Get(const TfToken &name) override;
33 private:
34  /// (Lazily) Create new container data source by applying given
35  /// function to all data sources.
36  HD_API
38  const ValueFunction &f,
39  const HdContainerDataSourceHandle &src);
40 
41  ValueFunction _f;
42 
43  HdContainerDataSourceHandle _src;
44 };
45 
47 
49 
50 #endif
HD_API ~HdMapContainerDataSource() override
HD_API HdDataSourceBaseHandle Get(const TfToken &name) override
#define HD_API
Definition: api.h:23
GLfloat f
Definition: glcorearb.h:1926
Definition: token.h:70
HD_DECLARE_DATASOURCE(HdMapContainerDataSource)
std::vector< TfToken > TfTokenVector
Convenience types.
Definition: token.h:440
GLuint const GLchar * name
Definition: glcorearb.h:786
HD_API TfTokenVector GetNames() override
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
HD_DECLARE_DATASOURCE_HANDLES(HdMapContainerDataSource)
std::function< HdDataSourceBaseHandle(const HdDataSourceBaseHandle &)> ValueFunction
GLenum src
Definition: glcorearb.h:1793