|
SDF_API | SdfListOp () |
| Create an empty ListOp in non-explicit mode. More...
|
|
SDF_API void | Swap (SdfListOp< T > &rhs) |
|
bool | HasKeys () const |
| Returns true if the editor has an explicit list (even if it's empty) or it has any added, prepended, appended, deleted, or ordered keys. More...
|
|
SDF_API bool | HasItem (const T &item) const |
| Returns true if the given item is in any of the item lists. More...
|
|
bool | IsExplicit () const |
| Returns true if the list is explicit. More...
|
|
const ItemVector & | GetExplicitItems () const |
| Returns the explicit items. More...
|
|
const ItemVector & | GetAddedItems () const |
| Returns the explicit items. More...
|
|
const ItemVector & | GetPrependedItems () const |
| Returns the explicit items. More...
|
|
const ItemVector & | GetAppendedItems () const |
| Returns the explicit items. More...
|
|
const ItemVector & | GetDeletedItems () const |
| Returns the deleted items. More...
|
|
const ItemVector & | GetOrderedItems () const |
| Returns the ordered items. More...
|
|
SDF_API const ItemVector & | GetItems (SdfListOpType type) const |
| Return the item vector identified by type . More...
|
|
SDF_API void | SetExplicitItems (const ItemVector &items) |
|
SDF_API void | SetAddedItems (const ItemVector &items) |
|
SDF_API void | SetPrependedItems (const ItemVector &items) |
|
SDF_API void | SetAppendedItems (const ItemVector &items) |
|
SDF_API void | SetDeletedItems (const ItemVector &items) |
|
SDF_API void | SetOrderedItems (const ItemVector &items) |
|
SDF_API void | SetItems (const ItemVector &items, SdfListOpType type) |
| Sets the item vector for the given operation type . More...
|
|
SDF_API void | Clear () |
| Removes all items and changes the list to be non-explicit. More...
|
|
SDF_API void | ClearAndMakeExplicit () |
| Removes all items and changes the list to be explicit. More...
|
|
SDF_API void | ApplyOperations (ItemVector *vec, const ApplyCallback &cb=ApplyCallback()) const |
| Applies edit operations to the given ItemVector. More...
|
|
SDF_API boost::optional< SdfListOp< T > > | ApplyOperations (const SdfListOp< T > &inner) const |
| Applies edit operations to the given ListOp. More...
|
|
SDF_API bool | ModifyOperations (const ModifyCallback &callback, bool removeDuplicates=false) |
| Modifies operations specified in this object. More...
|
|
SDF_API bool | ReplaceOperations (const SdfListOpType op, size_t index, size_t n, const ItemVector &newItems) |
| Replaces the items in the specified operation vector in the range (index, index + n] with the given newItems . More...
|
|
SDF_API void | ComposeOperations (const SdfListOp< T > &stronger, SdfListOpType op) |
| Composes a stronger SdfListOp's opinions for a given operation list over this one. More...
|
|
bool | operator== (const SdfListOp< T > &rhs) const |
|
bool | operator!= (const SdfListOp< T > &rhs) const |
|
template<typename T>
class SdfListOp< T >
Value type representing a list-edit operation.
SdfListOp is a value type representing an operation that edits a list. It may add or remove items, reorder them, or replace the list entirely.
Definition at line 75 of file listOp.h.
SDF_API boost::optional<SdfListOp<T> > ApplyOperations |
( |
const SdfListOp< T > & |
inner | ) |
const |
Applies edit operations to the given ListOp.
The result is a ListOp that, when applied to a list, has the same effect as applying inner
and then this
in sequence.
The result will be empty if the result is not well defined. The result is well-defined when inner
and this
do not use the 'ordered' or 'added' item lists. In other words, only the explicit, prepended, appended, and deleted portions of SdfListOp are closed under composition with ApplyOperations().
SDF_API bool ModifyOperations |
( |
const ModifyCallback & |
callback, |
|
|
bool |
removeDuplicates = false |
|
) |
| |
Modifies operations specified in this object.
callback
is called for every item in all operation vectors. If the returned key is empty then the key is removed, otherwise it's replaced with the returned key.
If removeDuplicates
is true
and callback
returns a key that was previously returned for the current operation vector being processed, the returned key will be removed.
Returns true if a change was made, false otherwise.