Tkrzw
Public Member Functions | List of all members
tkrzw::SkipRecordCache Class Reference

Cache of skip records. More...

#include <tkrzw_dbm_skip_impl.h>

Public Member Functions

 SkipRecordCache (int32_t step_unit, int32_t capacity, int64_t num_records)
 Constructor. More...
 
 ~SkipRecordCache ()
 Destructor. More...
 
bool PrepareRecord (int64_t index, SkipRecord *record)
 Prepare a record by reading the cache. More...
 
void Add (const SkipRecord &record)
 Add a record to the cache. More...
 

Detailed Description

Cache of skip records.

Constructor & Destructor Documentation

◆ SkipRecordCache()

tkrzw::SkipRecordCache::SkipRecordCache ( int32_t  step_unit,
int32_t  capacity,
int64_t  num_records 
)

Constructor.

Parameters
step_unitThe unit of stepping.
capacityThe maximum number of records to contain.
num_recordsThe number of records in the database.

◆ ~SkipRecordCache()

tkrzw::SkipRecordCache::~SkipRecordCache ( )

Destructor.

Member Function Documentation

◆ PrepareRecord()

bool tkrzw::SkipRecordCache::PrepareRecord ( int64_t  index,
SkipRecord record 
)

Prepare a record by reading the cache.

Parameters
indexThe index of the record.
recordThe pointer to the record object.
Returns
True on success or false onfailure.

◆ Add()

void tkrzw::SkipRecordCache::Add ( const SkipRecord record)

Add a record to the cache.

Parameters
recordThe record to store.