HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
opaqueValue.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_USD_SDF_OPAQUE_VALUE_H
8 #define PXR_USD_SDF_OPAQUE_VALUE_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/usd/sdf/api.h"
12 
13 #include <cstddef>
14 #include <iosfwd>
15 
16 
18 
19 /// In-memory representation of the value of an opaque attribute.
20 ///
21 /// Opaque attributes cannot have authored values, but every typename in Sdf
22 /// must have a corresponding constructable C++ value type; SdfOpaqueValue is
23 /// the type associated with opaque attributes. Opaque values intentionally
24 /// cannot hold any information, cannot be parsed, and cannot be serialized to
25 /// a layer.
26 ///
27 /// SdfOpaqueValue is also the type associated with group attributes. A group
28 /// attribute is an opaque attribute that represents a group of other
29 /// properties.
30 ///
31 class SdfOpaqueValue final {};
32 
33 inline bool
35 {
36  return true;
37 }
38 
39 inline bool
41 {
42  return false;
43 }
44 
45 inline size_t hash_value(SdfOpaqueValue const &)
46 {
47  // Use a nonzero constant here because some bad hash functions don't deal
48  // with zero well. Chosen by fair dice roll.
49  return 9;
50 }
51 
52 SDF_API std::ostream& operator<<(std::ostream &, SdfOpaqueValue const &);
53 
55 
56 #endif
SDF_API std::ostream & operator<<(std::ostream &, SdfOpaqueValue const &)
bool operator!=(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Inequality operator, does exact floating point comparisons.
Definition: Mat3.h:556
size_t hash_value(SdfOpaqueValue const &)
Definition: opaqueValue.h:45
#define SDF_API
Definition: api.h:23
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
bool operator==(const Mat3< T0 > &m0, const Mat3< T1 > &m1)
Equality operator, does exact floating point comparisons.
Definition: Mat3.h:542