Loading...
Searching...
No Matches
declareHandles.h File Reference
+ Include dependency graph for declareHandles.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  SdfHandle< T >
 SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check so that dormant objects appear to be expired. More...
 

Macros

#define SDF_DECLARE_HANDLES(cls)
 

Typedefs

typedef TfRefPtr< SdfLayerSdfLayerRefPtr
 
typedef std::vector< TfRefPtr< SdfLayer > > SdfLayerRefPtrVector
 
typedef std::set< SdfHandleTo< SdfLayer >::Handle > SdfLayerHandleSet
 

Functions

template<typename T >
SdfHandleTo< T >::Handle SdfCreateHandle (T *p)
 
template<>
SDF_API SdfHandleTo< SdfLayer >::Handle SdfCreateHandle (SdfLayer *p)
 
template<typename T >
SdfHandleTo< T >::Handle SdfCreateNonConstHandle (T const *p)
 
template<typename DST , typename SRC >
SdfHandle< typename DST::SpecType > TfDynamic_cast (const SdfHandle< SRC > &x)
 Convert SdfHandle<SRC> x to an SdfHandle<DST>.
 
template<typename DST , typename SRC >
SdfHandle< typename DST::SpecType > TfSafeDynamic_cast (const SdfHandle< SRC > &x)
 
template<typename DST , typename SRC >
SdfHandle< typename DST::SpecType > TfStatic_cast (const SdfHandle< SRC > &x)
 Convert SdfHandle<SRC> x to an SdfHandle<DST>.
 
template<typename T >
SdfHandle< typename T::SpecType > TfConst_cast (const SdfHandle< const typename T::SpecType > &x)
 
template<typename DST , typename SRC >
SdfHandle< typename DST::SpecType > SdfSpecDynamic_cast (const SdfHandle< SRC > &x)
 Convert SdfHandle<SRC> x to an SdfHandle<DST>.
 
template<typename DST , typename SRC >
SdfHandle< typename DST::SpecType > SdfSpecStatic_cast (const SdfHandle< SRC > &x)
 Convert SdfHandle<SRC> x to an SdfHandle<DST>.
 
template<typename DST_SPEC , typename SRC_SPEC >
DST_SPEC SdfSpecStatic_cast (const SRC_SPEC &x)
 Convert SRC_SPEC to a DST_SPEC.
 

Macro Definition Documentation

◆ SDF_DECLARE_HANDLES

#define SDF_DECLARE_HANDLES (   cls)
Value:
typedef SdfHandleTo<class cls>::Handle cls##Handle; \
typedef SdfHandleTo<class cls>::ConstHandle cls##ConstHandle; \
typedef SdfHandleTo<class cls>::Vector cls##HandleVector; \
typedef SdfHandleTo<class cls>::ConstVector cls##ConstHandleVector
SdfHandle is a smart ptr that calls IsDormant() on the pointed-to object as an extra expiration check...

Definition at line 355 of file declareHandles.h.

Typedef Documentation

◆ SdfLayerHandleSet

typedef std::set<SdfHandleTo<SdfLayer>::Handle> SdfLayerHandleSet

Definition at line 353 of file declareHandles.h.

◆ SdfLayerRefPtr

Definition at line 351 of file declareHandles.h.

◆ SdfLayerRefPtrVector

typedef std::vector<TfRefPtr<SdfLayer> > SdfLayerRefPtrVector

Definition at line 352 of file declareHandles.h.

Function Documentation

◆ SdfCreateHandle()

SdfHandleTo< T >::Handle SdfCreateHandle ( T *  p)

Definition at line 214 of file declareHandles.h.

◆ SdfCreateNonConstHandle()

SdfHandleTo< T >::Handle SdfCreateNonConstHandle ( T const *  p)

Definition at line 225 of file declareHandles.h.

◆ SdfSpecDynamic_cast()

SdfHandle< typename DST::SpecType > SdfSpecDynamic_cast ( const SdfHandle< SRC > &  x)
inline

Convert SdfHandle<SRC> x to an SdfHandle<DST>.

This function is similar to TfDynamic_cast, but it allows the SRC and DST spec to be indirectly related, so long as the schema associated with the DST spec type is a subclass of the schema associated with x.

Definition at line 317 of file declareHandles.h.

◆ SdfSpecStatic_cast() [1/2]

SdfHandle< typename DST::SpecType > SdfSpecStatic_cast ( const SdfHandle< SRC > &  x)
inline

Convert SdfHandle<SRC> x to an SdfHandle<DST>.

This function is similar to TfStatic_cast, but it allows the SRC and DST spec to be indirectly related.

Definition at line 335 of file declareHandles.h.

◆ SdfSpecStatic_cast() [2/2]

DST_SPEC SdfSpecStatic_cast ( const SRC_SPEC &  x)
inline

Convert SRC_SPEC to a DST_SPEC.

Definition at line 346 of file declareHandles.h.

◆ TfConst_cast()

SdfHandle< typename T::SpecType > TfConst_cast ( const SdfHandle< const typename T::SpecType > &  x)
inline

Definition at line 305 of file declareHandles.h.

◆ TfDynamic_cast()

SdfHandle< typename DST::SpecType > TfDynamic_cast ( const SdfHandle< SRC > &  x)
inline

Convert SdfHandle<SRC> x to an SdfHandle<DST>.

This function behaves similar to a dynamic_cast. If class DST cannot represent the spec pointed to be x, or if the classes DST and SRC are not directly related to each other in the C++ type hierarchy, the conversion fails and an invalid handle is returned.

XXX: The second condition in the above statement is currently untrue. This function will allow casting between spec classes even if they are not directly related. Doing so could lead to schema mismatches and other buggy behavior.

Definition at line 265 of file declareHandles.h.

◆ TfSafeDynamic_cast()

SdfHandle< typename DST::SpecType > TfSafeDynamic_cast ( const SdfHandle< SRC > &  x)
inline

Definition at line 280 of file declareHandles.h.

◆ TfStatic_cast()

SdfHandle< typename DST::SpecType > TfStatic_cast ( const SdfHandle< SRC > &  x)
inline

Convert SdfHandle<SRC> x to an SdfHandle<DST>.

This function behaves similar to a static_cast. No runtime checks are performed to ensure the conversion is valid; it is up to the consumer to ensure this.

Definition at line 292 of file declareHandles.h.