A class supporting transactional writing for a subtree.
See Brief introduction of software transactional memory using the class Node for basic ideas of this STM and code examples.
.
More...
#include <transaction.h>

Public Member Functions | |
| Transaction (Node< XN > &node, bool multi_nodal=true) | |
| Transaction (const Snapshot< XN > &x, bool multi_nodal=true) noexcept | |
| Transaction (Transaction &&x) noexcept=default | |
| template<class T > | |
| T::Payload & | operator[] (const shared_ptr< T > &node) |
| template<class T > | |
| T::Payload & | operator[] (T &node) |
| bool | isMultiNodal () const noexcept |
| template<typename T , typename... Args> | |
| void | mark (T &talker, Args &&...args) |
| Reserves an event, to be emitted from talker with arg after the transaction is committed. | |
| int | unmark (const shared_ptr< XListener > &x) |
| bool | isModified () const noexcept |
| bool | commit () |
| bool | commitOrNext () |
| Combination of commit() and operator++(). | |
| Snapshot< XN > | newTransactionUsingSnapshotFor (Node< XN > &supernode) |
| Transaction (const Transaction &tr)=delete | |
| Transaction & | operator= (const Transaction &tr)=delete |
Public Member Functions inherited from Transactional::Snapshot< XN > | |
| Snapshot (const Snapshot &x) noexcept=default | |
| Snapshot (Snapshot &&x) noexcept=default | |
| Snapshot (Node< XN > &node, const Snapshot &x) noexcept | |
| Snapshot (const Transaction< XN > &x) noexcept | |
| Snapshot (Transaction< XN > &&x) noexcept | |
| Snapshot & | operator= (const Snapshot &x) noexcept=default |
| Snapshot (const Node< XN > &node, bool multi_nodal=true) | |
| template<class T > | |
| const T::Payload & | operator[] (const shared_ptr< T > &node) const noexcept |
| template<class T > | |
| const T::Payload & | operator[] (const T &node) const noexcept |
| int | size () const noexcept |
of child nodes. | |
|
const shared_ptr< const typename Node< XN >::NodeList > | list () const noexcept |
| The list of child nodes. | |
| int | size (const shared_ptr< Node< XN > > &node) const noexcept |
of child nodes owned by node. | |
|
shared_ptr< const typename Node< XN >::NodeList > | list (const shared_ptr< Node< XN > > &node) const noexcept |
| The list of child nodes owned by node. | |
| bool | isUpperOf (const XN &lower) const noexcept |
| Whether lower is a child of this or not. | |
| void | print () |
| template<typename T , typename tArgRef > | |
| void | talk (T &talker, tArgRef arg) const |
| Stores an event immediately from talker with arg. | |
Private Types | |
| using | MessageList = fast_vector< shared_ptr< Message_< Snapshot< XN >> >, 3 > |
Private Member Functions | |
| Transaction & | operator++ () |
| Takes another snapshot and prepares for a next transaction. | |
| void | finalizeCommitment (Node< XN > &node) |
Private Attributes | |
|
local_shared_ptr< typename Node< XN >::Packet > | m_oldpacket |
| const bool | m_multi_nodal |
|
Node< XN > ::NegotiationCounter::cnt_t | m_started_time |
| unique_ptr< MessageList > | m_messages |
Friends | |
| class | Node< XN > |
Additional Inherited Members | |
Protected Attributes inherited from Transactional::Snapshot< XN > | |
|
local_shared_ptr< typename Node< XN >::Packet > | m_packet |
| The snapshot. | |
| int64_t | m_serial |
A class supporting transactional writing for a subtree.
See Brief introduction of software transactional memory using the class Node for basic ideas of this STM and code examples.
.
Transaction inherits features of Snapshot. Do something like the following to avoid a copy-on-write due to Transaction::operator[]():
Definition at line 544 of file transaction.h.
|
inlineexplicit |
Be sure for the persistence of the node.
| [in] | multi_nodal | If false, the snapshot and following commitment are not aware of the contents of the child nodes. |
Definition at line 548 of file transaction.h.
References Transactional::Snapshot< XN >::m_packet.
|
inlineexplicitnoexcept |
| [in] | x | The snapshot containing the old value of node. |
| [in] | multi_nodal | If false, the snapshot and following commitment are not aware of the contents of the child nodes. |
Definition at line 557 of file transaction.h.
|
inline |
Definition at line 616 of file transaction.h.
References Transactional::Snapshot< XN >::m_packet.
Referenced by Transactional::Transaction< XN >::commitOrNext(), Transactional::Node< XN >::iterate_commit(), Transactional::Node< XN >::iterate_commit_if(), and Transactional::Node< XN >::iterate_commit_while().
|
inline |
Prepares for a next transaction after taking a snapshot for supernode.
Definition at line 633 of file transaction.h.
References Transactional::Snapshot< XN >::m_packet, and Transactional::Transaction< XN >::operator++().
|
inline |
Definition at line 574 of file transaction.h.
|
inline |
Definition at line 579 of file transaction.h.
References Transactional::Snapshot< XN >::m_packet.
|
inline |
Cancels reserved events made toward x.
Definition at line 604 of file transaction.h.
1.8.3