All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
SdfListProxy< _TypePolicy > Class Template Reference

Represents a single list of list editing operations. More...

#include <listProxy.h>

Public Types

typedef _TypePolicy TypePolicy
 
typedef SdfListProxy< TypePolicy > This
 
typedef TypePolicy::value_type value_type
 
typedef std::vector< value_type > value_vector_type
 
typedef _ItemProxy reference
 
typedef _Iterator< This *, _GetHelper > iterator
 
typedef _Iterator< const This *, _ConstGetHelper > const_iterator
 
typedef Tf_ProxyReferenceReverseIterator< iterator > reverse_iterator
 
typedef Tf_ProxyReferenceReverseIterator< const_iterator > const_reverse_iterator
 

Public Member Functions

 SdfListProxy (SdfListOpType op)
 Creates a default list proxy object for list operation vector specified op.
 
 SdfListProxy (const std::shared_ptr< Sdf_ListEditor< TypePolicy > > &editor, SdfListOpType op)
 Create a new proxy wrapping the list operation vector specified by op in the underlying listEditor.
 
iterator begin ()
 Return an iterator to the start of the sequence.
 
iterator end ()
 Return an iterator to the end of the sequence.
 
reverse_iterator rbegin ()
 Return a reverse iterator to the last item of the sequence.
 
reverse_iterator rend ()
 Return a reverse iterator past the start item of the sequence.
 
const_iterator begin () const
 Return a const iterator to the start of the sequence.
 
const_iterator end () const
 Return a const iterator to the end of the sequence.
 
const_reverse_iterator rbegin () const
 Return a const reverse iterator to the last item of the sequence.
 
const_reverse_iterator rend () const
 Return a const reverse iterator past the start item of the sequence.
 
size_t size () const
 Return the size of the sequence.
 
bool empty () const
 Return true if size() == 0.
 
reference operator[] (size_t n)
 Return a reference to the item at index n.
 
value_type operator[] (size_t n) const
 Return a copy of the item at index n.
 
reference front ()
 Return a reference to the item at the front of the sequence.
 
reference back ()
 Return a reference to the item at the back of the sequence.
 
value_type front () const
 Return a copy of the item at the front of the sequence.
 
value_type back () const
 Return a copy of the item at the back of the sequence.
 
void push_back (const value_type &elem)
 Append elem to this sequence.
 
void pop_back ()
 Remove the last element from this sequence.
 
iterator insert (iterator pos, const value_type &x)
 Insert x into this sequence at position pos.
 
template<class InputIterator >
void insert (iterator pos, InputIterator f, InputIterator l)
 Insert copies of the elements in [f, l) into this sequence starting at position pos.
 
void erase (iterator pos)
 Erase the element at pos.
 
void erase (iterator f, iterator l)
 Erase all the elements in the range [f, l).
 
void clear ()
 Clear the contents of the sequence.
 
void resize (size_t n, const value_type &t=value_type())
 Resize the contents of the sequence.
 
 operator value_vector_type () const
 Produce a copy of the contents of this sequence into a vector.
 
template<class T2 >
Thisoperator= (const SdfListProxy< T2 > &other)
 Replace all elements in this sequence with the elements in the other sequence.
 
Thisoperator= (const value_vector_type &other)
 Replace all elements in this sequence with the given vector.
 
template<class Y >
Thisoperator= (const std::vector< Y > &v)
 Replace all elements in this sequence with the given vector.
 
template<class T2 >
bool operator== (const SdfListProxy< T2 > &y) const
 Equality comparison.
 
template<class T2 >
bool operator!= (const SdfListProxy< T2 > &y) const
 Inequality comparison.
 
template<class T2 >
bool operator< (const SdfListProxy< T2 > &y) const
 Less-than comparison.
 
template<class T2 >
bool operator<= (const SdfListProxy< T2 > &y) const
 Less-than-or-equal comparison.
 
template<class T2 >
bool operator> (const SdfListProxy< T2 > &y) const
 Greater-than comparison.
 
template<class T2 >
bool operator>= (const SdfListProxy< T2 > &y) const
 Greater-than-or-equal comparison.
 
bool operator== (const value_vector_type &y) const
 Equality comparison.
 
bool operator!= (const value_vector_type &y) const
 Inequality comparison.
 
bool operator< (const value_vector_type &y) const
 Less-than comparison.
 
bool operator> (const value_vector_type &y) const
 Greater-than comparison.
 
bool operator<= (const value_vector_type &y) const
 Less-than or equal to comparison.
 
bool operator>= (const value_vector_type &y) const
 Greater-than or equal to comparison.
 
 operator bool () const
 Explicit bool conversion operator.
 
SdfLayerHandle GetLayer () const
 Returns the layer that this list editor belongs to.
 
SdfPath GetPath () const
 Returns the path to this list editor's value.
 
bool IsExpired () const
 Returns true if the list editor is expired.
 
size_t Count (const value_type &value) const
 
size_t Find (const value_type &value) const
 Returns the index of value in the list of operations.
 
void Insert (int index, const value_type &value)
 
void Remove (const value_type &value)
 
void Replace (const value_type &oldValue, const value_type &newValue)
 
void Erase (size_t index)
 
void ApplyList (const SdfListProxy &list)
 Applies the edits in the given list to this one.
 
void ApplyEditsToList (value_vector_type *vec)
 Apply the edits in this list to the given vec.
 
template<class CB >
void ModifyItemEdits (CB callback)
 Modify all edits in this list.
 

Static Public Attributes

static const size_t invalidIndex = -1
 Returned from Find when a value could not be located in the list of operations.
 

Friends

class _ItemProxy
 
class _GetHelper
 
class _ConstGetHelper
 
template<class >
class SdfPyWrapListProxy
 
bool operator== (const value_vector_type &x, const SdfListProxy &y)
 Equality comparision.
 
bool operator!= (const value_vector_type &x, const SdfListProxy &y)
 Inequality comparision.
 
bool operator< (const value_vector_type &x, const SdfListProxy &y)
 Less-than comparison.
 
bool operator> (const value_vector_type &x, const SdfListProxy &y)
 Greater-than comparison.
 
bool operator<= (const value_vector_type &x, const SdfListProxy &y)
 Less-than or equal to comparison.
 
bool operator>= (const value_vector_type &x, const SdfListProxy &y)
 Greater-than or equal to comparison.
 

Detailed Description

template<class _TypePolicy>
class SdfListProxy< _TypePolicy >

Represents a single list of list editing operations.

An SdfListProxy represents a single list of list editing operations, making it look like an STL vector (modeling a random access container and back insertion sequence).

Definition at line 37 of file listProxy.h.

Member Typedef Documentation

◆ const_iterator

typedef _Iterator<const This*, _ConstGetHelper> const_iterator

Definition at line 286 of file listProxy.h.

◆ const_reverse_iterator

typedef Tf_ProxyReferenceReverseIterator<const_iterator> const_reverse_iterator

Definition at line 288 of file listProxy.h.

◆ iterator

typedef _Iterator<This*, _GetHelper> iterator

Definition at line 285 of file listProxy.h.

◆ reference

typedef _ItemProxy reference

Definition at line 284 of file listProxy.h.

◆ reverse_iterator

typedef Tf_ProxyReferenceReverseIterator<iterator> reverse_iterator

Definition at line 287 of file listProxy.h.

◆ This

typedef SdfListProxy<TypePolicy> This

Definition at line 40 of file listProxy.h.

◆ TypePolicy

typedef _TypePolicy TypePolicy

Definition at line 39 of file listProxy.h.

◆ value_type

typedef TypePolicy::value_type value_type

Definition at line 41 of file listProxy.h.

◆ value_vector_type

typedef std::vector<value_type> value_vector_type

Definition at line 42 of file listProxy.h.

Constructor & Destructor Documentation

◆ SdfListProxy() [1/2]

SdfListProxy ( SdfListOpType  op)
inline

Creates a default list proxy object for list operation vector specified op.

This object evaluates to false in a boolean context and all operations on this object have no effect.

Definition at line 293 of file listProxy.h.

◆ SdfListProxy() [2/2]

SdfListProxy ( const std::shared_ptr< Sdf_ListEditor< TypePolicy > > &  editor,
SdfListOpType  op 
)
inline

Create a new proxy wrapping the list operation vector specified by op in the underlying listEditor.

Definition at line 300 of file listProxy.h.

Member Function Documentation

◆ ApplyEditsToList()

void ApplyEditsToList ( value_vector_type *  vec)
inline

Apply the edits in this list to the given vec.

Definition at line 645 of file listProxy.h.

◆ ApplyList()

void ApplyList ( const SdfListProxy< _TypePolicy > &  list)
inline

Applies the edits in the given list to this one.

Definition at line 637 of file listProxy.h.

◆ back() [1/2]

reference back ( )
inline

Return a reference to the item at the back of the sequence.

Definition at line 370 of file listProxy.h.

◆ back() [2/2]

value_type back ( ) const
inline

Return a copy of the item at the back of the sequence.

Definition at line 380 of file listProxy.h.

◆ begin() [1/2]

iterator begin ( )
inline

Return an iterator to the start of the sequence.

Definition at line 308 of file listProxy.h.

◆ begin() [2/2]

const_iterator begin ( ) const
inline

Return a const iterator to the start of the sequence.

Definition at line 326 of file listProxy.h.

◆ clear()

void clear ( )
inline

Clear the contents of the sequence.

Definition at line 418 of file listProxy.h.

◆ Count()

size_t Count ( const value_type &  value) const
inline

Definition at line 585 of file listProxy.h.

◆ empty()

bool empty ( ) const
inline

Return true if size() == 0.

Definition at line 350 of file listProxy.h.

◆ end() [1/2]

iterator end ( )
inline

Return an iterator to the end of the sequence.

Definition at line 312 of file listProxy.h.

◆ end() [2/2]

const_iterator end ( ) const
inline

Return a const iterator to the end of the sequence.

Definition at line 330 of file listProxy.h.

◆ erase() [1/2]

void erase ( iterator  f,
iterator  l 
)
inline

Erase all the elements in the range [f, l).

Definition at line 413 of file listProxy.h.

◆ erase() [2/2]

void erase ( iterator  pos)
inline

Erase the element at pos.

Definition at line 408 of file listProxy.h.

◆ Erase()

void Erase ( size_t  index)
inline

Definition at line 631 of file listProxy.h.

◆ Find()

size_t Find ( const value_type &  value) const
inline

Returns the index of value in the list of operations.

If value is not found, then invalidIndex is returned instead.

Definition at line 592 of file listProxy.h.

◆ front() [1/2]

reference front ( )
inline

Return a reference to the item at the front of the sequence.

Definition at line 365 of file listProxy.h.

◆ front() [2/2]

value_type front ( ) const
inline

Return a copy of the item at the front of the sequence.

Definition at line 375 of file listProxy.h.

◆ GetLayer()

SdfLayerHandle GetLayer ( ) const
inline

Returns the layer that this list editor belongs to.

Definition at line 568 of file listProxy.h.

◆ GetPath()

SdfPath GetPath ( ) const
inline

Returns the path to this list editor's value.

Definition at line 574 of file listProxy.h.

◆ Insert()

void Insert ( int  index,
const value_type &  value 
)
inline

Definition at line 597 of file listProxy.h.

◆ insert() [1/2]

iterator insert ( iterator  pos,
const value_type &  x 
)
inline

Insert x into this sequence at position pos.

Definition at line 395 of file listProxy.h.

◆ insert() [2/2]

void insert ( iterator  pos,
InputIterator  f,
InputIterator  l 
)
inline

Insert copies of the elements in [f, l) into this sequence starting at position pos.

Definition at line 403 of file listProxy.h.

◆ IsExpired()

bool IsExpired ( ) const
inline

Returns true if the list editor is expired.

Definition at line 580 of file listProxy.h.

◆ ModifyItemEdits()

void ModifyItemEdits ( CB  callback)
inline

Modify all edits in this list.

callback must be a callable that accepts an argument of type value_type and returns a std::optional<value_type>.

callback is called with every item in the list. If an invalid std::optional is returned, the item is removed. Otherwise it's replaced with the returned item. If a returned item matches an item that was previously returned, the returned item will be removed.

Definition at line 663 of file listProxy.h.

◆ operator bool()

operator bool ( ) const
inlineexplicit

Explicit bool conversion operator.

The list proxy object converts to true if the list editor is valid, false otherwise.

Definition at line 560 of file listProxy.h.

◆ operator value_vector_type()

operator value_vector_type ( ) const
inline

Produce a copy of the contents of this sequence into a vector.

Definition at line 437 of file listProxy.h.

◆ operator!=() [1/2]

bool operator!= ( const SdfListProxy< T2 > &  y) const
inline

Inequality comparison.

Definition at line 470 of file listProxy.h.

◆ operator!=() [2/2]

bool operator!= ( const value_vector_type &  y) const
inline

Inequality comparison.

Definition at line 509 of file listProxy.h.

◆ operator<() [1/2]

bool operator< ( const SdfListProxy< T2 > &  y) const
inline

Less-than comparison.

Definition at line 476 of file listProxy.h.

◆ operator<() [2/2]

bool operator< ( const value_vector_type &  y) const
inline

Less-than comparison.

Definition at line 519 of file listProxy.h.

◆ operator<=() [1/2]

bool operator<= ( const SdfListProxy< T2 > &  y) const
inline

Less-than-or-equal comparison.

Definition at line 482 of file listProxy.h.

◆ operator<=() [2/2]

bool operator<= ( const value_vector_type &  y) const
inline

Less-than or equal to comparison.

Definition at line 539 of file listProxy.h.

◆ operator=() [1/3]

This & operator= ( const SdfListProxy< T2 > &  other)
inline

Replace all elements in this sequence with the elements in the other sequence.

Definition at line 444 of file listProxy.h.

◆ operator=() [2/3]

This & operator= ( const std::vector< Y > &  v)
inline

Replace all elements in this sequence with the given vector.

Definition at line 457 of file listProxy.h.

◆ operator=() [3/3]

This & operator= ( const value_vector_type &  other)
inline

Replace all elements in this sequence with the given vector.

Definition at line 450 of file listProxy.h.

◆ operator==() [1/2]

bool operator== ( const SdfListProxy< T2 > &  y) const
inline

Equality comparison.

Definition at line 464 of file listProxy.h.

◆ operator==() [2/2]

bool operator== ( const value_vector_type &  y) const
inline

Equality comparison.

Definition at line 499 of file listProxy.h.

◆ operator>() [1/2]

bool operator> ( const SdfListProxy< T2 > &  y) const
inline

Greater-than comparison.

Definition at line 488 of file listProxy.h.

◆ operator>() [2/2]

bool operator> ( const value_vector_type &  y) const
inline

Greater-than comparison.

Definition at line 529 of file listProxy.h.

◆ operator>=() [1/2]

bool operator>= ( const SdfListProxy< T2 > &  y) const
inline

Greater-than-or-equal comparison.

Definition at line 494 of file listProxy.h.

◆ operator>=() [2/2]

bool operator>= ( const value_vector_type &  y) const
inline

Greater-than or equal to comparison.

Definition at line 549 of file listProxy.h.

◆ operator[]() [1/2]

reference operator[] ( size_t  n)
inline

Return a reference to the item at index n.

Definition at line 355 of file listProxy.h.

◆ operator[]() [2/2]

value_type operator[] ( size_t  n) const
inline

Return a copy of the item at index n.

Definition at line 360 of file listProxy.h.

◆ pop_back()

void pop_back ( )
inline

Remove the last element from this sequence.

Definition at line 390 of file listProxy.h.

◆ push_back()

void push_back ( const value_type &  elem)
inline

Append elem to this sequence.

Definition at line 385 of file listProxy.h.

◆ rbegin() [1/2]

reverse_iterator rbegin ( )
inline

Return a reverse iterator to the last item of the sequence.

Definition at line 317 of file listProxy.h.

◆ rbegin() [2/2]

const_reverse_iterator rbegin ( ) const
inline

Return a const reverse iterator to the last item of the sequence.

Definition at line 335 of file listProxy.h.

◆ Remove()

void Remove ( const value_type &  value)
inline

Definition at line 605 of file listProxy.h.

◆ rend() [1/2]

reverse_iterator rend ( )
inline

Return a reverse iterator past the start item of the sequence.

Definition at line 321 of file listProxy.h.

◆ rend() [2/2]

const_reverse_iterator rend ( ) const
inline

Return a const reverse iterator past the start item of the sequence.

Definition at line 340 of file listProxy.h.

◆ Replace()

void Replace ( const value_type &  oldValue,
const value_type &  newValue 
)
inline

Definition at line 618 of file listProxy.h.

◆ resize()

void resize ( size_t  n,
const value_type &  t = value_type() 
)
inline

Resize the contents of the sequence.

Inserts or erases copies of t at the end such that the size becomes n.

Definition at line 426 of file listProxy.h.

◆ size()

size_t size ( ) const
inline

Return the size of the sequence.

Definition at line 345 of file listProxy.h.

Friends And Related Function Documentation

◆ _ConstGetHelper

friend class _ConstGetHelper
friend

Definition at line 121 of file listProxy.h.

◆ _GetHelper

friend class _GetHelper
friend

Definition at line 120 of file listProxy.h.

◆ _ItemProxy

friend class _ItemProxy
friend

Definition at line 102 of file listProxy.h.

◆ operator!=

bool operator!= ( const value_vector_type &  x,
const SdfListProxy< _TypePolicy > &  y 
)
friend

Inequality comparision.

Definition at line 514 of file listProxy.h.

◆ operator<

bool operator< ( const value_vector_type &  x,
const SdfListProxy< _TypePolicy > &  y 
)
friend

Less-than comparison.

Definition at line 524 of file listProxy.h.

◆ operator<=

bool operator<= ( const value_vector_type &  x,
const SdfListProxy< _TypePolicy > &  y 
)
friend

Less-than or equal to comparison.

Definition at line 544 of file listProxy.h.

◆ operator==

bool operator== ( const value_vector_type &  x,
const SdfListProxy< _TypePolicy > &  y 
)
friend

Equality comparision.

Definition at line 504 of file listProxy.h.

◆ operator>

bool operator> ( const value_vector_type &  x,
const SdfListProxy< _TypePolicy > &  y 
)
friend

Greater-than comparison.

Definition at line 534 of file listProxy.h.

◆ operator>=

bool operator>= ( const value_vector_type &  x,
const SdfListProxy< _TypePolicy > &  y 
)
friend

Greater-than or equal to comparison.

Definition at line 554 of file listProxy.h.

◆ SdfPyWrapListProxy

friend class SdfPyWrapListProxy
friend

Definition at line 756 of file listProxy.h.

Member Data Documentation

◆ invalidIndex

const size_t invalidIndex = -1
static

Returned from Find when a value could not be located in the list of operations.


Definition at line 46 of file listProxy.h.


The documentation for this class was generated from the following file: