HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
sdfTypeIndicator.h
Go to the documentation of this file.
1 //
2 // Copyright 2024 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 
8 #ifndef PXR_USD_NDR_SDF_TYPE_INDICATOR_H
9 #define PXR_USD_NDR_SDF_TYPE_INDICATOR_H
10 
11 /// \file ndr/sdfTypeIndicator.h
12 ///
13 /// \deprecated
14 /// All Ndr objects are deprecated in favor of the corresponding Sdr objects
15 /// in sdr/registry.h
16 
17 #include "pxr/pxr.h"
18 #include "pxr/usd/ndr/api.h"
19 #include "pxr/base/tf/token.h"
21 
23 
24 /// \class NdrSdfTypeIndicator
25 /// Represents a mapping from an Ndr Property type to Sdf type.
26 ///
27 /// If an exact mapping exists from Ndr Property type to Sdf type, HasSdfType()
28 /// will return true, and GetSdfType() will return the Sdf type resulting from
29 /// the conversion. GetNdrType() will return the original Ndr Property type.
30 ///
31 /// If a mapping doesn't exist from Ndr Property type to Sdf type, HasSdfType()
32 /// will return false, and GetSdfType() will return either
33 /// SdfValueTypeNames->TokenArray or SdfValueTypeNames->Token. GetNdrType()
34 /// will return the original Ndr Property type.
35 ///
36 /// \deprecated
37 /// Deprecated in favor of SdrSdfTypeIndicator
39 {
40 public:
41  /// Default constructor.
42  NDR_API
44 
45  /// Constructor. The sdfType must be TokenArray or Token if hasSdfTypeMapping
46  /// is set to false.
47  NDR_API
49  const SdfValueTypeName& sdfType,
50  const TfToken& ndrType,
51  bool hasSdfTypeMapping = true);
52 
53  /// Gets the original Ndr property type associated with the represented
54  /// Ndr property type to Sdf type mapping.
55  ///
56  /// \deprecated
57  /// Deprecated in favor of GetSdrType
58  NDR_API
59  TfToken GetNdrType() const;
60 
61  /// Gets the original Sdr property type associated with the represented
62  /// Sdr property type to Sdf type mapping.
63  NDR_API
64  TfToken GetSdrType() const;
65 
66  /// Whether an exact Sdf type exists for the represented Ndr property type
67  /// to Sdf type mapping.
68  NDR_API
69  bool HasSdfType() const;
70 
71  /// Gets the Sdf type associated with the represented Ndr property type to
72  /// Sdf type mapping. If there is no valid Sdf type, either
73  /// SdfValueTypeNames->TokenArray or SdfValueTypeNames->Token is returned.
74  NDR_API
76 
77  /// Equality operation
78  NDR_API
79  bool operator==(const NdrSdfTypeIndicator &rhs) const;
80 
81  /// Inequality operation
82  NDR_API
83  bool operator!=(const NdrSdfTypeIndicator &rhs) const;
84 
85 private:
86  SdfValueTypeName _sdfType;
87  TfToken _ndrType;
88  bool _hasSdfTypeMapping;
89 };
90 
92 
93 #endif // PXR_USD_NDR_SDF_TYPE_INDICATOR_H
NDR_API NdrSdfTypeIndicator()
Default constructor.
NDR_API bool operator!=(const NdrSdfTypeIndicator &rhs) const
Inequality operation.
NDR_API TfToken GetSdrType() const
NDR_API TfToken GetNdrType() const
Definition: token.h:70
NDR_API SdfValueTypeName GetSdfType() const
NDR_API bool HasSdfType() const
#define NDR_API
Definition: api.h:23
NDR_API bool operator==(const NdrSdfTypeIndicator &rhs) const
Equality operation.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74