Golos
Разработчикам Статистика Баунти Документация Партнеры Github
Public Member Functions | Static Public Attributes | List of all members
golos::chain::block_log Class Reference

#include <block_log.hpp>

Public Member Functions

 block_log ()
 
 ~block_log ()
 
void open (const fc::path &file)
 
void close ()
 
bool is_open () const
 
uint64_t append (const signed_block &b)
 
void flush ()
 
std::pair< signed_block, uint64_t > read_block (uint64_t file_pos) const
 
optional< signed_block > read_block_by_num (uint32_t block_num) const
 
uint64_t get_block_pos (uint32_t block_num) const
 
signed_block read_head () const
 
const optional< signed_block > & head () const
 

Static Public Attributes

static const uint64_t npos = std::numeric_limits<uint64_t>::max()
 

Detailed Description

Definition at line 38 of file block_log.hpp.

Constructor & Destructor Documentation

◆ block_log()

golos::chain::block_log::block_log ( )

Definition at line 59 of file block_log.cpp.

◆ ~block_log()

golos::chain::block_log::~block_log ( )

Definition at line 67 of file block_log.cpp.

Member Function Documentation

◆ append()

uint64_t golos::chain::block_log::append ( const signed_block &  b)

Definition at line 154 of file block_log.cpp.

◆ close()

void golos::chain::block_log::close ( )

Definition at line 146 of file block_log.cpp.

◆ flush()

void golos::chain::block_log::flush ( )

Definition at line 176 of file block_log.cpp.

◆ get_block_pos()

uint64_t golos::chain::block_log::get_block_pos ( uint32_t  block_num) const

Return offset of block in file, or block_log::npos if it does not exist.

Definition at line 205 of file block_log.cpp.

◆ head()

const optional< signed_block > & golos::chain::block_log::head ( ) const

Definition at line 228 of file block_log.cpp.

◆ is_open()

bool golos::chain::block_log::is_open ( ) const

Definition at line 150 of file block_log.cpp.

◆ open()

void golos::chain::block_log::open ( const fc::path &  file)

Definition at line 71 of file block_log.cpp.

◆ read_block()

std::pair< signed_block, uint64_t > golos::chain::block_log::read_block ( uint64_t  file_pos) const

Definition at line 181 of file block_log.cpp.

◆ read_block_by_num()

optional< signed_block > golos::chain::block_log::read_block_by_num ( uint32_t  block_num) const

Definition at line 191 of file block_log.cpp.

◆ read_head()

signed_block golos::chain::block_log::read_head ( ) const

Definition at line 219 of file block_log.cpp.

Member Data Documentation

◆ npos

const uint64_t golos::chain::block_log::npos = std::numeric_limits<uint64_t>::max()
static

Definition at line 67 of file block_log.hpp.


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