25 #ifndef PXR_USD_NDR_DECLARE_H
26 #define PXR_USD_NDR_DECLARE_H
36 #include <unordered_map>
37 #include <unordered_set>
131 return (static_cast<std::size_t>(_major) << 32) +
132 static_cast<std::size_t
>(_minor);
137 explicit operator bool()
const
146 return _major == 0 && _minor == 0;
151 friend bool operator==(
const NdrVersion& lhs,
const NdrVersion& rhs)
153 return lhs._major == rhs._major && lhs._minor == rhs._minor;
158 friend bool operator!=(
const NdrVersion& lhs,
const NdrVersion& rhs)
160 return !(lhs == rhs);
165 friend bool operator<(
const NdrVersion& lhs,
const NdrVersion& rhs)
167 return lhs._major < rhs._major ||
168 (lhs._major == rhs._major && lhs._minor < rhs._minor);
173 friend bool operator<=(
const NdrVersion& lhs,
const NdrVersion& rhs)
175 return lhs._major < rhs._major ||
176 (lhs._major == rhs._major && lhs._minor <= rhs._minor);
181 friend bool operator>(
const NdrVersion& lhs,
const NdrVersion& rhs)
183 return !(lhs <= rhs);
188 friend bool operator>=(
const NdrVersion& lhs,
const NdrVersion& rhs)
195 : _major(x._major), _minor(x._minor), _isDefault(true) { }
198 int _major = 0, _minor = 0;
199 bool _isDefault =
false;
211 #endif // PXR_USD_NDR_DECLARE_H
NDR_API int GetMajor() const
Return the major version number or zero for an invalid version.
NDR_API std::size_t GetHash() const
Return a hash for the version.
NdrVersionFilter
Enumeration used to select nodes by version.
NDR_API int GetMinor() const
Return the minor version number or zero for an invalid version.
std::vector< TfToken > NdrTokenVec
NDR_API friend bool operator>=(const NdrVersion &lhs, const NdrVersion &rhs)
Return true iff the left side is greater than or equal to the right side.
NDR_API std::string GetString() const
Return the version as a string.
NdrNode const * NdrNodeConstPtr
std::vector< NdrNodeUniquePtr > NdrNodeUniquePtrVec
GLsizei const GLchar *const * string
std::vector< NdrOption > NdrOptionVec
NDR_API friend bool operator>(const NdrVersion &lhs, const NdrVersion &rhs)
Return true iff the left side is greater than the right side.
Functor to use for hash maps from tokens to other things.
NDR_API std::string GetStringSuffix() const
Return the version as a identifier suffix.
TfToken::HashFunctor NdrIdentifierHashFunctor
std::vector< NdrNodeConstPtr > NdrNodeConstPtrVec
NDR_API bool operator!() const
Return true iff the version is invalid.
NDR_API friend bool operator<=(const NdrVersion &lhs, const NdrVersion &rhs)
Return true iff the left side is less than or equal to the right side.
std::vector< NdrPropertyUniquePtr > NdrPropertyUniquePtrVec
std::pair< SdfValueTypeName, TfToken > NdrSdfTypeIndicator
std::vector< NdrIdentifier > NdrIdentifierVec
NDR_API NdrVersion GetAsDefault() const
NDR_API friend bool operator!=(const NdrVersion &lhs, const NdrVersion &rhs)
Return true iff versions are not equal.
std::vector< std::string > NdrStringVec
std::unordered_set< NdrIdentifier, NdrIdentifierHashFunctor > NdrIdentifierSet
std::unique_ptr< NdrProperty > NdrPropertyUniquePtr
std::pair< TfToken, TfToken > NdrOption
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
NDR_API bool IsDefault() const
Return true iff this version is marked as default.
NDR_API friend bool operator<(const NdrVersion &lhs, const NdrVersion &rhs)
Return true iff the left side is less than the right side.
std::unique_ptr< NdrNode > NdrNodeUniquePtr
#define PXR_NAMESPACE_CLOSE_SCOPE
NdrProperty * NdrPropertyPtr
NDR_API friend bool operator==(const NdrVersion &lhs, const NdrVersion &rhs)
Return true iff versions are equal.
std::unordered_set< std::string > NdrStringSet
std::unordered_map< TfToken, std::string, TfToken::HashFunctor > NdrTokenMap
std::unordered_map< TfToken, NdrPropertyConstPtr, TfToken::HashFunctor > NdrPropertyPtrMap
NDR_API NdrVersion()=default
Create an invalid version.
NdrProperty const * NdrPropertyConstPtr
const std::string & NdrGetIdentifierString(const NdrIdentifier &id)