![]() |
|
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. | |
| 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 50 of file arrayEdit.h.
Shorthand for the corresponding VtArray type.
Definition at line 54 of file arrayEdit.h.
| using ElementType = typename Array::ElementType |
Definition at line 56 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 123 of file arrayEdit.h.
Apply the edits in *this to weaker and return the resulting array.
Definition at line 115 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 91 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 107 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 83 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 99 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 74 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 172 of file arrayEdit.h.
|
friend |
Inequality comparison.
Definition at line 67 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 156 of file arrayEdit.h.
|
friend |
Equality comparison.
Definition at line 63 of file arrayEdit.h.
|
friend |
Definition at line 172 of file arrayEdit.h.