|
| | ValidatedTransaction (ValidatedTransaction &&other) noexcept=default |
| ValidatedTransaction & | operator= (ValidatedTransaction &&other) noexcept |
| | ValidatedTransaction (const ValidatedTransaction &)=delete |
| ValidatedTransaction & | operator= (const ValidatedTransaction &)=delete |
| | ~ValidatedTransaction () |
| TreeEditResult | set (StateTree &node, std::string_view name, PropertyValue value) |
| TreeEditResult | remove (StateTree &node, std::string_view name) |
| TreeEditResult | add_child (StateTree &parent, Ptr child) |
| TreeEditResult | insert_child (StateTree &parent, int index, Ptr child) |
| TreeEditResult | remove_child (StateTree &parent, int index) |
| TreeEditResult | move_child (StateTree &from_parent, int from_index, StateTree &to_parent, int to_index) |
| TreeEditResult | commit () |
| | Commit when every edit succeeded; otherwise abort and return the first error.
|
| bool | abort () |
| | Revert every edit and end the transaction. Returns false when inactive.
|
| bool | is_active () const |
| bool | has_error () const |
| const std::optional< TreeEditError > & | first_error () const |
A transaction whose edits are checked and return TreeEditResult instead of being silently ignored.
Every edit must target a node of the tree the transaction was begun on (kNotInTransaction otherwise). A refused edit changes nothing; the first refusal is remembered, and commit() then aborts the whole transaction and returns that error. Destroying an active ValidatedTransaction calls commit().
Move-only. NOT thread-safe — message thread only.