HomeReferenceDomain.h ⇀ TransactionStatus

TransactionStatus class

This class allow to wait for a asynchrounous transactions started with AsyncTransaction.

An instance of TransactionStatus shares ownership of its internal state with any transactions it is monitoring. The instance itself is a move-only type, i.e. each transaction status manages a unique state. A single TransactionState can monitor multiple transactions and it can be re-used to avoid repeated state allocations.

Synopsis

class TransactionStatus
{
    // Constructor
    TransactionStatus();
    TransactionStatus(TransactionStatus&& other); // Move

    // Assignemnt
    TransactionStatus& operator=(TransactionStatus&& other); // Move

    // Waits until any transactions associated with this instance are done
    void Wait();
};

Constructor member function

Syntax

TransactionStatus();                            // (1)
TransactionStatus(TransactionStatus&& other);   // (2)

Semantics

(1) Creates a status instance that does not monitor any transactions.

(2) Creates a status instance by moving internal state from other to this. A new state is allocated for other.


operator= member function

Syntax

TransactionStatus& operator=(TransactionStatus&& other);

Semantics

Moves the internal state from other to this. Ownership of any previous state is released and a new state is allocated for other.


Wait member function

Syntax

void Wait();

Semantics

Blocks the current thread until all monitored transactions are done. After Wait returns, the status instance can be reused.