Definition at line 177 of file block_log.cpp.
◆ index_writer()
sysio::chain::detail::index_writer::index_writer |
( |
const fc::path & | block_index_name, |
|
|
uint32_t | blocks_expected ) |
Definition at line 1139 of file block_log.cpp.
1140 : _blocks_remaining(blocks_expected) {
1141 const size_t file_sz = blocks_expected*
sizeof(
uint64_t);
1142
1146 file.close();
1147
1149 _file.emplace(block_index_name.
string().c_str(), boost::interprocess::read_write);
1150 _mapped_file_region.emplace(*_file, boost::interprocess::read_write);
1151 }
void set_file_path(fc::path file_path)
std::string string() const
void resize_file(const path &file, size_t s)
unsigned __int64 uint64_t
◆ write()
void sysio::chain::detail::index_writer::write |
( |
uint64_t | pos | ) |
|
Definition at line 1153 of file block_log.cpp.
1153 {
1154 SYS_ASSERT( _blocks_remaining, block_log_exception,
"No more blocks were expected for the block log index" );
1155
1156 char* base = (char*)_mapped_file_region->get_address();
1157 base += --_blocks_remaining*
sizeof(
uint64_t);
1158 memcpy(base, &pos,
sizeof(pos));
1159
1160 if ((_blocks_remaining & 0xfffff) == 0)
1161 ilog(
"blocks remaining to index: ${blocks_left} position in log file: ${pos}", (
"blocks_left", _blocks_remaining)(
"pos",pos));
1162 }
#define SYS_ASSERT(expr, exc_type, FORMAT,...)
memcpy((char *) pInfo->slotDescription, s, l)
The documentation for this class was generated from the following file: