|
graph_analysis
|
A transaction observer. More...
#include <TransactionObserver.hpp>


Public Types | |
| typedef shared_ptr< TransactionObserver > | Ptr |
Public Types inherited from graph_analysis::BaseGraphObserver | |
| typedef shared_ptr< BaseGraphObserver > | Ptr |
Public Member Functions | |
| TransactionObserver (BaseGraphObserver::Ptr &observer) | |
| virtual | ~TransactionObserver () |
| virtual void | notify (const Vertex::Ptr &vertex, const EventType &event, const GraphId &origin) |
| virtual void | notify (const Edge::Ptr &edge, const EventType &event, const GraphId &origin) |
| virtual void | notify (const TransactionType &event, const GraphId &origin) |
| bool | inTransaction () |
| return true if a transaction is currently running More... | |
Public Member Functions inherited from graph_analysis::BaseGraphObserver | |
| virtual | ~BaseGraphObserver () |
Static Public Member Functions | |
| static TransactionObserver::Ptr | getInstance (BaseGraphObserver::Ptr &observer) |
A transaction observer.
Store all events until a transaction has been ended. Once the transaction is ended, all events are forwared to the registered observer at once.
If no transaction has been started, the events are passed through directly.
The transaction events TRANSACTION_START and TRANSACTION_STOP can be nested. Events are then held until the outermost transaction has been finished.
* Usage: * * BaseGraphObserver::Ptr obs( new BaseGraphObserver() ); * * TransactionObserver::Ptr tobs = TransactionObserver::getInstance( obs ); * graph->addObserver( tobs ); * graph->transactionsEvent( TRANSACTION_START ); * // modify graph vertices and edges * graph->transactionsEvent( TRANSACTION_START ); * graph->transactionEvent( TRANSACTION_STOP ); * graph->transactionEvent( TRANSACTION_STOP ); * * // events are emited to obs now * *
| typedef shared_ptr<TransactionObserver> graph_analysis::TransactionObserver::Ptr |
|
explicit |
| observer | - the observer to which the events are forwarded. |
|
virtual |
|
static |
| bool TransactionObserver::inTransaction | ( | ) |
return true if a transaction is currently running
|
virtual |
Reimplemented from graph_analysis::BaseGraphObserver.
|
virtual |
Reimplemented from graph_analysis::BaseGraphObserver.
|
virtual |
Reimplemented from graph_analysis::BaseGraphObserver.
1.8.13