Electroneum
cryptonote::db_txn_guard Class Reference

#include <blockchain_db.h>

Inheritance diagram for cryptonote::db_txn_guard:

Public Member Functions

 db_txn_guard (BlockchainDB *db, bool readonly)
 
virtual ~db_txn_guard ()
 
void stop ()
 
void abort ()
 

Detailed Description

Definition at line 1816 of file blockchain_db.h.

Constructor & Destructor Documentation

◆ db_txn_guard()

cryptonote::db_txn_guard::db_txn_guard ( BlockchainDB db,
bool  readonly 
)
inline

Definition at line 1819 of file blockchain_db.h.

1819  : db(db), readonly(readonly), active(false)
1820  {
1821  if (readonly)
1822  {
1823  active = db->block_rtxn_start();
1824  }
1825  else
1826  {
1827  db->block_wtxn_start();
1828  active = true;
1829  }
1830  }
virtual void block_wtxn_start()=0
virtual bool block_rtxn_start() const =0
Here is the call graph for this function:
Here is the caller graph for this function:

◆ ~db_txn_guard()

virtual cryptonote::db_txn_guard::~db_txn_guard ( )
inlinevirtual

Definition at line 1831 of file blockchain_db.h.

1832  {
1833  if (active)
1834  stop();
1835  }
Here is the call graph for this function:

Member Function Documentation

◆ abort()

void cryptonote::db_txn_guard::abort ( )
inline

Definition at line 1844 of file blockchain_db.h.

1845  {
1846  if (readonly)
1847  db->block_rtxn_abort();
1848  else
1849  db->block_wtxn_abort();
1850  active = false;
1851  }
virtual void block_rtxn_abort() const =0
virtual void block_wtxn_abort()=0
Here is the call graph for this function:

◆ stop()

void cryptonote::db_txn_guard::stop ( )
inline

Definition at line 1836 of file blockchain_db.h.

1837  {
1838  if (readonly)
1839  db->block_rtxn_stop();
1840  else
1841  db->block_wtxn_stop();
1842  active = false;
1843  }
virtual void block_rtxn_stop() const =0
virtual void block_wtxn_stop()=0
Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following file: