HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Sdf_ListEditor< TypePolicy > Class Template Referenceabstract

#include <listEditor.h>

Public Types

typedef TypePolicy::value_type value_type
 
typedef std::vector< value_typevalue_vector_type
 
typedef std::function
< std::optional< value_type >
const value_type &) > 
ModifyCallback
 
typedef std::function
< std::optional< value_type >
SdfListOpType, const
value_type &) > 
ApplyCallback
 

Public Member Functions

virtual ~Sdf_ListEditor ()=default
 
SdfLayerHandle GetLayer () const
 
SdfPath GetPath () const
 
bool IsValid () const
 
bool IsExpired () const
 
bool HasKeys () const
 
virtual bool IsExplicit () const =0
 
virtual bool IsOrderedOnly () const =0
 
virtual SdfAllowed PermissionToEdit (SdfListOpType op) const
 
virtual bool CopyEdits (const Sdf_ListEditor &rhs)=0
 
virtual bool ClearEdits ()=0
 
virtual bool ClearEditsAndMakeExplicit ()=0
 
virtual void ModifyItemEdits (const ModifyCallback &cb)=0
 
virtual void ApplyEditsToList (value_vector_type *vec, const ApplyCallback &cb=ApplyCallback())=0
 
size_t GetSize (SdfListOpType op) const
 Returns the number of elements in the specified list of operations. More...
 
value_type Get (SdfListOpType op, size_t i) const
 Returns the i'th value in the specified list of operations. More...
 
value_vector_type GetVector (SdfListOpType op) const
 Returns the specified list of operations. More...
 
size_t Count (SdfListOpType op, const value_type &val) const
 
size_t Find (SdfListOpType op, const value_type &val) const
 
virtual bool ReplaceEdits (SdfListOpType op, size_t index, size_t n, const value_vector_type &elems)=0
 
virtual void ApplyList (SdfListOpType op, const Sdf_ListEditor &rhs)=0
 Applies a rhs opinions about a given operation list to this one. More...
 

Protected Member Functions

 Sdf_ListEditor ()
 
 Sdf_ListEditor (const SdfSpecHandle &owner, const TfToken &field, const TypePolicy &typePolicy)
 
const SdfSpecHandle & _GetOwner () const
 
const TfToken_GetField () const
 
const TypePolicy & _GetTypePolicy () const
 
virtual bool _ValidateEdit (SdfListOpType op, const value_vector_type &oldValues, const value_vector_type &newValues) const
 
virtual void _OnEdit (SdfListOpType op, const value_vector_type &oldValues, const value_vector_type &newValues) const
 
virtual const value_vector_type_GetOperations (SdfListOpType op) const =0
 

Detailed Description

template<class TypePolicy>
class Sdf_ListEditor< TypePolicy >

Base class for list editor implementations in which list editing operations are stored in data field(s) associated with an owning spec.

Definition at line 50 of file listEditor.h.

Member Typedef Documentation

template<class TypePolicy >
typedef std::function< std::optional<value_type>SdfListOpType, const value_type&) > Sdf_ListEditor< TypePolicy >::ApplyCallback

Definition at line 136 of file listEditor.h.

template<class TypePolicy >
typedef std::function< std::optional<value_type>const value_type&) > Sdf_ListEditor< TypePolicy >::ModifyCallback

Definition at line 123 of file listEditor.h.

template<class TypePolicy >
typedef TypePolicy::value_type Sdf_ListEditor< TypePolicy >::value_type

Definition at line 58 of file listEditor.h.

template<class TypePolicy >
typedef std::vector<value_type> Sdf_ListEditor< TypePolicy >::value_vector_type

Definition at line 59 of file listEditor.h.

Constructor & Destructor Documentation

template<class TypePolicy >
virtual Sdf_ListEditor< TypePolicy >::~Sdf_ListEditor ( )
virtualdefault
template<class TypePolicy >
Sdf_ListEditor< TypePolicy >::Sdf_ListEditor ( )
inlineprotected

Definition at line 199 of file listEditor.h.

template<class TypePolicy >
Sdf_ListEditor< TypePolicy >::Sdf_ListEditor ( const SdfSpecHandle &  owner,
const TfToken field,
const TypePolicy &  typePolicy 
)
inlineprotected

Definition at line 203 of file listEditor.h.

Member Function Documentation

template<class TypePolicy >
const TfToken& Sdf_ListEditor< TypePolicy >::_GetField ( ) const
inlineprotected

Definition at line 216 of file listEditor.h.

template<class TypePolicy >
virtual const value_vector_type& Sdf_ListEditor< TypePolicy >::_GetOperations ( SdfListOpType  op) const
protectedpure virtual
template<class TypePolicy >
const SdfSpecHandle& Sdf_ListEditor< TypePolicy >::_GetOwner ( ) const
inlineprotected

Definition at line 211 of file listEditor.h.

template<class TypePolicy >
const TypePolicy& Sdf_ListEditor< TypePolicy >::_GetTypePolicy ( ) const
inlineprotected

Definition at line 221 of file listEditor.h.

template<class TypePolicy >
virtual void Sdf_ListEditor< TypePolicy >::_OnEdit ( SdfListOpType  op,
const value_vector_type oldValues,
const value_vector_type newValues 
) const
inlineprotectedvirtual

Definition at line 288 of file listEditor.h.

template<class TypePolicy >
virtual bool Sdf_ListEditor< TypePolicy >::_ValidateEdit ( SdfListOpType  op,
const value_vector_type oldValues,
const value_vector_type newValues 
) const
inlineprotectedvirtual

Definition at line 226 of file listEditor.h.

template<class TypePolicy >
virtual void Sdf_ListEditor< TypePolicy >::ApplyEditsToList ( value_vector_type vec,
const ApplyCallback cb = ApplyCallback() 
)
pure virtual

Apply the list operations represented by this interface to the given vector of values vec. If callback is valid then it's called for every key in the editor before applying it to vec. If the returned key is empty then the key will not be applied. Otherwise the returned key is applied, allowing callbacks to perform key translation. Note that this means list editors can't meaningfully hold the empty key.

template<class TypePolicy >
virtual void Sdf_ListEditor< TypePolicy >::ApplyList ( SdfListOpType  op,
const Sdf_ListEditor< TypePolicy > &  rhs 
)
pure virtual

Applies a rhs opinions about a given operation list to this one.

template<class TypePolicy >
virtual bool Sdf_ListEditor< TypePolicy >::ClearEdits ( )
pure virtual
template<class TypePolicy >
virtual bool Sdf_ListEditor< TypePolicy >::ClearEditsAndMakeExplicit ( )
pure virtual
template<class TypePolicy >
virtual bool Sdf_ListEditor< TypePolicy >::CopyEdits ( const Sdf_ListEditor< TypePolicy > &  rhs)
pure virtual
template<class TypePolicy >
size_t Sdf_ListEditor< TypePolicy >::Count ( SdfListOpType  op,
const value_type val 
) const
inline

Returns the number of occurrences of val in the specified list of operations.

Definition at line 169 of file listEditor.h.

template<class TypePolicy >
size_t Sdf_ListEditor< TypePolicy >::Find ( SdfListOpType  op,
const value_type val 
) const
inline

Returns the index of val in the specified list of operations, -1 if val is not found.

Definition at line 177 of file listEditor.h.

template<class TypePolicy >
value_type Sdf_ListEditor< TypePolicy >::Get ( SdfListOpType  op,
size_t  i 
) const
inline

Returns the i'th value in the specified list of operations.

Definition at line 156 of file listEditor.h.

template<class TypePolicy >
SdfLayerHandle Sdf_ListEditor< TypePolicy >::GetLayer ( ) const
inline

Definition at line 63 of file listEditor.h.

template<class TypePolicy >
SdfPath Sdf_ListEditor< TypePolicy >::GetPath ( ) const
inline

Definition at line 68 of file listEditor.h.

template<class TypePolicy >
size_t Sdf_ListEditor< TypePolicy >::GetSize ( SdfListOpType  op) const
inline

Returns the number of elements in the specified list of operations.

Definition at line 150 of file listEditor.h.

template<class TypePolicy >
value_vector_type Sdf_ListEditor< TypePolicy >::GetVector ( SdfListOpType  op) const
inline

Returns the specified list of operations.

Definition at line 162 of file listEditor.h.

template<class TypePolicy >
bool Sdf_ListEditor< TypePolicy >::HasKeys ( ) const
inline

Definition at line 83 of file listEditor.h.

template<class TypePolicy >
bool Sdf_ListEditor< TypePolicy >::IsExpired ( ) const
inline

Definition at line 78 of file listEditor.h.

template<class TypePolicy >
virtual bool Sdf_ListEditor< TypePolicy >::IsExplicit ( ) const
pure virtual
template<class TypePolicy >
virtual bool Sdf_ListEditor< TypePolicy >::IsOrderedOnly ( ) const
pure virtual
template<class TypePolicy >
bool Sdf_ListEditor< TypePolicy >::IsValid ( ) const
inline

Definition at line 73 of file listEditor.h.

template<class TypePolicy >
virtual void Sdf_ListEditor< TypePolicy >::ModifyItemEdits ( const ModifyCallback cb)
pure virtual

Modifies the operations stored in all operation lists. callback is called for every key. If the returned key is invalid then the key is removed, otherwise it's replaced with the returned key. If the returned key matches a key that was previously returned for the list being processed, the returned key will be removed.

template<class TypePolicy >
virtual SdfAllowed Sdf_ListEditor< TypePolicy >::PermissionToEdit ( SdfListOpType  op) const
inlinevirtual

Definition at line 103 of file listEditor.h.

template<class TypePolicy >
virtual bool Sdf_ListEditor< TypePolicy >::ReplaceEdits ( SdfListOpType  op,
size_t  index,
size_t  n,
const value_vector_type elems 
)
pure virtual

Replaces the operations in the specified list of operations in range [index, index + n) with the given elems.


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