YPC  0.2.0
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
ypc::blockfile< MagicNumber_t, BlockNumLimit_t, BlockSizeLimit_t > Class Template Reference
Collaboration diagram for ypc::blockfile< MagicNumber_t, BlockNumLimit_t, BlockSizeLimit_t >:
Collaboration graph
[legend]

Classes

struct  block_info
 
struct  header
 

Public Member Functions

 blockfile (const blockfile &)=delete
 
 blockfile (blockfile &&)=delete
 
blockfileoperator= (const blockfile &)=delete
 
blockfileoperator= (blockfile &&)=delete
 
void open_for_read (const char *file_path)
 
void open_for_write (const char *file_path)
 
template<typename ByteType >
int append_item (const ByteType *data, size_t len)
 
int append_item (const char *data, size_t len)
 
void reset_read_item ()
 
bool next_item (memref &s)
 
uint64_t item_number ()
 
void close ()
 

Static Public Attributes

const static uint64_t MagicNumber = MagicNumber_t
 
const static uint64_t BlockSizeLimit = BlockSizeLimit_t
 
const static uint64_t BlockNumLimit = BlockNumLimit_t
 

Protected Member Functions

void read_header ()
 
void read_all_block_info ()
 

Protected Attributes

std::fstream m_file
 
std::string m_file_path
 
header m_header
 
bool m_is_header_valid
 
bool m_is_block_info_valid
 
std::vector< block_infom_block_infos
 

Static Protected Attributes

const static long int block_start_offset
 

Member Data Documentation

◆ block_start_offset

template<uint64_t MagicNumber_t, uint64_t BlockNumLimit_t, uint64_t BlockSizeLimit_t>
const static long int ypc::blockfile< MagicNumber_t, BlockNumLimit_t, BlockSizeLimit_t >::block_start_offset
staticprotected
Initial value:
=
sizeof(header) + sizeof(block_info) * BlockNumLimit

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