HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
listProxy.h
Go to the documentation of this file.
1 //
2 // Copyright 2016 Pixar
3 //
4 // Licensed under the Apache License, Version 2.0 (the "Apache License")
5 // with the following modification; you may not use this file except in
6 // compliance with the Apache License and the following modification to it:
7 // Section 6. Trademarks. is deleted and replaced with:
8 //
9 // 6. Trademarks. This License does not grant permission to use the trade
10 // names, trademarks, service marks, or product names of the Licensor
11 // and its affiliates, except as required to comply with Section 4(c) of
12 // the License and to reproduce the content of the NOTICE file.
13 //
14 // You may obtain a copy of the Apache License at
15 //
16 // http://www.apache.org/licenses/LICENSE-2.0
17 //
18 // Unless required by applicable law or agreed to in writing, software
19 // distributed under the Apache License with the above modification is
20 // distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
21 // KIND, either express or implied. See the Apache License for the specific
22 // language governing permissions and limitations under the Apache License.
23 //
24 #ifndef PXR_USD_SDF_LIST_PROXY_H
25 #define PXR_USD_SDF_LIST_PROXY_H
26 
27 /// \file sdf/listProxy.h
28 
29 #include "pxr/pxr.h"
30 #include "pxr/usd/sdf/allowed.h"
31 #include "pxr/usd/sdf/listEditor.h"
32 #include "pxr/usd/sdf/listOp.h"
33 #include "pxr/usd/sdf/path.h"
34 
35 #include "pxr/base/tf/diagnostic.h"
36 #include "pxr/base/tf/errorMark.h"
37 #include "pxr/base/tf/iterator.h"
38 #include <hboost/iterator/iterator_facade.hpp>
39 #include <hboost/iterator/reverse_iterator.hpp>
40 #include <hboost/optional.hpp>
41 
42 #include <memory>
43 #include <type_traits>
44 
46 
47 /// \class SdfListProxy
48 ///
49 /// Represents a single list of list editing operations.
50 ///
51 /// An SdfListProxy represents a single list of list editing operations, making
52 /// it look like an STL vector (modeling a random access container and back
53 /// insertion sequence).
54 ///
55 template <class _TypePolicy>
56 class SdfListProxy {
57 public:
58  typedef _TypePolicy TypePolicy;
61  typedef std::vector<value_type> value_vector_type;
62 
63 private:
64  // Proxies an item in a list editor list.
65  class _ItemProxy {
66  public:
67  explicit _ItemProxy(This* owner, size_t index) :
68  _owner(owner), _index(index)
69  {
70  // Do nothing
71  }
72 
73  _ItemProxy& operator=(const _ItemProxy& x) {
74  _owner->_Edit(_index, 1, value_vector_type(1, x));
75  return *this;
76  }
77 
78  _ItemProxy& operator=(const value_type& x) {
79  _owner->_Edit(_index, 1, value_vector_type(1, x));
80  return *this;
81  }
82 
83  operator value_type() const {
84  return _owner->_Get(_index);
85  }
86 
87  // Operators rely on implicit conversion to value_type
88  // for comparing two _ItemProxy instances
89  bool operator==(const value_type& x) const {
90  return _owner->_Get(_index) == x;
91  }
92 
93  bool operator!=(const value_type& x) const {
94  return !(*this == x);
95  }
96 
97  bool operator<(const value_type& x) const {
98  return _owner->_Get(_index) < x;
99  }
100 
101  bool operator>(const value_type& x) const {
102  return x < value_type(*this);
103  }
104 
105  bool operator>=(const value_type& x) const {
106  return !(*this < x);
107  }
108 
109  bool operator<=(const value_type& x) const {
110  return !(x < value_type(*this));
111  }
112 
113  private:
114  This* _owner;
115  size_t _index;
116  };
117  friend class _ItemProxy;
118 
119  class _GetHelper {
120  public:
121  typedef _ItemProxy result_type;
122 
123  result_type operator()(This* owner, size_t index) const {
124  return _ItemProxy(owner, index);
125  }
126  };
127  class _ConstGetHelper {
128  public:
129  typedef value_type result_type;
130 
131  result_type operator()(const This* owner, size_t index) const {
132  return owner->_Get(index);
133  }
134  };
135  friend class _GetHelper;
136  friend class _ConstGetHelper;
137 
138  template <class Owner, class GetItem>
139  class _Iterator :
140  public hboost::iterator_facade<
141  _Iterator<Owner, GetItem>,
142  std::remove_cv_t<
143  std::remove_reference_t<
144  typename GetItem::result_type
145  >
146  >,
147  std::random_access_iterator_tag,
148  typename GetItem::result_type> {
149  public:
150  typedef _Iterator<Owner, GetItem> This;
151  typedef
152  hboost::iterator_facade<
153  _Iterator<Owner, GetItem>,
154  std::remove_cv_t<
156  typename GetItem::result_type
157  >
158  >,
159  std::random_access_iterator_tag,
160  typename GetItem::result_type> Parent;
161  typedef typename Parent::reference reference;
162  typedef typename Parent::difference_type difference_type;
163 
164  _Iterator() : _owner(NULL), _index(0)
165  {
166  // Do nothing
167  }
168 
169  _Iterator(Owner owner, size_t index) : _owner(owner), _index(index)
170  {
171  // Do nothing
172  }
173 
174  private:
175  friend class hboost::iterator_core_access;
176 
177  reference dereference() const {
178  return _getItem(_owner, _index);
179  }
180 
181  bool equal(const This& other) const {
182  if (_owner != other._owner) {
183  TF_CODING_ERROR("Comparing SdfListProxy iterators from "
184  "different proxies!");
185  return false;
186  }
187  return _index == other._index;
188  }
189 
190  void increment() {
191  ++_index;
192  }
193 
194  void decrement() {
195  --_index;
196  }
197 
198  void advance(difference_type n) {
199  _index += n;
200  }
201 
202  difference_type distance_to(const This& other) const {
203  return other._index - _index;
204  }
205 
206  private:
207  GetItem _getItem;
208  Owner _owner;
209  size_t _index;
210  };
211 
212 public:
214  typedef _Iterator<This*, _GetHelper> iterator;
215  typedef _Iterator<const This*, _ConstGetHelper> const_iterator;
216  typedef hboost::reverse_iterator<iterator> reverse_iterator;
217  typedef hboost::reverse_iterator<const_iterator> const_reverse_iterator;
218 
219  /// Creates a default list proxy object for list operation vector specified
220  /// \p op. This object evaluates to false in a boolean context and all
221  /// operations on this object have no effect.
223  _op(op)
224  {
225  }
226 
227  /// Create a new proxy wrapping the list operation vector specified by
228  /// \p op in the underlying \p listEditor.
229  SdfListProxy(const std::shared_ptr<Sdf_ListEditor<TypePolicy> >& editor,
230  SdfListOpType op) :
231  _listEditor(editor),
232  _op(op)
233  {
234  }
235 
236  /// Return an iterator to the start of the sequence.
238  return iterator(_GetThis(), 0);
239  }
240  /// Return an iterator to the end of the sequence.
242  return iterator(_GetThis(), _GetSize());
243  }
244 
245  /// Return a reverse iterator to the last item of the sequence.
247  return reverse_iterator(end());
248  }
249  /// Return a reverse iterator past the start item of the sequence.
251  return reverse_iterator(begin());
252  }
253 
254  /// Return a const iterator to the start of the sequence.
256  return const_iterator(_GetThis(), 0);
257  }
258  /// Return a const iterator to the end of the sequence.
259  const_iterator end() const {
260  return const_iterator(_GetThis(), _GetSize());
261  }
262 
263  /// Return a const reverse iterator to the last item of the sequence.
265  return const_reverse_iterator(end());
266  }
267  /// Return a const reverse iterator past the start item of the
268  /// sequence.
270  return const_reverse_iterator(begin());
271  }
272 
273  /// Return the size of the sequence.
274  size_t size() const {
275  return _Validate() ? _GetSize() : 0;
276  }
277 
278  /// Return true if size() == 0.
279  bool empty() const {
280  return size() == 0;
281  }
282 
283  /// Return a \p reference to the item at index \p n.
285  return reference(_GetThis(), n);
286  }
287 
288  /// Return a copy of the item at index \p n.
289  value_type operator[](size_t n) const {
290  return _Get(n);
291  }
292 
293  /// Return a \p reference to the item at the front of the sequence.
295  return reference(_GetThis(), 0);
296  }
297 
298  /// Return a \p reference to the item at the back of the sequence.
300  return reference(_GetThis(), _GetSize() - 1);
301  }
302 
303  /// Return a copy of the item at the front of the sequence.
304  value_type front() const {
305  return _Get(0);
306  }
307 
308  /// Return a copy of the item at the back of the sequence.
309  value_type back() const {
310  return _Get(_GetSize() - 1);
311  }
312 
313  /// Append \p elem to this sequence.
314  void push_back(const value_type& elem) {
315  _Edit(_GetSize(), 0, value_vector_type(1, elem));
316  }
317 
318  /// Remove the last element from this sequence.
319  void pop_back() {
320  _Edit(_GetSize() - 1, 1, value_vector_type());
321  }
322 
323  /// Insert \p x into this sequence at position \p pos.
325  _Edit(pos - iterator(this, 0), 0, value_vector_type(1, x));
326  return pos;
327  }
328 
329  /// Insert copies of the elements in [\p f, \p l) into this sequence
330  /// starting at position \p pos.
331  template <class InputIterator>
332  void insert(iterator pos, InputIterator f, InputIterator l) {
333  _Edit(pos - iterator(this, 0), 0, value_vector_type(f, l));
334  }
335 
336  /// Erase the element at \p pos.
337  void erase(iterator pos) {
338  _Edit(pos - iterator(this, 0), 1, value_vector_type());
339  }
340 
341  /// Erase all the elements in the range [\p f, \p l).
343  _Edit(f - iterator(this, 0), l - f, value_vector_type());
344  }
345 
346  /// Clear the contents of the sequence.
347  void clear() {
348  _Edit(0, _GetSize(), value_vector_type());
349  }
350 
351  /// Resize the contents of the sequence.
352  ///
353  /// Inserts or erases copies of \p t at the end
354  /// such that the size becomes \p n.
355  void resize(size_t n, const value_type& t = value_type()) {
356  size_t s = _GetSize();
357  if (n > s) {
358  _Edit(s, 0, value_vector_type(n - s, t));
359  }
360  else if (n < s) {
361  _Edit(n, s - n, value_vector_type());
362  }
363  }
364 
365  /// Produce a copy of the contents of this sequence into a vector.
366  operator value_vector_type() const {
367  return _listEditor ? _listEditor->GetVector(_op) : value_vector_type();
368  }
369 
370  /// Replace all elements in this sequence with the elements in
371  /// the \p other sequence.
372  template <class T2>
373  This& operator=(const SdfListProxy<T2>& other) {
374  _Edit(0, _GetSize(), static_cast<value_vector_type>(other));
375  return *this;
376  }
377 
378  /// Replace all elements in this sequence with the given vector.
380  _Edit(0, _GetSize(), other);
381  return *this;
382  }
383 
384  /// Replace all elements in this sequence with the given vector.
385  template <class Y>
386  This& operator=(const std::vector<Y>& v) {
387  _Edit(0, _GetSize(), value_vector_type(v.begin(), v.end()));
388  return *this;
389  }
390 
391  /// Equality comparison.
392  template <class T2>
393  bool operator==(const SdfListProxy<T2>& y) const {
394  return value_vector_type(*this) == value_vector_type(y);
395  }
396 
397  /// Inequality comparison.
398  template <class T2>
399  bool operator!=(const SdfListProxy<T2>& y) const {
400  return !(*this == y);
401  }
402 
403  /// Less-than comparison.
404  template <class T2>
405  bool operator<(const SdfListProxy<T2>& y) const {
406  return value_vector_type(*this) < value_vector_type(y);
407  }
408 
409  /// Less-than-or-equal comparison.
410  template <class T2>
411  bool operator<=(const SdfListProxy<T2>& y) const {
412  return value_vector_type(*this) <= value_vector_type(y);
413  }
414 
415  /// Greater-than comparison.
416  template <class T2>
417  bool operator>(const SdfListProxy<T2>& y) const {
418  return !(*this <= y);
419  }
420 
421  /// Greater-than-or-equal comparison.
422  template <class T2>
423  bool operator>=(const SdfListProxy<T2>& y) const {
424  return !(*this < y);
425  }
426 
427  /// Equality comparison.
428  bool operator==(const value_vector_type& y) const {
429  return value_vector_type(*this) == y;
430  }
431 
432  /// Equality comparision
433  friend bool operator==(const value_vector_type& x, const SdfListProxy& y) {
434  return y == x;
435  }
436 
437  /// Inequality comparison.
438  bool operator!=(const value_vector_type& y) const {
439  return !(*this == y);
440  }
441 
442  /// Inequality comparision
443  friend bool operator!=(const value_vector_type& x, const SdfListProxy& y) {
444  return y != x;
445  }
446 
447  /// Less-than comparison.
448  bool operator<(const value_vector_type& y) const {
449  return value_vector_type(*this) < y;
450  }
451 
452  /// Less-than comparison
453  friend bool operator<(const value_vector_type& x, const SdfListProxy& y) {
454  return x < value_vector_type(y);
455  }
456 
457  /// Greater-than comparison.
458  bool operator>(const value_vector_type& y) const {
459  return value_vector_type(*this) > y;
460  }
461 
462  /// Greater-than comparison.
463  friend bool operator>(const value_vector_type& x, const SdfListProxy& y) {
464  return x > value_vector_type(y);
465  }
466 
467  /// Less-than or equal to comparison.
468  bool operator<=(const value_vector_type& y) const {
469  return !(*this > y);
470  }
471 
472  /// Less-than or equal to comparison.
473  friend bool operator<=(const value_vector_type& x, const SdfListProxy& y) {
474  return x <= value_vector_type(y);
475  }
476 
477  /// Greater-than or equal to comparison.
478  bool operator>=(const value_vector_type& y) const {
479  return !(*this < y);
480  }
481 
482  /// Greater-than or equal to comparison.
483  friend bool operator>=(const value_vector_type& x, const SdfListProxy& y) {
484  return x >= value_vector_type(y);
485  }
486 
487  /// Explicit bool conversion operator. The list proxy object converts to
488  /// \c true if the list editor is valid, \c false otherwise.
489  explicit operator bool() const
490  {
491  return _listEditor && _listEditor->IsValid() && _IsRelevant();
492  }
493 
494  // Extensions
495 
496  /// Returns the layer that this list editor belongs to.
497  SdfLayerHandle GetLayer() const
498  {
499  return _listEditor ? _listEditor->GetLayer() : SdfLayerHandle();
500  }
501 
502  /// Returns the path to this list editor's value.
503  SdfPath GetPath() const
504  {
505  return _listEditor ? _listEditor->GetPath() : SdfPath();
506  }
507 
508  /// Returns true if the list editor is expired.
509  bool IsExpired() const
510  {
511  return _listEditor && _listEditor->IsExpired();
512  }
513 
514  size_t Count(const value_type& value) const
515  {
516  return (_Validate() ? _listEditor->Count(_op, value) : 0);
517  }
518 
519  size_t Find(const value_type& value) const
520  {
521  return (_Validate() ? _listEditor->Find(_op, value) : size_t(-1));
522  }
523 
524  void Insert(int index, const value_type& value)
525  {
526  if (index == -1) {
527  index = static_cast<int>(_GetSize());
528  }
529  _Edit(index, 0, value_vector_type(1, value));
530  }
531 
532  void Remove(const value_type& value)
533  {
534  size_t index = Find(value);
535  if (index != size_t(-1)) {
536  Erase(index);
537  }
538  else {
539  // Allow policy to raise an error even though we're not
540  // doing anything.
541  _Edit(_GetSize(), 0, value_vector_type());
542  }
543  }
544 
545  void Replace(const value_type& oldValue, const value_type& newValue)
546  {
547  size_t index = Find(oldValue);
548  if (index != size_t(-1)) {
549  _Edit(index, 1, value_vector_type(1, newValue));
550  }
551  else {
552  // Allow policy to raise an error even though we're not
553  // doing anything.
554  _Edit(_GetSize(), 0, value_vector_type());
555  }
556  }
557 
558  void Erase(size_t index)
559  {
560  _Edit(index, 1, value_vector_type());
561  }
562 
563  /// Applies the edits in the given list to this one.
564  void ApplyList(const SdfListProxy &list)
565  {
566  if (_Validate() && list._Validate()) {
567  _listEditor->ApplyList(_op, *list._listEditor);
568  }
569  }
570 
571  /// Apply the edits in this list to the given \p vec.
573  {
574  if (_Validate()) {
575  _listEditor->ApplyEditsToList(vec);
576  }
577  }
578 
579  /// Modify all edits in this list.
580  ///
581  /// \p callback must be a callable that accepts an argument of type
582  /// value_type and returns a hboost::optional<value_type>.
583  ///
584  /// \p callback is called with every item in the list. If an invalid
585  /// hboost::optional is returned, the item is removed. Otherwise it's
586  /// replaced with the returned item. If a returned item matches an
587  /// item that was previously returned, the returned item will be
588  /// removed.
589  template <class CB>
590  void ModifyItemEdits(CB callback)
591  {
592  if (_Validate()) {
593  _listEditor->ModifyItemEdits(std::forward<CB>(callback));
594  }
595  }
596 
597 private:
598  bool _Validate()
599  {
600  if (!_listEditor) {
601  return false;
602  }
603 
604  if (IsExpired()) {
605  TF_CODING_ERROR("Accessing expired list editor");
606  return false;
607  }
608  return true;
609  }
610 
611  bool _Validate() const
612  {
613  if (!_listEditor) {
614  return false;
615  }
616 
617  if (IsExpired()) {
618  TF_CODING_ERROR("Accessing expired list editor");
619  return false;
620  }
621  return true;
622  }
623 
624  This* _GetThis()
625  {
626  return _Validate() ? this : NULL;
627  }
628 
629  const This* _GetThis() const
630  {
631  return _Validate() ? this : NULL;
632  }
633 
634  bool _IsRelevant() const
635  {
636  if (_listEditor->IsExplicit()) {
637  return _op == SdfListOpTypeExplicit;
638  }
639  else if (_listEditor->IsOrderedOnly()) {
640  return _op == SdfListOpTypeOrdered;
641  }
642  else {
643  return _op != SdfListOpTypeExplicit;
644  }
645  }
646 
647  size_t _GetSize() const
648  {
649  return _listEditor ? _listEditor->GetSize(_op) : 0;
650  }
651 
652  value_type _Get(size_t n) const
653  {
654  return _Validate() ? _listEditor->Get(_op, n) : value_type();
655  }
656 
657  void _Edit(size_t index, size_t n, const value_vector_type& elems)
658  {
659  if (_Validate()) {
660  // Allow policy to raise an error even if we're not
661  // doing anything.
662  if (n == 0 && elems.empty()) {
663  SdfAllowed canEdit = _listEditor->PermissionToEdit(_op);
664  if (!canEdit) {
665  TF_CODING_ERROR("Editing list: %s",
666  canEdit.GetWhyNot().c_str());
667  }
668  return;
669  }
670 
671  bool valid =
672  _listEditor->ReplaceEdits(_op, index, n, elems);
673  if (!valid) {
674  TF_CODING_ERROR("Inserting invalid value into list editor");
675  }
676  }
677  }
678 
679 private:
680  std::shared_ptr<Sdf_ListEditor<TypePolicy> > _listEditor;
681  SdfListOpType _op;
682 
683  template <class> friend class SdfPyWrapListProxy;
684 };
685 
686 // Allow TfIteration over list proxies.
687 template <typename T>
688 struct Tf_ShouldIterateOverCopy<SdfListProxy<T> > : std::true_type
689 {
690 };
691 
693 
694 #endif // PXR_USD_SDF_LIST_PROXY_H
reverse_iterator rend()
Return a reverse iterator past the start item of the sequence.
Definition: listProxy.h:250
void resize(size_t n, const value_type &t=value_type())
Definition: listProxy.h:355
SdfLayerHandle GetLayer() const
Returns the layer that this list editor belongs to.
Definition: listProxy.h:497
bool operator==(const value_vector_type &y) const
Equality comparison.
Definition: listProxy.h:428
friend class _ItemProxy
Definition: listProxy.h:117
This & operator=(const value_vector_type &other)
Replace all elements in this sequence with the given vector.
Definition: listProxy.h:379
size_t size() const
Return the size of the sequence.
Definition: listProxy.h:274
const GLdouble * v
Definition: glcorearb.h:837
_Iterator< This *, _GetHelper > iterator
Definition: listProxy.h:214
std::vector< value_type > value_vector_type
Definition: listProxy.h:61
#define TF_CODING_ERROR
_Iterator< const This *, _ConstGetHelper > const_iterator
Definition: listProxy.h:215
hboost::reverse_iterator< iterator > reverse_iterator
Definition: listProxy.h:216
This & operator=(const std::vector< Y > &v)
Replace all elements in this sequence with the given vector.
Definition: listProxy.h:386
bool operator!=(const value_vector_type &y) const
Inequality comparison.
Definition: listProxy.h:438
GLdouble s
Definition: glad.h:3009
value_type front() const
Return a copy of the item at the front of the sequence.
Definition: listProxy.h:304
SdfListProxy(SdfListOpType op)
Definition: listProxy.h:222
bool empty() const
Return true if size() == 0.
Definition: listProxy.h:279
IMATH_HOSTDEVICE constexpr bool equal(T1 a, T2 b, T3 t) IMATH_NOEXCEPT
Definition: ImathFun.h:105
value_type operator[](size_t n) const
Return a copy of the item at index n.
Definition: listProxy.h:289
GLint y
Definition: glcorearb.h:103
void ApplyList(const SdfListProxy &list)
Applies the edits in the given list to this one.
Definition: listProxy.h:564
bool operator!=(const SdfListProxy< T2 > &y) const
Inequality comparison.
Definition: listProxy.h:399
void erase(iterator f, iterator l)
Erase all the elements in the range [f, l).
Definition: listProxy.h:342
hboost::reverse_iterator< const_iterator > const_reverse_iterator
Definition: listProxy.h:217
uint64 value_type
Definition: GA_PrimCompat.h:29
void pop_back()
Remove the last element from this sequence.
Definition: listProxy.h:319
friend bool operator==(const value_vector_type &x, const SdfListProxy &y)
Equality comparision.
Definition: listProxy.h:433
friend class _ConstGetHelper
Definition: listProxy.h:136
This & operator=(const SdfListProxy< T2 > &other)
Definition: listProxy.h:373
_ItemProxy reference
Definition: listProxy.h:213
SdfPath GetPath() const
Returns the path to this list editor's value.
Definition: listProxy.h:503
reference operator[](size_t n)
Return a reference to the item at index n.
Definition: listProxy.h:284
void push_back(const value_type &elem)
Append elem to this sequence.
Definition: listProxy.h:314
GLdouble n
Definition: glcorearb.h:2008
GLfloat f
Definition: glcorearb.h:1926
SDF_API const std::string & GetWhyNot() const
bool operator<(const SdfListProxy< T2 > &y) const
Less-than comparison.
Definition: listProxy.h:405
const_reverse_iterator rend() const
Definition: listProxy.h:269
SdfListOpType
Definition: listOp.h:47
iterator insert(iterator pos, const value_type &x)
Insert x into this sequence at position pos.
Definition: listProxy.h:324
const_reverse_iterator rbegin() const
Return a const reverse iterator to the last item of the sequence.
Definition: listProxy.h:264
void Insert(int index, const value_type &value)
Definition: listProxy.h:524
typename std::remove_reference< T >::type remove_reference_t
Definition: core.h:325
reference front()
Return a reference to the item at the front of the sequence.
Definition: listProxy.h:294
value_type back() const
Return a copy of the item at the back of the sequence.
Definition: listProxy.h:309
void Replace(const value_type &oldValue, const value_type &newValue)
Definition: listProxy.h:545
friend class _GetHelper
Definition: listProxy.h:135
bool operator>(const value_vector_type &y) const
Greater-than comparison.
Definition: listProxy.h:458
friend bool operator>=(const value_vector_type &x, const SdfListProxy &y)
Greater-than or equal to comparison.
Definition: listProxy.h:483
Definition: path.h:291
SdfListProxy(const std::shared_ptr< Sdf_ListEditor< TypePolicy > > &editor, SdfListOpType op)
Definition: listProxy.h:229
GLint GLenum GLint x
Definition: glcorearb.h:409
bool operator>=(const value_vector_type &y) const
Greater-than or equal to comparison.
Definition: listProxy.h:478
GLdouble t
Definition: glad.h:2397
void ApplyEditsToList(value_vector_type *vec)
Apply the edits in this list to the given vec.
Definition: listProxy.h:572
iterator begin()
Return an iterator to the start of the sequence.
Definition: listProxy.h:237
size_t Count(const value_type &value) const
Definition: listProxy.h:514
const_iterator begin() const
Return a const iterator to the start of the sequence.
Definition: listProxy.h:255
friend bool operator<=(const value_vector_type &x, const SdfListProxy &y)
Less-than or equal to comparison.
Definition: listProxy.h:473
friend bool operator>(const value_vector_type &x, const SdfListProxy &y)
Greater-than comparison.
Definition: listProxy.h:463
friend bool operator<(const value_vector_type &x, const SdfListProxy &y)
Less-than comparison.
Definition: listProxy.h:453
PXR_NAMESPACE_CLOSE_SCOPE PXR_NAMESPACE_OPEN_SCOPE
Definition: path.h:1441
bool operator<(const value_vector_type &y) const
Less-than comparison.
Definition: listProxy.h:448
void ModifyItemEdits(CB callback)
Definition: listProxy.h:590
GLuint index
Definition: glcorearb.h:786
reverse_iterator rbegin()
Return a reverse iterator to the last item of the sequence.
Definition: listProxy.h:246
reference back()
Return a reference to the item at the back of the sequence.
Definition: listProxy.h:299
bool operator<=(const value_vector_type &y) const
Less-than or equal to comparison.
Definition: listProxy.h:468
SdfListProxy< TypePolicy > This
Definition: listProxy.h:59
#define PXR_NAMESPACE_CLOSE_SCOPE
Definition: pxr.h:91
friend bool operator!=(const value_vector_type &x, const SdfListProxy &y)
Inequality comparision.
Definition: listProxy.h:443
TypePolicy::value_type value_type
Definition: listProxy.h:60
Definition: core.h:1131
bool operator>=(const SdfListProxy< T2 > &y) const
Greater-than-or-equal comparison.
Definition: listProxy.h:423
const_iterator end() const
Return a const iterator to the end of the sequence.
Definition: listProxy.h:259
void erase(iterator pos)
Erase the element at pos.
Definition: listProxy.h:337
void clear()
Clear the contents of the sequence.
Definition: listProxy.h:347
_TypePolicy TypePolicy
Definition: listProxy.h:58
bool IsExpired() const
Returns true if the list editor is expired.
Definition: listProxy.h:509
iterator end()
Return an iterator to the end of the sequence.
Definition: listProxy.h:241
bool operator<=(const SdfListProxy< T2 > &y) const
Less-than-or-equal comparison.
Definition: listProxy.h:411
void Erase(size_t index)
Definition: listProxy.h:558
bool operator==(const SdfListProxy< T2 > &y) const
Equality comparison.
Definition: listProxy.h:393
void insert(iterator pos, InputIterator f, InputIterator l)
Definition: listProxy.h:332
void Remove(const value_type &value)
Definition: listProxy.h:532
size_t Find(const value_type &value) const
Definition: listProxy.h:519
bool operator>(const SdfListProxy< T2 > &y) const
Greater-than comparison.
Definition: listProxy.h:417