CatapultServer  v0.5.0.1 (Elephant)
catapult::io::IndexFile Class Reference

Index file containing a uint64_t value. More...

Public Member Functions

 IndexFile (const std::string &filename, LockMode lockMode=LockMode::File)
 Creates an index file with name filename and file locking specified by lockMode. More...
 
bool exists () const
 true if the index file exists. More...
 
uint64_t get () const
 Gets the index value. More...
 
void set (uint64_t value)
 Sets the index value to value. More...
 
uint64_t increment ()
 Increments the index value by one and returns the new value. More...
 

Private Member Functions

RawFile open (OpenMode mode) const
 

Private Attributes

std::string m_filename
 
LockMode m_lockMode
 

Detailed Description

Index file containing a uint64_t value.

Constructor & Destructor Documentation

◆ IndexFile()

catapult::io::IndexFile::IndexFile ( const std::string &  filename,
LockMode  lockMode = LockMode::File 
)
explicit

Creates an index file with name filename and file locking specified by lockMode.

Member Function Documentation

◆ exists()

bool catapult::io::IndexFile::exists ( ) const

true if the index file exists.

Here is the caller graph for this function:

◆ get()

uint64_t catapult::io::IndexFile::get ( ) const

Gets the index value.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ increment()

uint64_t catapult::io::IndexFile::increment ( )

Increments the index value by one and returns the new value.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ open()

RawFile catapult::io::IndexFile::open ( OpenMode  mode) const
private
Here is the caller graph for this function:

◆ set()

void catapult::io::IndexFile::set ( uint64_t  value)

Sets the index value to value.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ m_filename

std::string catapult::io::IndexFile::m_filename
private

◆ m_lockMode

LockMode catapult::io::IndexFile::m_lockMode
private

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