All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
accessorHelpers.h File Reference
+ Include dependency graph for accessorHelpers.h:

Go to the source code of this file.

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_)
 

Macro Definition Documentation

#define _GET_WITH_FALLBACK (   key_,
  heldType_ 
)
Value:
{ \
typedef Sdf_AccessorHelpers<SDF_ACCESSOR_CLASS> _Helper; \
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_>(); \
} \
}
void if(!TfPyIsInitialized())
Invokes wrapFunc to wrap type T if T is not already wrapped.
Definition: pyUtils.h:210
Generic class that provides information about scene description fields but doesn&#39;t actually provide a...
Definition: schema.h:62
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182

Definition at line 58 of file accessorHelpers.h.

#define SDF_DEFINE_CLEAR (   name_,
  key_ 
)
Value:
void \
SDF_ACCESSOR_CLASS::Clear ## name_() \
{ \
typedef Sdf_AccessorHelpers<SDF_ACCESSOR_CLASS> _Helper; \
if (SDF_ACCESSOR_WRITE_PREDICATE(_GET_KEY_(key_))) { \
_Helper::ClearField(this, _GET_KEY_(key_)); \
} \
}
void if(!TfPyIsInitialized())
Invokes wrapFunc to wrap type T if T is not already wrapped.
Definition: pyUtils.h:210

Definition at line 115 of file accessorHelpers.h.

#define SDF_DEFINE_DICTIONARY_GET (   name_,
  key_ 
)
Value:
SdfDictionaryProxy \
SDF_ACCESSOR_CLASS::name_() const \
{ \
typedef Sdf_AccessorHelpers<SDF_ACCESSOR_CLASS> _Helper; \
return SDF_ACCESSOR_READ_PREDICATE(_GET_KEY_(key_)) ? \
SdfDictionaryProxy(_Helper::GetSpecHandle(this), _GET_KEY_(key_)) : \
}
A proxy for editing map-like values.
Definition: mapEditProxy.h:120

Definition at line 142 of file accessorHelpers.h.

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

Definition at line 194 of file accessorHelpers.h.

#define SDF_DEFINE_DICTIONARY_SET (   name_,
  key_ 
)
Value:
void \
SDF_ACCESSOR_CLASS::name_( \
const std::string& name, \
const VtValue& value) \
{ \
typedef Sdf_AccessorHelpers<SDF_ACCESSOR_CLASS> _Helper; \
if (SDF_ACCESSOR_WRITE_PREDICATE(_GET_KEY_(key_))) { \
SdfDictionaryProxy proxy( \
_Helper::GetSpecHandle(this), _GET_KEY_(key_)); \
if (value.IsEmpty()) { \
proxy.erase(name); \
} \
else { \
proxy[name] = value; \
} \
} \
}
void if(!TfPyIsInitialized())
Invokes wrapFunc to wrap type T if T is not already wrapped.
Definition: pyUtils.h:210
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Definition: value.h:182

Definition at line 152 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_); \
}
void if(!TfPyIsInitialized())
Invokes wrapFunc to wrap type T if T is not already wrapped.
Definition: pyUtils.h:210

Definition at line 74 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_); \
}
void if(!TfPyIsInitialized())
Invokes wrapFunc to wrap type T if T is not already wrapped.
Definition: pyUtils.h:210

Definition at line 128 of file accessorHelpers.h.

#define SDF_DEFINE_GET_SET (   name_,
  key_,
  type_ 
)
Value:
SDF_DEFINE_TYPED_GET_SET(name_, key_, type_, \
boost::call_traits<type_>::param_type)

Definition at line 182 of file accessorHelpers.h.

#define SDF_DEFINE_GET_SET_HAS_CLEAR (   name_,
  key_,
  type_ 
)
Value:
SDF_DEFINE_TYPED_GET_SET_HAS_CLEAR(name_, key_, type_, \
boost::call_traits<type_>::param_type)

Definition at line 186 of file accessorHelpers.h.

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

Definition at line 106 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); \
}
void if(!TfPyIsInitialized())
Invokes wrapFunc to wrap type T if T is not already wrapped.
Definition: pyUtils.h:210

Definition at line 85 of file accessorHelpers.h.

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

Definition at line 190 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_))) { \
typedef Sdf_AccessorHelpers<SDF_ACCESSOR_CLASS> _Helper; \
_Helper::SetField(this, _GET_KEY_(key_), value); \
} \
}
void if(!TfPyIsInitialized())
Invokes wrapFunc to wrap type T if T is not already wrapped.
Definition: pyUtils.h:210

Definition at line 96 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_)

Definition at line 173 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_)

Definition at line 177 of file accessorHelpers.h.