24 #ifndef PXR_USD_SDF_ALLOWED_H
25 #define PXR_USD_SDF_ALLOWED_H
48 typedef std::optional<std::string> _State;
51 typedef std::pair<bool, std::string>
Pair;
66 _state(condition ? std::nullopt :
67 std::make_optional(whyNot)) { }
79 return _state ? NULL : &SdfAllowed::_state;
85 return static_cast<bool>(_state);
103 if (whyNot && _state) {
113 return _state == other._state;
118 return !(*
this == other);
127 #endif // PXR_USD_SDF_ALLOWED_H
GLsizei const GLchar *const * string
SdfAllowed(bool condition, const char *whyNot)
Construct in condition with annotation whyNot if false.
bool operator!() const
Returns false in a boolean context if allowed, true otherwise.
bool IsAllowed(std::string *whyNot) const
bool operator==(const SdfAllowed &other) const
std::pair< bool, std::string > Pair
SdfAllowed(bool condition, const std::string &whyNot)
Construct in condition with annotation whyNot if false.
SDF_API const std::string & GetWhyNot() const
SdfAllowed(const std::string &whyNot)
Construct false with annotation whyNot.
SdfAllowed(bool x)
Construct true.
SdfAllowed(const char *whyNot)
Construct false with annotation whyNot.
SdfAllowed()
Construct true.
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
#define PXR_NAMESPACE_CLOSE_SCOPE
bool operator!=(const SdfAllowed &other) const
SdfAllowed(const Pair &x)
Construct from bool,string pair x.
_State SdfAllowed::* UnspecifiedBoolType