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  /// If there is a time sample authored at \p time, return its value's
379  /// typeid(), otherwise return typeid(void).
380  ///
381  /// \note The base class provides an implementation in terms of
382  /// QueryTimeSample(path, time, VtValue *), returning VtValue::GetTypeid().
383  /// Consider overriding this member function if not fetching the VtValue
384  /// would be more performant.
385  SDF_API
386  virtual const std::type_info &
387  QueryTimeSampleTypeid(const SdfPath &path, double time) const;
388 
389  SDF_API
390  virtual void
391  SetTimeSample(const SdfPath& path, double time,
392  const VtValue & value) = 0;
393 
394  SDF_API
395  virtual void
396  EraseTimeSample(const SdfPath& path, double time) = 0;
397 
398  /// @}
399 
400 protected:
401  /// Visits every spec in this SdfAbstractData object with the given
402  /// \p visitor. The order in which specs are visited is undefined.
403  /// The visitor may not modify the SdfAbstractData object it is visiting.
404  /// This method should \b not call \c Done() on the visitor.
405  /// \sa SdfAbstractDataSpecVisitor
406  SDF_API
407  virtual void _VisitSpecs(SdfAbstractDataSpecVisitor* visitor) const = 0;
408 };
409 
410 template <class T>
412  const SdfPath& path,
413  const TfToken& field, const T& defaultVal) const
414 {
415  VtValue val = Get(path, field);
416  if (val.IsHolding<T>()) {
417  return val.UncheckedGet<T>();
418  }
419  return defaultVal;
420 }
421 
422 /// \class SdfAbstractDataValue
423 ///
424 /// A type-erased container for a field value in an SdfAbstractData.
425 ///
426 /// \sa SdfAbstractDataTypedValue
428 {
429 public:
430  template <class T>
431  bool StoreValue(T &&v)
432  {
433  // this can be std::remove_cvref_t in c++20.
434  using Type = std::remove_cv_t<std::remove_reference_t<T>>;
435 
436  if constexpr (std::is_same_v<Type, VtValue>) {
437  return _StoreVtValue(std::forward<T>(v));
438  }
439 
440  isValueBlock = false;
441  isAnimationBlock = false;
442  typeMismatch = false;
443  if constexpr (std::is_same_v<Type, SdfValueBlock>) {
444  isValueBlock = true;
445  return true;
446  } else if constexpr (std::is_same_v<Type, SdfAnimationBlock>) {
447  isAnimationBlock = true;
448  return true;
449  }
450  if (TfSafeTypeCompare(typeid(Type), valueType)) {
451  *static_cast<Type*>(value) = std::forward<T>(v);
452  return true;
453  }
454  typeMismatch = true;
455  return false;
456  }
457 
458  void* value;
459  const std::type_info& valueType;
463 
464 protected:
465  SdfAbstractDataValue(void* value_, const std::type_info& valueType_)
466  : value(value_)
467  , valueType(valueType_)
468  , isValueBlock(false)
469  , isAnimationBlock(false)
470  , typeMismatch(false)
471  { }
472 
473 private:
474  virtual bool _StoreVtValue(const VtValue& value) = 0;
475  virtual bool _StoreVtValue(VtValue &&value) = 0;
476 };
477 
478 /// \class SdfAbstractDataTypedValue
479 ///
480 /// The fully-typed container for a field value in an \c SdfAbstractData.
481 /// An \c SdfAbstractDataTypedValue allows a consumer to pass a pointer to
482 /// an object through the virtual \c SdfAbstractData interface along with
483 /// information about that object's type. That information may allow
484 /// implementations of \c SdfAbstractData to populate the contained object
485 /// in a more efficient way, avoiding unnecessary boxing/unboxing of data.
486 ///
487 /// SdfAbstractDataTypedValue objects are intended to be transient; they
488 /// are solely used to get pointer information into and out of an
489 /// SdfAbstractData container.
490 ///
491 template <class T>
493 {
494 public:
496  : SdfAbstractDataValue(value, typeid(T))
497  { }
498 
499 private:
500  T const &_Get(const VtValue &v) {
501  return v.UncheckedGet<T>();
502  }
503 
504  T _Get(VtValue &&v) {
505  return v.UncheckedRemove<T>();
506  }
507 
508  template <class Value>
509  bool _StoreVtValueImpl(Value &&v) {
510  typeMismatch = false;
511  isValueBlock = false;
512  isAnimationBlock = false;
513  if (ARCH_LIKELY(std::forward<Value>(v).template IsHolding<T>())) {
514  *static_cast<T*>(value) = _Get(std::forward<Value>(v));
515  if constexpr (std::is_same_v<T, SdfValueBlock>) {
516  isValueBlock = true;
517  } else if constexpr (std::is_same_v<T, SdfAnimationBlock>) {
518  isAnimationBlock = true;
519  }
520  return true;
521  }
522 
523  if (std::forward<Value>(v).template IsHolding<SdfValueBlock>()) {
524  isValueBlock = true;
525  return true;
526  }
527  else if (std::forward<Value>(v).template IsHolding<SdfAnimationBlock>())
528  {
529  isAnimationBlock = true;
530  return true;
531  }
532 
533  typeMismatch = true;
534 
535  return false;
536  }
537 
538  virtual bool
539  _StoreVtValue(const VtValue& v) override {
540  return _StoreVtValueImpl(v);
541  }
542 
543  virtual bool
544  _StoreVtValue(VtValue &&v) override {
545  return _StoreVtValueImpl(v);
546  }
547 };
548 
549 /// \class SdfAbstractDataConstValue
550 ///
551 /// A type-erased container for a const field value in an SdfAbstractData.
552 ///
553 /// \sa SdfAbstractDataConstTypedValue
555 {
556 public:
557  virtual bool GetValue(VtValue* value) const = 0;
558 
559  template <class T> bool GetValue(T* v) const
560  {
561  if (TfSafeTypeCompare(typeid(T), valueType)) {
562  *v = *static_cast<const T*>(value);
563  return true;
564  }
565  return false;
566  }
567 
568  virtual bool IsEqual(const VtValue& value) const = 0;
569 
570  const void* value;
571  const std::type_info& valueType;
572  const bool isArrayEdit;
573  const std::type_info& elementValueType; // void unless isArrayEdit
574 
575 protected:
576  SdfAbstractDataConstValue(const void* value_,
577  const std::type_info& valueType_,
578  const bool isArrayEdit_,
579  const std::type_info& elementValueType_)
580  : value(value_)
581  , valueType(valueType_)
582  , isArrayEdit(isArrayEdit_)
583  , elementValueType(elementValueType_)
584  {
585  }
586 };
587 
588 /// \class SdfAbstractDataConstTypedValue
589 ///
590 /// The fully-typed container for a field value in an \c SdfAbstractData.
591 /// An \c SdfAbstractDataConstTypedValue allows a consumer to pass a pointer to
592 /// an object through the virtual \c SdfAbstractData interface along with
593 /// information about that object's type. That information may allow
594 /// implementations of \c SdfAbstractData to store the contained object
595 /// in a more efficient way, avoiding unnecessary boxing/unboxing of data.
596 ///
597 /// SdfAbstractDataConstTypedValue objects are intended to be transient; they
598 /// are solely used to get pointer information into an SdfAbstractData
599 /// container.
600 ///
601 template <class T>
603 {
604 public:
605  static std::type_info const &_GetElementType() {
606  if constexpr (VtIsArrayEdit<T>::value) {
607  return typeid(typename T::ElementType);
608  }
609  else {
610  return typeid(void);
611  }
612  }
613 
616  value, typeid(T), VtIsArrayEdit<T>::value, this->_GetElementType())
617  {}
618 
619  virtual bool GetValue(VtValue* v) const
620  {
621  *v = _GetValue();
622  return true;
623  }
624 
625  virtual bool IsEqual(const VtValue& v) const
626  {
627  return (v.IsHolding<T>() && v.UncheckedGet<T>() == _GetValue());
628  }
629 
630 private:
631  const T& _GetValue() const
632  {
633  return *static_cast<const T*>(value);
634  }
635 };
636 
637 // Specialization of SdAbstractDataConstTypedValue that converts character
638 // arrays to std::string.
639 template <int N>
641  : public SdfAbstractDataConstTypedValue<std::string>
642 {
643 public:
644  typedef char CharArray[N];
647  , _str(*value)
648  { }
649 
650 private:
651  std::string _str;
652 };
653 
654 /// \class SdfAbstractDataSpecVisitor
655 ///
656 /// Base class for objects used to visit specs in an SdfAbstractData object.
657 ///
658 /// \sa SdfAbstractData::VisitSpecs.
660 {
661 public:
662  SDF_API
663  virtual ~SdfAbstractDataSpecVisitor();
664 
665  /// \c SdfAbstractData::VisitSpecs calls this function for every entry it
666  /// contains, passing itself as \p data and the entry's \p path. Return
667  /// false to stop iteration early, true to continue.
668  SDF_API
669  virtual bool VisitSpec(const SdfAbstractData& data,
670  const SdfPath& path) = 0;
671 
672  /// \c SdfAbstractData::VisitSpecs will call this after visitation is
673  /// complete, even if some \c VisitSpec() returned \c false.
674  SDF_API
675  virtual void Done(const SdfAbstractData& data) = 0;
676 };
677 
679 
680 #endif // PXR_USD_SDF_ABSTRACT_DATA_H
#define ARCH_LIKELY(x)
Definition: hints.h:29
virtual bool GetValue(VtValue *v) const
Definition: abstractData.h:619
virtual SDF_API bool IsEmpty() const
static std::type_info const & _GetElementType()
Definition: abstractData.h:605
virtual SDF_API std::vector< TfToken > ListDictKeys(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath) const
SdfAbstractDataConstTypedValue(const CharArray *value)
Definition: abstractData.h:645
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:1046
virtual SDF_API size_t GetNumTimeSamplesForPath(const SdfPath &path) const =0
virtual SDF_API void CopyFrom(const SdfAbstractDataConstPtr &source)
void
Definition: png.h:1083
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
#define PXR_NAMESPACE_OPEN_SCOPE
Definition: pxr.h:73
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
**But if you need a or simply need to know when the task has note that the like this
Definition: thread.h:626
const std::type_info & valueType
Definition: abstractData.h:571
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:411
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:465
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:431
SdfAbstractDataTypedValue(T *value)
Definition: abstractData.h:495
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
virtual SDF_API const std::type_info & QueryTimeSampleTypeid(const SdfPath &path, double time) const
Definition: path.h:280
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:459
virtual SDF_API void EraseDictValueByKey(const SdfPath &path, const TfToken &fieldName, const TfToken &keyPath)
bool GetValue(T *v) const
Definition: abstractData.h:559
SdfSpecType
Definition: types.h:71
virtual bool IsEqual(const VtValue &v) const
Definition: abstractData.h:625
bool IsHolding() const
Definition: value.h:1002
GLuint GLfloat * val
Definition: glcorearb.h:1608
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:74
GA_API const UT_StringHolder N
SdfAbstractDataConstValue(const void *value_, const std::type_info &valueType_, const bool isArrayEdit_, const std::type_info &elementValueType_)
Definition: abstractData.h:576
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
const std::type_info & elementValueType
Definition: abstractData.h:573
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:614
virtual SDF_API ~SdfAbstractDataSpecVisitor()
virtual SDF_API bool GetPreviousTimeSampleForPath(const SdfPath &path, double time, double *tPrevious) const
Definition: value.h:89
Definition: format.h:1821
virtual SdfSpecType GetSpecType(const SdfPath &path) const =0
A trait to detect instantiations of VtArrayEdit, specialized in arrayEdit.h.
Definition: traits.h:26