HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
dataSharingSchema.h
Go to the documentation of this file.
1 //
2 // Copyright 2023 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 ////////////////////////////////////////////////////////////////////////
8 
9 /* ************************************************************************** */
10 /* ** ** */
11 /* ** This file is generated by a script. ** */
12 /* ** ** */
13 /* ** Do not edit it directly (unless it is within a CUSTOM CODE section)! ** */
14 /* ** Edit hdSchemaDefs.py instead to make changes. ** */
15 /* ** ** */
16 /* ************************************************************************** */
17 
18 #ifndef PXR_IMAGING_HD_DATA_SHARING_SCHEMA_H
19 #define PXR_IMAGING_HD_DATA_SHARING_SCHEMA_H
20 
21 /// \file
22 
23 #include "pxr/imaging/hd/api.h"
24 
25 #include "pxr/imaging/hd/schema.h"
26 
27 // --(BEGIN CUSTOM CODE: Includes)--
28 // --(END CUSTOM CODE: Includes)--
29 
31 
32 // --(BEGIN CUSTOM CODE: Declares)--
33 // --(END CUSTOM CODE: Declares)--
34 
35 #define HD_DATA_SHARING_SCHEMA_TOKENS \
36  (dataSharing) \
37  (sharingId) \
38 
39 TF_DECLARE_PUBLIC_TOKENS(HdDataSharingSchemaTokens, HD_API,
41 
42 //-----------------------------------------------------------------------------
43 
44 
45 /// \class HdDataSharingSchema
46 ///
48 {
49 public:
50  /// \name Schema retrieval
51  /// @{
52 
53  HdDataSharingSchema(HdContainerDataSourceHandle container)
54  : HdSchema(container) {}
55 
56  /// Retrieves a container data source with the schema's default name token
57  /// "dataSharing" from the parent container and constructs a
58  /// HdDataSharingSchema instance.
59  /// Because the requested container data source may not exist, the result
60  /// should be checked with IsDefined() or a bool comparison before use.
61  HD_API
63  const HdContainerDataSourceHandle &fromParentContainer);
64 
65  /// @}
66 
67 // --(BEGIN CUSTOM CODE: Schema Methods)--
68  /// Wraps an SdfPath so that it is not affected by the
69  /// prefixing scene index.
70  class SharingId {
71  public:
73  : _path(path)
74  {
75  }
76 
77  const SdfPath &GetPath() const { return _path; }
78 
79  bool operator==(const SharingId &other) const {
80  return _path == other._path;
81  }
82 
83  private:
84  HD_API
85  friend std::ostream &operator <<(std::ostream &stream,
86  SharingId const &p);
87 
88  SdfPath _path;
89  };
90 
92 
93  /// Extracts SdfPath from container that was added via
94  /// SharingIdDataSource.
95  HD_API SdfPath GetSharingId() const;
96 
97 // --(END CUSTOM CODE: Schema Methods)--
98 
99  /// \name Member accessor
100  /// @{
101 
102  /// @}
103 
104  /// \name Schema location
105  /// @{
106 
107  /// Returns a token where the container representing this schema is found in
108  /// a container by default.
109  HD_API
110  static const TfToken &GetSchemaToken();
111 
112  /// @}
113 
114  /// \name Schema construction
115  /// @{
116  HD_API
117  static HdContainerDataSourceHandle
119  size_t count,
120  const TfToken *names,
121  const HdDataSourceBaseHandle *values);
122 
123  /// @}
124 };
125 
127 
128 #endif
GLuint GLuint stream
Definition: glcorearb.h:1832
HD_API friend std::ostream & operator<<(std::ostream &stream, SharingId const &p)
bool operator==(const SharingId &other) const
static HD_API HdContainerDataSourceHandle BuildRetained(size_t count, const TfToken *names, const HdDataSourceBaseHandle *values)
const SdfPath & GetPath() const
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
HD_API SdfPath GetSharingId() const
#define HD_API
Definition: api.h:23
#define HD_DATA_SHARING_SCHEMA_TOKENS
static HD_API HdDataSharingSchema GetFromParent(const HdContainerDataSourceHandle &fromParentContainer)
HdDataSharingSchema(HdContainerDataSourceHandle container)
Definition: token.h:70
static HD_API const TfToken & GetSchemaToken()
Definition: path.h:273
SharingId(const SdfPath &path)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
GLenum GLsizei GLsizei GLint * values
Definition: glcorearb.h:1602
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
TF_DECLARE_PUBLIC_TOKENS(HdDataSharingSchemaTokens, HD_API, HD_DATA_SHARING_SCHEMA_TOKENS)
GLint GLsizei count
Definition: glcorearb.h:405