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

#include <listEditor.h>

+ Inheritance diagram for Sdf_ListEditor< TypePolicy >:

Public Types

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

Public Member Functions

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)
 
virtual ~Sdf_ListEditor ()=default
 
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 52 of file listEditor.h.

Member Typedef Documentation

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

Definition at line 133 of file listEditor.h.

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

Definition at line 122 of file listEditor.h.

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

Definition at line 59 of file listEditor.h.

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

Definition at line 60 of file listEditor.h.

Constructor & Destructor Documentation

template<class TypePolicy >
Sdf_ListEditor< TypePolicy >::Sdf_ListEditor ( )
inlineprotected

Definition at line 196 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 200 of file listEditor.h.

template<class TypePolicy >
virtual Sdf_ListEditor< TypePolicy >::~Sdf_ListEditor ( )
protectedvirtualdefault

Member Function Documentation

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

Definition at line 215 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 210 of file listEditor.h.

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

Definition at line 220 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 287 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 225 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 166 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 174 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 153 of file listEditor.h.

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

Definition at line 62 of file listEditor.h.

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

Definition at line 67 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 147 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 159 of file listEditor.h.

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

Definition at line 82 of file listEditor.h.

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

Definition at line 77 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 72 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.

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

Definition at line 102 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: