![]() |
|
An array edit represents a sequence of per-element modifications to a VtArray. More...
#include <arrayEdit.h>
Public Types | |
| using | Array = VtArray< ELEM > |
| Shorthand for the corresponding VtArray type. | |
| using | ElementType = typename Array::ElementType |
Public Member Functions | |
| VtArrayEdit ()=default | |
| Construct an identity array edit that performs no edits. | |
| bool | IsIdentity () const |
| Return true if this edit is the identity edit. | |
| TfSpan< const ElementType > | GetLiterals () const |
| Return a view of the literal elements that this edit makes use of. | |
| TfSpan< ElementType > | GetMutableLiterals () |
| Return a mutable view of the literal elements that this edit makes use of. | |
| VtArrayEdit | ComposeOver (VtArrayEdit const &weaker) && |
Compose this edit over weaker and return a new result representing the function composition, where weaker is the "inner" function and *this is the "outer" function. | |
| VtArrayEdit | ComposeOver (VtArrayEdit &&weaker) && |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| VtArrayEdit | ComposeOver (VtArrayEdit const &weaker) const & |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| VtArrayEdit | ComposeOver (VtArrayEdit &&weaker) const & |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| Array | ComposeOver (Array const &weaker) const |
Apply the edits in *this to weaker and return the resulting array. | |
| Array | ComposeOver (Array &&weaker) const |
| This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. | |
| template<class UnaryOp > | |
| std::ostream & | StreamCustom (std::ostream &out, UnaryOp &&unaryOp) const |
Insert self to the stream out, but call unaryOp on each contained value-type element and pass the result to VtStreamOut(). | |
Friends | |
| class | VtArrayEditBuilder< ELEM > |
| bool | operator== (VtArrayEdit const &x, VtArrayEdit const &y) |
| Equality comparison. | |
| bool | operator!= (VtArrayEdit const &x, VtArrayEdit const &y) |
| Inequality comparison. | |
| std::ostream & | operator<< (std::ostream &out, const VtArrayEdit self) |
Insert self to the stream out using the following format: | |
An array edit represents a sequence of per-element modifications to a VtArray.
The member function ComposeOver(strong, weak) applies strong's edits to weak and returns the resulting VtArray or VtArrayEdit, depending on whether weak is a VtArray or VtArrayEdit.
VtArrayEdit under ComposeOver() forms an algebraic "monoid". That is, ComposeOver() is associative, where the default-constructed VtArrayEdit (which represents no edits) is the identity element.
See the associated VtArrayEditBuilder class to understand the available edit operations, and to build a VtArrayEdit from them.
Definition at line 51 of file arrayEdit.h.
Shorthand for the corresponding VtArray type.
Definition at line 55 of file arrayEdit.h.
| using ElementType = typename Array::ElementType |
Definition at line 57 of file arrayEdit.h.
|
default |
Construct an identity array edit that performs no edits.
ComposeOver() with an identity returns the other argument.
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 136 of file arrayEdit.h.
Apply the edits in *this to weaker and return the resulting array.
Definition at line 128 of file arrayEdit.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 104 of file arrayEdit.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 120 of file arrayEdit.h.
|
inline |
Compose this edit over weaker and return a new result representing the function composition, where weaker is the "inner" function and *this is the "outer" function.
In other words, return an edit that represents the action of the edits in weaker followed by those in *this.
Definition at line 96 of file arrayEdit.h.
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 112 of file arrayEdit.h.
|
inline |
Return a view of the literal elements that this edit makes use of.
Definition at line 80 of file arrayEdit.h.
|
inline |
Return a mutable view of the literal elements that this edit makes use of.
This can be useful in case elements need to be transformed or translated.
Definition at line 87 of file arrayEdit.h.
|
inline |
Return true if this edit is the identity edit.
The identity edit performs no edits. Composing the identity with another edit returns that edit unmodified.
Definition at line 75 of file arrayEdit.h.
|
inline |
Insert self to the stream out, but call unaryOp on each contained value-type element and pass the result to VtStreamOut().
An example where this is useful is when the element-type is string and the destination format requires quoting. For more details on the overall output format, see the regular stream insertion operator.
Definition at line 185 of file arrayEdit.h.
|
friend |
Inequality comparison.
Definition at line 68 of file arrayEdit.h.
|
friend |
Insert self to the stream out using the following format:
Where each op is one of:
An <index> is an integer enclosed in square brackets, and a <literal> is an element value serialized by VtStreamOut().
Definition at line 169 of file arrayEdit.h.
|
friend |
Equality comparison.
Definition at line 64 of file arrayEdit.h.
|
friend |
Definition at line 185 of file arrayEdit.h.