HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
accessorHelpers.h File Reference
#include "pxr/pxr.h"
#include "pxr/usd/sdf/schema.h"
#include "pxr/usd/sdf/spec.h"
#include "pxr/usd/sdf/types.h"
#include <type_traits>
+ Include dependency graph for accessorHelpers.h:

Go to the source code of this file.

Classes

struct  Sdf_AccessorHelpers< T, IsForSpec >
 
struct  Sdf_AccessorHelpers< T, true >
 
struct  Sdf_AccessorHelpers< T, false >
 

Macros

#define _GET_KEY_(key_)   key_
 
#define SDF_NO_PREDICATE   true
 
#define _GET_WITH_FALLBACK(key_, heldType_)
 
#define SDF_DEFINE_GET(name_, key_, heldType_)
 
#define SDF_DEFINE_IS(name_, key_)
 
#define SDF_DEFINE_SET(name_, key_, argType_)
 
#define SDF_DEFINE_HAS(name_, key_)
 
#define SDF_DEFINE_CLEAR(name_, key_)
 
#define SDF_DEFINE_GET_PRIVATE(name_, key_, heldType_)
 
#define SDF_DEFINE_DICTIONARY_GET(name_, key_)
 
#define SDF_DEFINE_DICTIONARY_SET(name_, key_)
 
#define SDF_DEFINE_TYPED_GET_SET(name_, key_, getType_, setType_)
 
#define SDF_DEFINE_TYPED_GET_SET_HAS_CLEAR(name_, key_, getType_, setType_)
 
#define SDF_DEFINE_GET_SET(name_, key_, type_)
 
#define SDF_DEFINE_GET_SET_HAS_CLEAR(name_, key_, type_)
 
#define SDF_DEFINE_IS_SET(name_, key_)
 
#define SDF_DEFINE_DICTIONARY_GET_SET(getName_, setName_, key_)
 

Typedefs

template<typename T >
using Sdf_SetParameter = std::conditional< std::is_arithmetic< T >::value, std::add_const_t< T >, std::add_lvalue_reference_t< std::add_const_t< T >>>
 

Macro Definition Documentation

#define _GET_KEY_ (   key_)    key_

Definition at line 57 of file accessorHelpers.h.

#define _GET_WITH_FALLBACK (   key_,
  heldType_ 
)
Value:
{ \
const VtValue& value = _Helper::GetField(this, key_); \
if (value.IsEmpty() || !value.IsHolding<heldType_>()) { \
const SdfSchemaBase& schema = _Helper::GetSchema(this); \
return schema.GetFallback(_GET_KEY_(key_)).Get<heldType_>(); \
} \
else { \
return value.Get<heldType_>(); \
} \
}
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
Definition: core.h:1131
#define _GET_KEY_(key_)
Definition: value.h:164

Definition at line 60 of file accessorHelpers.h.

#define SDF_DEFINE_CLEAR (   name_,
  key_ 
)
Value:
void \
SDF_ACCESSOR_CLASS::Clear ## name_() \
{ \
if (SDF_ACCESSOR_WRITE_PREDICATE(_GET_KEY_(key_))) { \
_Helper::ClearField(this, _GET_KEY_(key_)); \
} \
}
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
#define _GET_KEY_(key_)

Definition at line 117 of file accessorHelpers.h.

#define SDF_DEFINE_DICTIONARY_GET (   name_,
  key_ 
)
Value:
SdfDictionaryProxy \
SDF_ACCESSOR_CLASS::name_() const \
{ \
return SDF_ACCESSOR_READ_PREDICATE(_GET_KEY_(key_)) ? \
SdfDictionaryProxy(_Helper::GetSpecHandle(this), _GET_KEY_(key_)) : \
}
SdfMapEditProxy< VtDictionary > SdfDictionaryProxy
Definition: proxyTypes.h:69
#define _GET_KEY_(key_)

Definition at line 144 of file accessorHelpers.h.

#define SDF_DEFINE_DICTIONARY_GET_SET (   getName_,
  setName_,
  key_ 
)
Value:
#define SDF_DEFINE_DICTIONARY_SET(name_, key_)
#define SDF_DEFINE_DICTIONARY_GET(name_, key_)

Definition at line 203 of file accessorHelpers.h.

#define SDF_DEFINE_DICTIONARY_SET (   name_,
  key_ 
)
Value:
void \
SDF_ACCESSOR_CLASS::name_( \
const std::string& name, \
const VtValue& value) \
{ \
if (SDF_ACCESSOR_WRITE_PREDICATE(_GET_KEY_(key_))) { \
_Helper::GetSpecHandle(this), _GET_KEY_(key_)); \
if (value.IsEmpty()) { \
proxy.erase(name); \
} \
else { \
proxy[name] = value; \
} \
} \
}
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GLsizei const GLfloat * value
Definition: glcorearb.h:824
SdfMapEditProxy< VtDictionary > SdfDictionaryProxy
Definition: proxyTypes.h:69
GLuint const GLchar * name
Definition: glcorearb.h:786
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
Definition: core.h:1131
#define _GET_KEY_(key_)
Definition: value.h:164

Definition at line 154 of file accessorHelpers.h.

#define SDF_DEFINE_GET (   name_,
  key_,
  heldType_ 
)
Value:
heldType_ \
SDF_ACCESSOR_CLASS::Get ## name_() const \
{ \
if (SDF_ACCESSOR_READ_PREDICATE(_GET_KEY_(key_))) { \
/* Empty clause needed to prevent compiler complaints */ \
} \
_GET_WITH_FALLBACK(key_, heldType_); \
}
#define _GET_WITH_FALLBACK(key_, heldType_)
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
#define _GET_KEY_(key_)

Definition at line 76 of file accessorHelpers.h.

#define SDF_DEFINE_GET_PRIVATE (   name_,
  key_,
  heldType_ 
)
Value:
heldType_ \
SDF_ACCESSOR_CLASS::_Get ## name_() const \
{ \
if (SDF_ACCESSOR_READ_PREDICATE(_GET_KEY_(key_))) { \
/* Empty clause needed to prevent compiler complaints */ \
} \
_GET_WITH_FALLBACK(key_, heldType_); \
}
#define _GET_WITH_FALLBACK(key_, heldType_)
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
#define _GET_KEY_(key_)

Definition at line 130 of file accessorHelpers.h.

#define SDF_DEFINE_GET_SET (   name_,
  key_,
  type_ 
)
Value:
SDF_DEFINE_TYPED_GET_SET(name_, key_, type_, \
#define SDF_DEFINE_TYPED_GET_SET(name_, key_, getType_, setType_)
std::conditional< std::is_arithmetic< T >::value, std::add_const_t< T >, std::add_lvalue_reference_t< std::add_const_t< T >>> Sdf_SetParameter

Definition at line 191 of file accessorHelpers.h.

#define SDF_DEFINE_GET_SET_HAS_CLEAR (   name_,
  key_,
  type_ 
)
Value:
#define SDF_DEFINE_TYPED_GET_SET_HAS_CLEAR(name_, key_, getType_, setType_)
std::conditional< std::is_arithmetic< T >::value, std::add_const_t< T >, std::add_lvalue_reference_t< std::add_const_t< T >>> Sdf_SetParameter

Definition at line 195 of file accessorHelpers.h.

#define SDF_DEFINE_HAS (   name_,
  key_ 
)
Value:
bool \
SDF_ACCESSOR_CLASS::Has ## name_() const \
{ \
return SDF_ACCESSOR_READ_PREDICATE(_GET_KEY_(key_)) ? \
_Helper::HasField(this, _GET_KEY_(key_)) : false; \
}
#define _GET_KEY_(key_)

Definition at line 108 of file accessorHelpers.h.

#define SDF_DEFINE_IS (   name_,
  key_ 
)
Value:
bool \
SDF_ACCESSOR_CLASS::Is ## name_() const \
{ \
if (!SDF_ACCESSOR_READ_PREDICATE(_GET_KEY_(key_))) { \
return false; \
} \
_GET_WITH_FALLBACK(key_, bool); \
}
#define _GET_WITH_FALLBACK(key_, heldType_)
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
#define _GET_KEY_(key_)

Definition at line 87 of file accessorHelpers.h.

#define SDF_DEFINE_IS_SET (   name_,
  key_ 
)
Value:
SDF_DEFINE_IS(name_, key_) \
SDF_DEFINE_SET(name_, key_, bool)
#define SDF_DEFINE_SET(name_, key_, argType_)
#define SDF_DEFINE_IS(name_, key_)

Definition at line 199 of file accessorHelpers.h.

#define SDF_DEFINE_SET (   name_,
  key_,
  argType_ 
)
Value:
void \
SDF_ACCESSOR_CLASS::Set ## name_(argType_ value) \
{ \
if (SDF_ACCESSOR_WRITE_PREDICATE(_GET_KEY_(key_))) { \
_Helper::SetField(this, _GET_KEY_(key_), value); \
} \
}
if(num_boxed_items<=0)
Definition: UT_RTreeImpl.h:697
Definition: core.h:1131
#define _GET_KEY_(key_)

Definition at line 98 of file accessorHelpers.h.

#define SDF_DEFINE_TYPED_GET_SET (   name_,
  key_,
  getType_,
  setType_ 
)
Value:
SDF_DEFINE_GET(name_, key_, getType_) \
SDF_DEFINE_SET(name_, key_, setType_)
#define SDF_DEFINE_GET(name_, key_, heldType_)
#define SDF_DEFINE_SET(name_, key_, argType_)

Definition at line 182 of file accessorHelpers.h.

#define SDF_DEFINE_TYPED_GET_SET_HAS_CLEAR (   name_,
  key_,
  getType_,
  setType_ 
)
Value:
SDF_DEFINE_TYPED_GET_SET(name_, key_, getType_, setType_) \
SDF_DEFINE_HAS(name_, key_) \
SDF_DEFINE_CLEAR(name_, key_)
#define SDF_DEFINE_CLEAR(name_, key_)
#define SDF_DEFINE_HAS(name_, key_)
#define SDF_DEFINE_TYPED_GET_SET(name_, key_, getType_, setType_)

Definition at line 186 of file accessorHelpers.h.

#define SDF_NO_PREDICATE   true

Definition at line 58 of file accessorHelpers.h.

Typedef Documentation

template<typename T >
using Sdf_SetParameter = std::conditional< std::is_arithmetic<T>::value, std::add_const_t<T>, std::add_lvalue_reference_t<std::add_const_t<T>>>

Definition at line 180 of file accessorHelpers.h.