24#ifndef PXR_USD_SDF_DATA_H
25#define PXR_USD_SDF_DATA_H
28#include "pxr/usd/sdf/api.h"
29#include "pxr/usd/sdf/abstractData.h"
30#include "pxr/usd/sdf/path.h"
32#include "pxr/base/tf/hashmap.h"
34#include "pxr/base/vt/value.h"
38PXR_NAMESPACE_OPEN_SCOPE
95 const TfToken& fieldName)
const;
109 virtual std::set<double>
110 ListAllTimeSamples()
const;
113 virtual std::set<double>
114 ListTimeSamplesForPath(
const SdfPath& path)
const;
118 GetBracketingTimeSamples(
double time,
double* tLower,
double* tUpper)
const;
122 GetNumTimeSamplesForPath(
const SdfPath& path)
const;
126 GetBracketingTimeSamplesForPath(
const SdfPath& path,
128 double* tLower,
double* tUpper)
const;
132 QueryTimeSample(
const SdfPath& path,
double time,
136 QueryTimeSample(
const SdfPath& path,
double time,
141 SetTimeSample(
const SdfPath& path,
double time,
146 EraseTimeSample(
const SdfPath& path,
double time);
169 typedef std::pair<TfToken, VtValue> _FieldValuePair;
171 _SpecData() : specType(SdfSpecTypeUnknown) {}
174 std::vector<_FieldValuePair> fields;
179 typedef SdfPath::Hash _KeyHash;
180 typedef TfHashMap<_Key, _SpecData, _KeyHash> _HashTable;
185PXR_NAMESPACE_CLOSE_SCOPE
A type-erased container for a const field value in an SdfAbstractData.
Interface for scene description data storage.
Base class for objects used to visit specs in an SdfAbstractData object.
A type-erased container for a field value in an SdfAbstractData.
SdfData provides concrete scene description data storage.
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 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 Set(const SdfPath &path, const TfToken &fieldName, const VtValue &value)
Set the value of the given path and fieldName.
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 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 VtValue Get(const SdfPath &path, const TfToken &fieldName) const
Return the value for the given path and fieldName.
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 bool StreamsData() const
SdfAbstractData overrides.
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 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 void CreateSpec(const SdfPath &path, SdfSpecType specType)
Create a new spec at path with the given specType.
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 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 SdfSpecType GetSpecType(const SdfPath &path) const
Return the spec type for the spec at path.
virtual SDF_API void _VisitSpecs(SdfAbstractDataSpecVisitor *visitor) const
Visits every spec in this SdfAbstractData object with the given visitor.
A path value used to locate objects in layers or scenegraphs.
Token for efficient comparison, assignment, and hashing of known strings.
Provides a container which may hold any type, and provides introspection and iteration over array typ...
Standard pointer typedefs.
#define TF_DECLARE_WEAK_AND_REF_PTRS(type)
Define standard weak, ref, and vector pointer types.
TfToken class for efficient string referencing and hashing, plus conversions to and from stl string c...
SdfSpecType
An enum that specifies the type of an object.