HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
abstractData.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the terms set forth in the LICENSE.txt file available at
5 // https://openusd.org/license.
6 //
7 #ifndef PXR_USD_SDF_ABSTRACT_DATA_H
8 #define PXR_USD_SDF_ABSTRACT_DATA_H
9 
10 #include "pxr/pxr.h"
11 #include "pxr/usd/sdf/path.h"
12 #include "pxr/usd/sdf/types.h"
13 
14 #include "pxr/base/vt/value.h"
15 
17 #include "pxr/base/tf/token.h"
18 #include "pxr/base/tf/refBase.h"
19 #include "pxr/base/tf/weakBase.h"
21 
22 #include <vector>
23 #include <type_traits>
24 
26 
31 
32 
33 #define SDF_DATA_TOKENS \
34  ((TimeSamples, "timeSamples"))
35 
37 
38 
39 /// \class SdfAbstractData
40 ///
41 /// Interface for scene description data storage.
42 ///
43 /// This is not a layer. SdfAbstractData is an anonymous container holding
44 /// scene description values. It is like an STL container, but specialized
45 /// for holding scene description.
46 ///
47 /// For any given SdfPath, an SdfAbstractData can hold one or more key/value
48 /// pairs which we call Fields. Most of the API on SdfAbstractData accesses
49 /// or modifies the value stored in a Field for a particular path and field
50 /// name.
51 ///
52 /// SdfAbstractData does not provide undo, change notification, or any strong
53 /// consistency guarantees about the scene description it contains.
54 /// Instead, it is a basis for building those things.
55 ///
56 class SdfAbstractData : public TfRefBase, public TfWeakBase
57 {
58 public:
60  SDF_API
61  virtual ~SdfAbstractData();
62 
63  /// Copy the data in \p source into this data object.
64  ///
65  /// The default implementation does a spec-by-spec, field-by-field
66  /// copy of \p source into this object.
67  SDF_API
68  virtual void CopyFrom(const SdfAbstractDataConstPtr& source);
69 
70  /// Returns true if this data object streams its data to and from its
71  /// serialized data store on demand.
72  ///
73  /// Sdf will treat layers with streaming data differently to avoid pulling
74  /// in data unnecessarily. For example, reloading a streaming layer
75  /// will not perform fine-grained change notification, since doing
76  /// so would require the full contents of the layer to be loaded.
77  SDF_API
78  virtual bool StreamsData() const = 0;
79 
80  /// Returns true if this data object is detached from its serialized
81  /// data store, false otherwise. A detached data object must not be
82  /// affected by external changes to the serialized data.
83  ///
84  /// Sdf allows clients to specify detached layers to avoid problems
85  /// that may occur if the underlying data is modified by an external
86  /// process. For example, a data object that maintains an open file
87  /// handle or memory mapping to the original layer on disk and reads
88  /// data on demand is not detached. But a data object that pulls all
89  /// of the layer contents into memory is detached.
90  ///
91  /// The default implementation returns !StreamsData(). Non-streaming
92  /// data objects are assumed to be detached from their serialized
93  /// data, while streaming objects are conservatively assumed to
94  /// not be detached. Note that it is possible to have a streaming
95  /// data object that is also detached -- for example, if the data
96  /// object were to make a private copy of the serialized data for
97  /// its own use and streamed data from it.
98  SDF_API
99  virtual bool IsDetached() const;
100 
101  /// Returns true if this data object has no specs, false otherwise.
102  ///
103  /// The default implementation uses a visitor to check if any specs
104  /// exist.
105  SDF_API
106  virtual bool IsEmpty() const;
107 
108  /// Returns true if this data object contains the same specs and fields
109  /// as \a lhs, false otherwise.
110  ///
111  /// The default implementation does a spec-by-spec, field-by-field
112  /// comparison.
113  // XXX: What are the right semantics for this?
114  // Does it matter if the underlying implementation matches?
115  SDF_API
116  virtual bool Equals(const SdfAbstractDataRefPtr &rhs) const;
117 
118  /// Writes the contents of this data object to \p out. This is primarily
119  /// for debugging purposes.
120  ///
121  /// The default implementation writes out each field for each spec.
122  SDF_API
123  virtual void WriteToStream(std::ostream& out) const;
124 
125  /// \name Spec API
126  /// @{
127 
128  /// Create a new spec at \a path with the given \a specType. If the spec
129  /// already exists the spec type will be changed.
130  SDF_API
131  virtual void CreateSpec(const SdfPath &path,
132  SdfSpecType specType) = 0;
133 
134  /// Return true if this data has a spec for \a path.
135  SDF_API
136  virtual bool HasSpec(const SdfPath &path) const = 0;
137 
138  /// Erase the spec at \a path and any fields that are on it.
139  /// Note that this does not erase child specs.
140  SDF_API
141  virtual void EraseSpec(const SdfPath &path) = 0;
142 
143  /// Move the spec at \a oldPath to \a newPath, including all the
144  /// fields that are on it. This does not move any child specs.
145  SDF_API
146  virtual void MoveSpec(const SdfPath &oldPath,
147  const SdfPath &newPath) = 0;
148 
149  /// Return the spec type for the spec at \a path. Returns SdfSpecTypeUnknown
150  /// if the spec doesn't exist.
151  virtual SdfSpecType GetSpecType(const SdfPath &path) const = 0;
152 
153  /// Visits every spec in this SdfAbstractData object with the given
154  /// \p visitor. The order in which specs are visited is undefined.
155  /// The visitor may not modify the SdfAbstractData object it is visiting.
156  /// \sa SdfAbstractDataSpecVisitor
157  SDF_API
158  void VisitSpecs(SdfAbstractDataSpecVisitor* visitor) const;
159 
160  /// @}
161 
162  /// \name Field API
163  /// @{
164 
165  /// Returns whether a value exists for the given \a path and \a fieldName.
166  /// Optionally returns the value if it exists.
167  SDF_API
168  virtual bool Has(const SdfPath& path, const TfToken& fieldName,
169  SdfAbstractDataValue* value) const = 0;
170 
171  /// Return whether a value exists for the given \a path and \a fieldName.
172  /// Optionally returns the value if it exists.
173  SDF_API
174  virtual bool Has(const SdfPath& path, const TfToken &fieldName,
175  VtValue *value = NULL) const = 0;
176 
177  /// Fill \p specType (which cannot be nullptr) as if by a call to
178  /// GetSpecType(path). If the resulting specType is not SdfSpecTypeUnknown,
179  /// then act as if Has(path, fieldName, value) was called and return its
180  /// result. In other words, the semantics of this function must be
181  /// identical to this sequence:
182  ///
183  /// \code
184  /// *specType = GetSpecType(path);
185  /// return *specType != SdfSpecTypeUnknown && Has(path, fieldName, value);
186  /// \endcode
187  SDF_API
188  virtual bool
189  HasSpecAndField(const SdfPath &path, const TfToken &fieldName,
190  SdfAbstractDataValue *value, SdfSpecType *specType) const;
191 
192  /// Fill \p specType (which cannot be nullptr) as if by a call to
193  /// GetSpecType(path). If the resulting specType is not SdfSpecTypeUnknown,
194  /// then act as if Has(path, fieldName, value) was called and return its
195  /// result. In other words, the semantics of this function must be
196  /// identical to this sequence:
197  ///
198  /// \code
199  /// *specType = GetSpecType(path);
200  /// return *specType != SdfSpecTypeUnknown && Has(path, fieldName, value);
201  /// \endcode
202  SDF_API
203  virtual bool
204  HasSpecAndField(const SdfPath &path, const TfToken &fieldName,
205  VtValue *value, SdfSpecType *specType) const;
206 
207  /// Return the value for the given \a path and \a fieldName. Returns an
208  /// empty value if none is set.
209  SDF_API
210  virtual VtValue Get(const SdfPath& path,
211  const TfToken& fieldName) const = 0;
212 
213  /// Return the type of the value for \p fieldName on spec \p path. If no
214  /// such field exists, return typeid(void). Derived classes may optionally
215  /// override this for performance. The base implementation is equivalent
216  /// to:
217  ///
218  /// \code
219  /// return Get(path, fieldName).GetTypeid();
220  /// \endcode
221  SDF_API
222  virtual std::type_info const &
223  GetTypeid(const SdfPath &path, const TfToken &fieldName) const;
224 
225  /// Set the value of the given \a path and \a fieldName.
226  ///
227  /// It's an error to set a field on a spec that does not exist. Setting a
228  /// field to an empty VtValue is the same as calling Erase() on it.
229  SDF_API
230  virtual void Set(const SdfPath &path, const TfToken &fieldName,
231  const VtValue &value) = 0;
232 
233  /// Set the value of the given \a path and \a fieldName.
234  ///
235  /// It's an error to set a field on a spec that does not exist.
236  SDF_API
237  virtual void Set(const SdfPath &path, const TfToken &fieldName,
238  const SdfAbstractDataConstValue& value) = 0;
239 
240  /// Remove the field at \p path and \p fieldName, if one exists.
241  SDF_API
242  virtual void Erase(const SdfPath& path,
243  const TfToken& fieldName) = 0;
244 
245  /// Return the names of all the fields that are set at \p path.
246  SDF_API
247  virtual std::vector<TfToken> List(const SdfPath& path) const = 0;
248 
249  /// Return the value for the given \a path and \a fieldName. Returns the
250  /// provided \a defaultValue value if none is set.
251  template <class T>
252  inline T GetAs(const SdfPath& path, const TfToken& fieldName,
253  const T& defaultValue = T()) const;
254 
255  /// @}
256 
257 
258  /// \name Dict key access API
259  /// @{
260 
261  // Return true and set \p value (if non null) if the field identified by
262  // \p path and \p fieldName is dictionary-valued, and if there is an element
263  // at \p keyPath in that dictionary. Return false otherwise. If
264  // \p keyPath names an entire sub-dictionary, set \p value to that entire
265  // sub-dictionary and return true.
266  SDF_API
267  virtual bool HasDictKey(const SdfPath& path,
268  const TfToken &fieldName,
269  const TfToken &keyPath,
270  SdfAbstractDataValue* value) const;
271  SDF_API
272  virtual bool HasDictKey(const SdfPath& path,
273  const TfToken &fieldName,
274  const TfToken &keyPath,
275  VtValue *value = NULL) const;
276 
277  // Same as HasDictKey but return empty VtValue on failure.
278  SDF_API
279  virtual VtValue GetDictValueByKey(const SdfPath& path,
280  const TfToken &fieldName,
281  const TfToken &keyPath) const;
282 
283  // Set the element at \p keyPath in the dictionary-valued field identified
284  // by \p path and \p fieldName. If the field itself is not
285  // dictionary-valued, replace the field with a new dictionary and set the
286  // element at \p keyPath in it. If \p value is empty, invoke
287  // EraseDictValueByKey instead.
288  SDF_API
289  virtual void SetDictValueByKey(const SdfPath& path,
290  const TfToken &fieldName,
291  const TfToken &keyPath,
292  const VtValue &value);
293  SDF_API
294  virtual void SetDictValueByKey(const SdfPath& path,
295  const TfToken &fieldName,
296  const TfToken &keyPath,
298 
299  // If \p path and \p fieldName identify a dictionary-valued field with an
300  // element at \p keyPath, remove that element from the dictionary. If this
301  // leaves the dictionary empty, Erase() the entire field.
302  SDF_API
303  virtual void EraseDictValueByKey(const SdfPath& path,
304  const TfToken &fieldName,
305  const TfToken &keyPath);
306 
307  // If \p path, \p fieldName, and \p keyPath identify a (sub) dictionary,
308  // return a vector of the keys in that dictionary, otherwise return an empty
309  // vector.
310  SDF_API
311  virtual std::vector<TfToken> ListDictKeys(const SdfPath& path,
312  const TfToken &fieldName,
313  const TfToken &keyPath) const;
314 
315 
316  /// @}
317 
318 
319  /// \name Time-sample API
320  ///
321  /// This API supports narrowly-targeted queries against the
322  /// "timeSamples" key of properties. In particular, it enables
323  /// asking for single time samples without pulling on the entire
324  /// set of time samples, as well as asking about the set of sample
325  /// times without pulling on the actual values at those times.
326  ///
327  /// @{
328 
329  SDF_API
330  virtual std::set<double>
331  ListAllTimeSamples() const = 0;
332 
333  SDF_API
334  virtual std::set<double>
335  ListTimeSamplesForPath(const SdfPath& path) const = 0;
336 
337  SDF_API
338  virtual bool
339  GetBracketingTimeSamples(double time, double* tLower,
340  double* tUpper) const = 0;
341 
342  SDF_API
343  virtual size_t
344  GetNumTimeSamplesForPath(const SdfPath& path) const = 0;
345 
346  SDF_API
347  virtual bool
349  double time,
350  double* tLower, double* tUpper) const = 0;
351 
352  /// Returns the previous time sample authored just before the querying \p
353  /// time.
354  ///
355  /// If there is no time sample authored just before \p time, this function
356  /// returns false. Otherwise, it returns true and sets \p tPrevious to the
357  /// time of the previous sample.
358  ///
359  /// \note The base class implementation provides an inefficient
360  /// implementation by searching for bracketing time samples twice, if
361  /// \p time happens to land on an authored time sample. Its recommended to
362  /// override this method with a more efficient implementation catering to
363  /// the specific data representation.
364  SDF_API
365  virtual bool
366  GetPreviousTimeSampleForPath(const SdfPath& path, double time,
367  double* tPrevious) const;
368 
369  SDF_API
370  virtual bool
371  QueryTimeSample(const SdfPath& path, double time,
372  VtValue *optionalValue = NULL) const = 0;
373  SDF_API
374  virtual bool
375  QueryTimeSample(const SdfPath& path, double time,
376  SdfAbstractDataValue *optionalValue) const = 0;
377 
378  SDF_API
379  virtual void
380  SetTimeSample(const SdfPath& path, double time,
381  const VtValue & value) = 0;
382 
383  SDF_API
384  virtual void
385  EraseTimeSample(const SdfPath& path, double time) = 0;
386 
387  /// @}
388 
389 protected:
390  /// Visits every spec in this SdfAbstractData object with the given
391  /// \p visitor. The order in which specs are visited is undefined.
392  /// The visitor may not modify the SdfAbstractData object it is visiting.
393  /// This method should \b not call \c Done() on the visitor.
394  /// \sa SdfAbstractDataSpecVisitor
395  SDF_API
396  virtual void _VisitSpecs(SdfAbstractDataSpecVisitor* visitor) const = 0;
397 };
398 
399 template <class T>
401  const SdfPath& path,
402  const TfToken& field, const T& defaultVal) const
403 {
404  VtValue val = Get(path, field);
405  if (val.IsHolding<T>()) {
406  return val.UncheckedGet<T>();
407  }
408  return defaultVal;
409 }
410 
411 /// \class SdfAbstractDataValue
412 ///
413 /// A type-erased container for a field value in an SdfAbstractData.
414 ///
415 /// \sa SdfAbstractDataTypedValue
417 {
418 public:
419  template <class T>
420  bool StoreValue(T &&v)
421  {
422  // this can be std::remove_cvref_t in c++20.
423  using Type = std::remove_cv_t<std::remove_reference_t<T>>;
424 
425  if constexpr (std::is_same_v<Type, VtValue>) {
426  return _StoreVtValue(std::forward<T>(v));
427  }
428 
429  isValueBlock = false;
430  typeMismatch = false;
431  if constexpr (std::is_same_v<Type, SdfValueBlock>) {
432  isValueBlock = true;
433  return true;
434  }
435  if (TfSafeTypeCompare(typeid(Type), valueType)) {
436  *static_cast<Type*>(value) = std::forward<T>(v);
437  return true;
438  }
439  typeMismatch = true;
440  return false;
441  }
442 
443  void* value;
444  const std::type_info& valueType;
447 
448 protected:
449  SdfAbstractDataValue(void* value_, const std::type_info& valueType_)
450  : value(value_)
451  , valueType(valueType_)
452  , isValueBlock(false)
453  , typeMismatch(false)
454  { }
455 
456 private:
457  virtual bool _StoreVtValue(const VtValue& value) = 0;
458  virtual bool _StoreVtValue(VtValue &&value) = 0;
459 };
460 
461 /// \class SdfAbstractDataTypedValue
462 ///
463 /// The fully-typed container for a field value in an \c SdfAbstractData.
464 /// An \c SdfAbstractDataTypedValue allows a consumer to pass a pointer to
465 /// an object through the virtual \c SdfAbstractData interface along with
466 /// information about that object's type. That information may allow
467 /// implementations of \c SdfAbstractData to populate the contained object
468 /// in a more efficient way, avoiding unnecessary boxing/unboxing of data.
469 ///
470 /// SdfAbstractDataTypedValue objects are intended to be transient; they
471 /// are solely used to get pointer information into and out of an
472 /// SdfAbstractData container.
473 ///
474 template <class T>
476 {
477 public:
479  : SdfAbstractDataValue(value, typeid(T))
480  { }
481 
482 private:
483  T const &_Get(const VtValue &v) {
484  return v.UncheckedGet<T>();
485  }
486 
487  T _Get(VtValue &&v) {
488  return v.UncheckedRemove<T>();
489  }
490 
491  template <class Value>
492  bool _StoreVtValueImpl(Value &&v) {
493  typeMismatch = false;
494  isValueBlock = false;
495  if (ARCH_LIKELY(std::forward<Value>(v).template IsHolding<T>())) {
496  *static_cast<T*>(value) = _Get(std::forward<Value>(v));
497  if (std::is_same_v<T, SdfValueBlock>) {
498  isValueBlock = true;
499  }
500  return true;
501  }
502 
503  if (std::forward<Value>(v).template IsHolding<SdfValueBlock>()) {
504  isValueBlock = true;
505  return true;
506  }
507 
508  typeMismatch = true;
509 
510  return false;
511  }
512 
513  virtual bool
514  _StoreVtValue(const VtValue& v) override {
515  return _StoreVtValueImpl(v);
516  }
517 
518  virtual bool
519  _StoreVtValue(VtValue &&v) override {
520  return _StoreVtValueImpl(v);
521  }
522 };
523 
524 /// \class SdfAbstractDataConstValue
525 ///
526 /// A type-erased container for a const field value in an SdfAbstractData.
527 ///
528 /// \sa SdfAbstractDataConstTypedValue
530 {
531 public:
532  virtual bool GetValue(VtValue* value) const = 0;
533 
534  template <class T> bool GetValue(T* v) const
535  {
536  if (TfSafeTypeCompare(typeid(T), valueType)) {
537  *v = *static_cast<const T*>(value);
538  return true;
539  }
540  return false;
541  }
542 
543  virtual bool IsEqual(const VtValue& value) const = 0;
544 
545  const void* value;
546  const std::type_info& valueType;
547 
548 protected:
549  SdfAbstractDataConstValue(const void* value_,
550  const std::type_info& valueType_)
551  : value(value_)
552  , valueType(valueType_)
553  {
554  }
555 };
556 
557 /// \class SdfAbstractDataConstTypedValue
558 ///
559 /// The fully-typed container for a field value in an \c SdfAbstractData.
560 /// An \c SdfAbstractDataConstTypedValue allows a consumer to pass a pointer to
561 /// an object through the virtual \c SdfAbstractData interface along with
562 /// information about that object's type. That information may allow
563 /// implementations of \c SdfAbstractData to store the contained object
564 /// in a more efficient way, avoiding unnecessary boxing/unboxing of data.
565 ///
566 /// SdfAbstractDataConstTypedValue objects are intended to be transient; they
567 /// are solely used to get pointer information into an SdfAbstractData
568 /// container.
569 ///
570 template <class T>
572 {
573 public:
575  : SdfAbstractDataConstValue(value, typeid(T))
576  { }
577 
578  virtual bool GetValue(VtValue* v) const
579  {
580  *v = _GetValue();
581  return true;
582  }
583 
584  virtual bool IsEqual(const VtValue& v) const
585  {
586  return (v.IsHolding<T>() && v.UncheckedGet<T>() == _GetValue());
587  }
588 
589 private:
590  const T& _GetValue() const
591  {
592  return *static_cast<const T*>(value);
593  }
594 };
595 
596 // Specialization of SdAbstractDataConstTypedValue that converts character
597 // arrays to std::string.
598 template <int N>
600  : public SdfAbstractDataConstTypedValue<std::string>
601 {
602 public:
603  typedef char CharArray[N];
606  , _str(*value)
607  { }
608 
609 private:
610  std::string _str;
611 };
612 
613 /// \class SdfAbstractDataSpecVisitor
614 ///
615 /// Base class for objects used to visit specs in an SdfAbstractData object.
616 ///
617 /// \sa SdfAbstractData::VisitSpecs.
619 {
620 public:
621  SDF_API
622  virtual ~SdfAbstractDataSpecVisitor();
623 
624  /// \c SdfAbstractData::VisitSpecs calls this function for every entry it
625  /// contains, passing itself as \p data and the entry's \p path. Return
626  /// false to stop iteration early, true to continue.
627  SDF_API
628  virtual bool VisitSpec(const SdfAbstractData& data,
629  const SdfPath& path) = 0;
630 
631  /// \c SdfAbstractData::VisitSpecs will call this after visitation is
632  /// complete, even if some \c VisitSpec() returned \c false.
633  SDF_API
634  virtual void Done(const SdfAbstractData& data) = 0;
635 };
636 
638 
639 #endif // PXR_USD_SDF_ABSTRACT_DATA_H
#define ARCH_LIKELY(x)
Definition: hints.h:29
virtual bool GetValue(VtValue *v) const
Definition: abstractData.h:578
virtual SDF_API bool IsEmpty() const
virtual SDF_API std::vector< TfToken > ListDictKeys(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath) const
SdfAbstractDataConstTypedValue(const CharArray *value)
Definition: abstractData.h:604
PXR_NAMESPACE_OPEN_SCOPE TF_DECLARE_WEAK_AND_REF_PTRS(SdfAbstractData)
virtual SDF_API bool Has(const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value) const =0
T const & UncheckedGet() const &
Definition: value.h:1104
virtual SDF_API size_t GetNumTimeSamplesForPath(const SdfPath &path) const =0
virtual SDF_API void CopyFrom(const SdfAbstractDataConstPtr &source)
SdfAbstractDataConstValue(const void *value_, const std::type_info &valueType_)
Definition: abstractData.h:549
virtual SDF_API void CreateSpec(const SdfPath &path, SdfSpecType specType)=0
virtual SDF_API bool HasSpecAndField(const SdfPath &path, const TfToken &fieldName, SdfAbstractDataValue *value, SdfSpecType *specType) const
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:837
GLsizei const GLchar *const * string
Definition: glcorearb.h:814
GLsizei const GLfloat * value
Definition: glcorearb.h:824
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
virtual SDF_API ~SdfAbstractData()
virtual SDF_API bool HasDictKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, SdfAbstractDataValue *value) const
const std::type_info & valueType
Definition: abstractData.h:546
virtual SDF_API std::set< double > ListAllTimeSamples() const =0
virtual bool IsEqual(const VtValue &value) const =0
virtual SDF_API bool GetBracketingTimeSamplesForPath(const SdfPath &path, double time, double *tLower, double *tUpper) const =0
virtual SDF_API std::set< double > ListTimeSamplesForPath(const SdfPath &path) const =0
virtual SDF_API void WriteToStream(std::ostream &out) const
virtual SDF_API void EraseSpec(const SdfPath &path)=0
virtual SDF_API std::vector< TfToken > List(const SdfPath &path) const =0
Return the names of all the fields that are set at path.
T GetAs(const SdfPath &path, const TfToken &fieldName, const T &defaultValue=T()) const
Definition: abstractData.h:400
Definition: token.h:70
SDF_API void VisitSpecs(SdfAbstractDataSpecVisitor *visitor) const
virtual SDF_API VtValue Get(const SdfPath &path, const TfToken &fieldName) const =0
virtual SDF_API VtValue GetDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath) const
SdfAbstractDataValue(void *value_, const std::type_info &valueType_)
Definition: abstractData.h:449
virtual SDF_API void Erase(const SdfPath &path, const TfToken &fieldName)=0
Remove the field at path and fieldName, if one exists.
A generic, discriminated value, whose type may be queried dynamically.
Definition: Value.h:45
bool StoreValue(T &&v)
Definition: abstractData.h:420
SdfAbstractDataTypedValue(T *value)
Definition: abstractData.h:478
TF_DECLARE_PUBLIC_TOKENS(SdfDataTokens, SDF_API, SDF_DATA_TOKENS)
virtual SDF_API bool VisitSpec(const SdfAbstractData &data, const SdfPath &path)=0
virtual SDF_API bool IsDetached() const
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
virtual bool GetValue(VtValue *value) const =0
virtual SDF_API void EraseTimeSample(const SdfPath &path, double time)=0
virtual SDF_API bool Equals(const SdfAbstractDataRefPtr &rhs) const
virtual SDF_API bool StreamsData() const =0
Definition: path.h:273
virtual SDF_API bool GetBracketingTimeSamples(double time, double *tLower, double *tUpper) const =0
virtual SDF_API std::type_info const & GetTypeid(const SdfPath &path, const TfToken &fieldName) const
virtual SDF_API void Done(const SdfAbstractData &data)=0
virtual SDF_API bool QueryTimeSample(const SdfPath &path, double time, VtValue *optionalValue=NULL) const =0
virtual SDF_API void Set(const SdfPath &path, const TfToken &fieldName, const VtValue &value)=0
#define SDF_API
Definition: api.h:23
const std::type_info & valueType
Definition: abstractData.h:444
virtual SDF_API void EraseDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath)
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1425
bool GetValue(T *v) const
Definition: abstractData.h:534
SdfSpecType
Definition: types.h:68
virtual bool IsEqual(const VtValue &v) const
Definition: abstractData.h:584
bool IsHolding() const
Definition: value.h:1064
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
GA_API const UT_StringHolder N
virtual SDF_API void _VisitSpecs(SdfAbstractDataSpecVisitor *visitor) const =0
#define SDF_DATA_TOKENS
Definition: abstractData.h:33
virtual SDF_API void SetDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath, const VtValue &value)
virtual SDF_API void MoveSpec(const SdfPath &oldPath, const SdfPath &newPath)=0
virtual SDF_API void SetTimeSample(const SdfPath &path, double time, const VtValue &value)=0
PXR_NAMESPACE_OPEN_SCOPE bool TfSafeTypeCompare(const std::type_info &t1, const std::type_info &t2)
virtual SDF_API bool HasSpec(const SdfPath &path) const =0
Return true if this data has a spec for path.
SdfAbstractDataConstTypedValue(const T *value)
Definition: abstractData.h:574
virtual SDF_API ~SdfAbstractDataSpecVisitor()
virtual SDF_API bool GetPreviousTimeSampleForPath(const SdfPath &path, double time, double *tPrevious) const
Definition: value.h:146
Definition: format.h:1821
virtual SdfSpecType GetSpecType(const SdfPath &path) const =0