![]() |
|
SdfData provides concrete scene description data storage. More...
#include <data.h>
Public Member Functions | |
virtual SDF_API bool | StreamsData () const |
SdfAbstractData overrides. | |
virtual SDF_API bool | IsDetached () const |
Returns true if this data object is detached from its serialized data store, false otherwise. | |
virtual SDF_API void | CreateSpec (const SdfPath &path, SdfSpecType specType) |
Create a new spec at path with the given specType. | |
virtual SDF_API bool | HasSpec (const SdfPath &path) const |
Return true if this data has a spec for path. | |
virtual SDF_API void | EraseSpec (const SdfPath &path) |
Erase the spec at path and any fields that are on it. | |
virtual SDF_API void | MoveSpec (const SdfPath &oldPath, const SdfPath &newPath) |
Move the spec at oldPath to newPath, including all the fields that are on it. | |
virtual SDF_API SdfSpecType | GetSpecType (const SdfPath &path) const |
Return the spec type for the spec at path. | |
virtual SDF_API bool | Has (const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value) const |
Returns whether a value exists for the given path and fieldName. | |
virtual SDF_API bool | Has (const SdfPath &path, const TfToken &fieldName, VtValue *value=NULL) const |
Return whether a value exists for the given path and fieldName. | |
virtual SDF_API bool | HasSpecAndField (const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value, SdfSpecType *specType) const |
Fill specType (which cannot be nullptr) as if by a call to GetSpecType(path). | |
virtual SDF_API bool | HasSpecAndField (const SdfPath &path, const TfToken &fieldName, VtValue *value, SdfSpecType *specType) const |
Fill specType (which cannot be nullptr) as if by a call to GetSpecType(path). | |
virtual SDF_API VtValue | Get (const SdfPath &path, const TfToken &fieldName) const |
Return the value for the given path and fieldName. | |
virtual SDF_API void | Set (const SdfPath &path, const TfToken &fieldName, const VtValue &value) |
Set the value of the given path and fieldName. | |
virtual SDF_API void | Set (const SdfPath &path, const TfToken &fieldName, const SdfAbstractDataConstValue &value) |
Set the value of the given path and fieldName. | |
virtual SDF_API void | Erase (const SdfPath &path, const TfToken &fieldName) |
Remove the field at path and fieldName , if one exists. | |
virtual SDF_API std::vector< TfToken > | List (const SdfPath &path) const |
Return the names of all the fields that are set at path . | |
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) |
![]() | |
virtual SDF_API void | CopyFrom (const SdfAbstractDataConstPtr &source) |
Copy the data in source into this data object. | |
virtual SDF_API bool | StreamsData () const =0 |
Returns true if this data object streams its data to and from its serialized data store on demand. | |
virtual SDF_API bool | IsDetached () const |
Returns true if this data object is detached from its serialized data store, false otherwise. | |
virtual SDF_API bool | IsEmpty () const |
Returns true if this data object has no specs, false otherwise. | |
virtual SDF_API bool | Equals (const SdfAbstractDataRefPtr &rhs) const |
Returns true if this data object contains the same specs and fields as lhs, false otherwise. | |
virtual SDF_API void | WriteToStream (std::ostream &out) const |
Writes the contents of this data object to out . | |
SDF_API void | VisitSpecs (SdfAbstractDataSpecVisitor *visitor) const |
Visits every spec in this SdfAbstractData object with the given visitor . | |
virtual SDF_API std::type_info const & | GetTypeid (const SdfPath &path, const TfToken &fieldName) const |
Return the type of the value for fieldName on spec path . | |
template<class T > | |
T | GetAs (const SdfPath &path, const TfToken &fieldName, const T &defaultValue=T()) const |
Return the value for the given path and fieldName. | |
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 |
![]() | |
TfRefBase (TfRefBase const &) | |
TfRefBase & | operator= (TfRefBase const &) |
size_t | GetCurrentCount () const |
Return the current reference count of this object. | |
bool | IsUnique () const |
Return true if only one TfRefPtr points to this object. | |
void | SetShouldInvokeUniqueChangedListener (bool shouldCall) |
![]() | |
TfWeakBase (const TfWeakBase &) | |
const TfWeakBase & | __GetTfWeakBase__ () const |
const TfWeakBase & | operator= (const TfWeakBase &) |
void | EnableNotification2 () const |
TF_API void const * | GetUniqueIdentifier () const |
Protected Member Functions | |
virtual SDF_API void | _VisitSpecs (SdfAbstractDataSpecVisitor *visitor) const |
Visits every spec in this SdfAbstractData object with the given visitor . | |
virtual SDF_API void | _VisitSpecs (SdfAbstractDataSpecVisitor *visitor) const =0 |
Visits every spec in this SdfAbstractData object with the given visitor . | |
![]() | |
TfRefPtr< Tf_Remnant > | _Register () const |
template<class T > | |
TfRefPtr< Tf_Remnant > | _Register (T *tempRmnt) const |
bool | _HasRemnant () const |
Additional Inherited Members | |
![]() | |
typedef void(* | UniqueChangedFuncPtr) (TfRefBase const *, bool) |
![]() | |
static TF_API void | SetUniqueChangedListener (UniqueChangedListener listener) |
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.
|
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.
Implements SdfAbstractData.
|
virtual |
Create a new spec at path with the given specType.
If the spec already exists the spec type will be changed.
Implements SdfAbstractData.
Remove the field at path
and fieldName
, if one exists.
Implements SdfAbstractData.
|
virtual |
Erase the spec at path and any fields that are on it.
Note that this does not erase child specs.
Implements SdfAbstractData.
|
virtual |
Implements SdfAbstractData.
Return the value for the given path and fieldName.
Returns an empty value if none is set.
Implements SdfAbstractData.
|
virtual |
Implements SdfAbstractData.
|
virtual |
Implements SdfAbstractData.
|
virtual |
Implements SdfAbstractData.
|
virtual |
Return the spec type for the spec at path.
Returns SdfSpecTypeUnknown if the spec doesn't exist.
Implements SdfAbstractData.
|
virtual |
Returns whether a value exists for the given path and fieldName.
Optionally returns the value if it exists.
Implements SdfAbstractData.
|
virtual |
Return whether a value exists for the given path and fieldName.
Optionally returns the value if it exists.
Implements SdfAbstractData.
|
virtual |
Return true if this data has a spec for path.
Implements SdfAbstractData.
|
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:
Reimplemented from SdfAbstractData.
|
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:
Reimplemented from SdfAbstractData.
|
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.
Return the names of all the fields that are set at path
.
Implements SdfAbstractData.
|
virtual |
Implements SdfAbstractData.
|
virtual |
Implements SdfAbstractData.
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 |
Implements SdfAbstractData.
|
virtual |
Implements SdfAbstractData.
|
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 |
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 |
Implements SdfAbstractData.
|
virtual |
SdfAbstractData overrides.
Implements SdfAbstractData.