HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
SdfData Class Reference

#include <data.h>

+ Inheritance diagram for SdfData:

Public Member Functions

 SdfData ()
 
virtual SDF_API ~SdfData ()
 
virtual SDF_API bool StreamsData () const
 SdfAbstractData overrides. More...
 
virtual SDF_API bool IsDetached () const
 
virtual SDF_API void CreateSpec (const SdfPath &path, SdfSpecType specType)
 
virtual SDF_API bool HasSpec (const SdfPath &path) const
 Return true if this data has a spec for path. More...
 
virtual SDF_API void EraseSpec (const SdfPath &path)
 
virtual SDF_API void MoveSpec (const SdfPath &oldPath, const SdfPath &newPath)
 
virtual SDF_API SdfSpecType GetSpecType (const SdfPath &path) const
 
virtual SDF_API bool Has (const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value) const
 
virtual SDF_API bool Has (const SdfPath &path, const TfToken &fieldName, VtValue *value=NULL) const
 
virtual SDF_API bool HasSpecAndField (const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value, SdfSpecType *specType) const
 
virtual SDF_API bool HasSpecAndField (const SdfPath &path, const TfToken &fieldName, VtValue *value, SdfSpecType *specType) const
 
virtual SDF_API VtValue Get (const SdfPath &path, const TfToken &fieldName) const
 
virtual SDF_API void Set (const SdfPath &path, const TfToken &fieldName, const VtValue &value)
 
virtual SDF_API void Set (const SdfPath &path, const TfToken &fieldName, const SdfAbstractDataConstValue &value)
 
virtual SDF_API void Erase (const SdfPath &path, const TfToken &fieldName)
 Remove the field at path and fieldName, if one exists. More...
 
virtual SDF_API std::vector
< TfToken
List (const SdfPath &path) const
 Return the names of all the fields that are set at path. More...
 
virtual SDF_API std::set< double > ListAllTimeSamples () const
 
virtual SDF_API std::set< double > ListTimeSamplesForPath (const SdfPath &path) const
 
virtual SDF_API bool GetBracketingTimeSamples (double time, double *tLower, double *tUpper) const
 
virtual SDF_API size_t GetNumTimeSamplesForPath (const SdfPath &path) const
 
virtual SDF_API bool GetBracketingTimeSamplesForPath (const SdfPath &path, double time, double *tLower, double *tUpper) const
 
virtual SDF_API bool QueryTimeSample (const SdfPath &path, double time, SdfAbstractDataValue *optionalValue) const
 
virtual SDF_API bool QueryTimeSample (const SdfPath &path, double time, VtValue *value) const
 
virtual SDF_API void SetTimeSample (const SdfPath &path, double time, const VtValue &value)
 
virtual SDF_API void EraseTimeSample (const SdfPath &path, double time)
 
- Public Member Functions inherited from SdfAbstractData
 SdfAbstractData ()
 
virtual SDF_API ~SdfAbstractData ()
 
virtual SDF_API void CopyFrom (const SdfAbstractDataConstPtr &source)
 
virtual SDF_API bool IsEmpty () const
 
virtual SDF_API bool Equals (const SdfAbstractDataRefPtr &rhs) const
 
virtual SDF_API void WriteToStream (std::ostream &out) const
 
SDF_API void VisitSpecs (SdfAbstractDataSpecVisitor *visitor) const
 
virtual SDF_API std::type_info
const
GetTypeid (const SdfPath &path, const TfToken &fieldName) const
 
template<class T >
T GetAs (const SdfPath &path, const TfToken &fieldName, const T &defaultValue=T()) const
 
virtual SDF_API bool HasDictKey (const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, SdfAbstractDataValue *value) const
 
virtual SDF_API bool HasDictKey (const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, VtValue *value=NULL) const
 
virtual SDF_API VtValue GetDictValueByKey (const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath) const
 
virtual SDF_API void SetDictValueByKey (const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, const VtValue &value)
 
virtual SDF_API void SetDictValueByKey (const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, const SdfAbstractDataConstValue &value)
 
virtual SDF_API void EraseDictValueByKey (const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath)
 
virtual SDF_API std::vector
< TfToken
ListDictKeys (const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath) const
 
- Public Member Functions inherited from TfRefBase
 TfRefBase ()
 
size_t GetCurrentCount () const
 Return the current reference count of this object. More...
 
bool IsUnique () const
 Return true if only one TfRefPtr points to this object. More...
 
const TfRefCountGetRefCount () const
 
void SetShouldInvokeUniqueChangedListener (bool shouldCall)
 
- Public Member Functions inherited from TfWeakBase
 TfWeakBase ()
 
 TfWeakBase (const TfWeakBase &)
 
const TfWeakBase__GetTfWeakBase__ () const
 
const TfWeakBaseoperator= (const TfWeakBase &)
 
void EnableNotification2 () const
 
TF_API void constGetUniqueIdentifier () const
 

Protected Member Functions

virtual SDF_API void _VisitSpecs (SdfAbstractDataSpecVisitor *visitor) const
 
- Protected Member Functions inherited from TfRefBase
virtual TF_API ~TfRefBase ()
 
- Protected Member Functions inherited from TfWeakBase
 ~TfWeakBase ()
 
TfRefPtr< Tf_Remnant_Register () const
 
template<class T >
TfRefPtr< Tf_Remnant_Register (T *tempRmnt) const
 
bool _HasRemnant () const
 

Additional Inherited Members

- Public Types inherited from TfRefBase
typedef void(* UniqueChangedFuncPtr )(TfRefBase const *, bool)
 
- Static Public Member Functions inherited from TfRefBase
static TF_API void SetUniqueChangedListener (UniqueChangedListener listener)
 

Detailed Description

SdfData provides concrete scene description data storage.

An SdfData is an implementation of SdfAbstractData that simply stores specs and fields in a map keyed by path.

Definition at line 49 of file data.h.

Constructor & Destructor Documentation

SdfData::SdfData ( )
inline

Definition at line 52 of file data.h.

virtual SDF_API SdfData::~SdfData ( )
virtual

Member Function Documentation

virtual SDF_API void SdfData::_VisitSpecs ( SdfAbstractDataSpecVisitor visitor) const
protectedvirtual

Visits every spec in this SdfAbstractData object with the given visitor. The order in which specs are visited is undefined. The visitor may not modify the SdfAbstractData object it is visiting. This method should not call Done() on the visitor.

See Also
SdfAbstractDataSpecVisitor

Implements SdfAbstractData.

virtual SDF_API void SdfData::CreateSpec ( const SdfPath path,
SdfSpecType  specType 
)
virtual

Create a new spec at path with the given specType. If the spec already exists the spec type will be changed.

Implements SdfAbstractData.

virtual SDF_API void SdfData::Erase ( const SdfPath path,
const TfToken fieldName 
)
virtual

Remove the field at path and fieldName, if one exists.

Implements SdfAbstractData.

virtual SDF_API void SdfData::EraseSpec ( const SdfPath path)
virtual

Erase the spec at path and any fields that are on it. Note that this does not erase child specs.

Implements SdfAbstractData.

virtual SDF_API void SdfData::EraseTimeSample ( const SdfPath path,
double  time 
)
virtual

Implements SdfAbstractData.

virtual SDF_API VtValue SdfData::Get ( const SdfPath path,
const TfToken fieldName 
) const
virtual

Return the value for the given path and fieldName. Returns an empty value if none is set.

Implements SdfAbstractData.

virtual SDF_API bool SdfData::GetBracketingTimeSamples ( double  time,
double *  tLower,
double *  tUpper 
) const
virtual

Implements SdfAbstractData.

virtual SDF_API bool SdfData::GetBracketingTimeSamplesForPath ( const SdfPath path,
double  time,
double *  tLower,
double *  tUpper 
) const
virtual

Implements SdfAbstractData.

virtual SDF_API size_t SdfData::GetNumTimeSamplesForPath ( const SdfPath path) const
virtual

Implements SdfAbstractData.

virtual SDF_API SdfSpecType SdfData::GetSpecType ( const SdfPath path) const
virtual

Return the spec type for the spec at path. Returns SdfSpecTypeUnknown if the spec doesn't exist.

Implements SdfAbstractData.

virtual SDF_API bool SdfData::Has ( const SdfPath path,
const TfToken fieldName,
SdfAbstractDataValue value 
) const
virtual

Returns whether a value exists for the given path and fieldName. Optionally returns the value if it exists.

Implements SdfAbstractData.

virtual SDF_API bool SdfData::Has ( const SdfPath path,
const TfToken fieldName,
VtValue value = NULL 
) const
virtual

Return whether a value exists for the given path and fieldName. Optionally returns the value if it exists.

Implements SdfAbstractData.

virtual SDF_API bool SdfData::HasSpec ( const SdfPath path) const
virtual

Return true if this data has a spec for path.

Implements SdfAbstractData.

virtual SDF_API bool SdfData::HasSpecAndField ( const SdfPath path,
const TfToken fieldName,
SdfAbstractDataValue value,
SdfSpecType specType 
) const
virtual

Fill specType (which cannot be nullptr) as if by a call to GetSpecType(path). If the resulting specType is not SdfSpecTypeUnknown, then act as if Has(path, fieldName, value) was called and return its result. In other words, the semantics of this function must be identical to this sequence:

*specType = GetSpecType(path);
return *specType != SdfSpecTypeUnknown && Has(path, fieldName, value);

Reimplemented from SdfAbstractData.

virtual SDF_API bool SdfData::HasSpecAndField ( const SdfPath path,
const TfToken fieldName,
VtValue value,
SdfSpecType specType 
) const
virtual

Fill specType (which cannot be nullptr) as if by a call to GetSpecType(path). If the resulting specType is not SdfSpecTypeUnknown, then act as if Has(path, fieldName, value) was called and return its result. In other words, the semantics of this function must be identical to this sequence:

*specType = GetSpecType(path);
return *specType != SdfSpecTypeUnknown && Has(path, fieldName, value);

Reimplemented from SdfAbstractData.

virtual SDF_API bool SdfData::IsDetached ( ) const
virtual

Returns true if this data object is detached from its serialized data store, false otherwise. A detached data object must not be affected by external changes to the serialized data.

Sdf allows clients to specify detached layers to avoid problems that may occur if the underlying data is modified by an external process. For example, a data object that maintains an open file handle or memory mapping to the original layer on disk and reads data on demand is not detached. But a data object that pulls all of the layer contents into memory is detached.

The default implementation returns !StreamsData(). Non-streaming data objects are assumed to be detached from their serialized data, while streaming objects are conservatively assumed to not be detached. Note that it is possible to have a streaming data object that is also detached – for example, if the data object were to make a private copy of the serialized data for its own use and streamed data from it.

Reimplemented from SdfAbstractData.

virtual SDF_API std::vector<TfToken> SdfData::List ( const SdfPath path) const
virtual

Return the names of all the fields that are set at path.

Implements SdfAbstractData.

virtual SDF_API std::set<double> SdfData::ListAllTimeSamples ( ) const
virtual

Implements SdfAbstractData.

virtual SDF_API std::set<double> SdfData::ListTimeSamplesForPath ( const SdfPath path) const
virtual

Implements SdfAbstractData.

virtual SDF_API void SdfData::MoveSpec ( const SdfPath oldPath,
const SdfPath newPath 
)
virtual

Move the spec at oldPath to newPath, including all the fields that are on it. This does not move any child specs.

Implements SdfAbstractData.

virtual SDF_API bool SdfData::QueryTimeSample ( const SdfPath path,
double  time,
SdfAbstractDataValue optionalValue 
) const
virtual

Implements SdfAbstractData.

virtual SDF_API bool SdfData::QueryTimeSample ( const SdfPath path,
double  time,
VtValue value 
) const
virtual

Implements SdfAbstractData.

virtual SDF_API void SdfData::Set ( const SdfPath path,
const TfToken fieldName,
const VtValue value 
)
virtual

Set the value of the given path and fieldName.

It's an error to set a field on a spec that does not exist. Setting a field to an empty VtValue is the same as calling Erase() on it.

Implements SdfAbstractData.

virtual SDF_API void SdfData::Set ( const SdfPath path,
const TfToken fieldName,
const SdfAbstractDataConstValue value 
)
virtual

Set the value of the given path and fieldName.

It's an error to set a field on a spec that does not exist.

Implements SdfAbstractData.

virtual SDF_API void SdfData::SetTimeSample ( const SdfPath path,
double  time,
const VtValue value 
)
virtual

Implements SdfAbstractData.

virtual SDF_API bool SdfData::StreamsData ( ) const
virtual

SdfAbstractData overrides.

Implements SdfAbstractData.


The documentation for this class was generated from the following file: