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 1798 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 1801 of file blockchain_db.h.

1801  : db(db), readonly(readonly), active(false)
1802  {
1803  if (readonly)
1804  {
1805  active = db->block_rtxn_start();
1806  }
1807  else
1808  {
1809  db->block_wtxn_start();
1810  active = true;
1811  }
1812  }
virtual bool block_rtxn_start() const =0
virtual void block_wtxn_start()=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 1813 of file blockchain_db.h.

1814  {
1815  if (active)
1816  stop();
1817  }
Here is the call graph for this function:

Member Function Documentation

◆ abort()

void cryptonote::db_txn_guard::abort ( )
inline

Definition at line 1826 of file blockchain_db.h.

1827  {
1828  if (readonly)
1829  db->block_rtxn_abort();
1830  else
1831  db->block_wtxn_abort();
1832  active = false;
1833  }
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 1818 of file blockchain_db.h.

1819  {
1820  if (readonly)
1821  db->block_rtxn_stop();
1822  else
1823  db->block_wtxn_stop();
1824  active = false;
1825  }
virtual void block_wtxn_stop()=0
virtual void block_rtxn_stop() const =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: