xapian-core  1.4.27
Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
GlassFreeList Class Reference

#include <glass_freelist.h>

+ Collaboration diagram for GlassFreeList:

Public Member Functions

 GlassFreeList ()
 
void reset ()
 
 ~GlassFreeList ()
 
bool empty () const
 
uint4 get_block (const GlassTable *B, uint4 block_size, uint4 *blk_to_free=NULL)
 
uint4 walk (const GlassTable *B, uint4 block_size, bool inclusive)
 
void mark_block_unused (const GlassTable *B, uint4 block_size, uint4 n)
 
uint4 get_revision () const
 
void set_revision (uint4 revision_)
 
uint4 get_first_unused_block () const
 
void set_first_unused_block (uint4 base)
 
void commit (const GlassTable *B, uint4 block_size)
 
void pack (std::string &buf)
 
bool unpack (const char **pstart, const char *end)
 
bool unpack (const std::string &s)
 

Protected Attributes

uint4 revision
 
uint4 first_unused_block
 
GlassFLCursor fl
 
GlassFLCursor fl_end
 
GlassFLCursor flw
 
bool flw_appending
 

Private Member Functions

 GlassFreeList (const GlassFreeList &)
 
void operator= (const GlassFreeList &)
 
void read_block (const GlassTable *B, uint4 n, uint8_t *p)
 
void write_block (const GlassTable *B, uint4 n, uint8_t *p, uint4 rev)
 

Private Attributes

uint8_t * p
 Current freelist block. More...
 
uint8_t * pw
 Current freelist block we're writing. More...
 

Detailed Description

Definition at line 66 of file glass_freelist.h.

Constructor & Destructor Documentation

◆ GlassFreeList() [1/2]

GlassFreeList::GlassFreeList ( const GlassFreeList )
private

◆ GlassFreeList() [2/2]

GlassFreeList::GlassFreeList ( )
inline

Definition at line 92 of file glass_freelist.h.

◆ ~GlassFreeList()

GlassFreeList::~GlassFreeList ( )
inline

Definition at line 105 of file glass_freelist.h.

Member Function Documentation

◆ commit()

void GlassFreeList::commit ( const GlassTable B,
uint4  block_size 
)

◆ empty()

bool GlassFreeList::empty ( ) const
inline

Definition at line 107 of file glass_freelist.h.

◆ get_block()

uint4 GlassFreeList::get_block ( const GlassTable B,
uint4  block_size,
uint4 blk_to_free = NULL 
)

◆ get_first_unused_block()

uint4 GlassFreeList::get_first_unused_block ( ) const
inline

◆ get_revision()

uint4 GlassFreeList::get_revision ( ) const
inline

Definition at line 116 of file glass_freelist.h.

References Xapian::revision().

◆ mark_block_unused()

void GlassFreeList::mark_block_unused ( const GlassTable B,
uint4  block_size,
uint4  n 
)

◆ operator=()

void GlassFreeList::operator= ( const GlassFreeList )
private

◆ pack()

void GlassFreeList::pack ( std::string &  buf)
inline

Definition at line 126 of file glass_freelist.h.

References GlassFLCursor::pack(), and pack_uint().

Referenced by GlassTable::commit(), and GlassDatabase::compact().

◆ read_block()

void GlassFreeList::read_block ( const GlassTable B,
uint4  n,
uint8_t *  p 
)
private

Definition at line 67 of file glass_freelist.cc.

References GET_LEVEL(), Glass::LEVEL_FREELIST, rare, and GlassTable::read_block().

Referenced by GlassTable::get_path().

◆ reset()

void GlassFreeList::reset ( )
inline

Definition at line 99 of file glass_freelist.h.

Referenced by GlassTable::cancel().

◆ set_first_unused_block()

void GlassFreeList::set_first_unused_block ( uint4  base)
inline

Definition at line 122 of file glass_freelist.h.

Referenced by GlassDatabase::compact().

◆ set_revision()

void GlassFreeList::set_revision ( uint4  revision_)
inline

Definition at line 117 of file glass_freelist.h.

Referenced by GlassTable::commit().

◆ unpack() [1/2]

bool GlassFreeList::unpack ( const char **  pstart,
const char *  end 
)
inline

Definition at line 133 of file glass_freelist.h.

References GlassFLCursor::unpack(), and unpack_uint().

Referenced by GlassTable::cancel().

◆ unpack() [2/2]

bool GlassFreeList::unpack ( const std::string &  s)
inline

Definition at line 145 of file glass_freelist.h.

References GlassFLCursor::unpack().

◆ walk()

uint4 GlassFreeList::walk ( const GlassTable B,
uint4  block_size,
bool  inclusive 
)

Definition at line 140 of file glass_freelist.cc.

References aligned_read4(), Assert, C_BASE, FREELIST_END, and UNUSED.

◆ write_block()

void GlassFreeList::write_block ( const GlassTable B,
uint4  n,
uint8_t *  p,
uint4  rev 
)
private

Member Data Documentation

◆ first_unused_block

uint4 GlassFreeList::first_unused_block
protected

Definition at line 78 of file glass_freelist.h.

◆ fl

GlassFLCursor GlassFreeList::fl
protected

Definition at line 80 of file glass_freelist.h.

◆ fl_end

GlassFLCursor GlassFreeList::fl_end
protected

Definition at line 80 of file glass_freelist.h.

◆ flw

GlassFLCursor GlassFreeList::flw
protected

Definition at line 80 of file glass_freelist.h.

◆ flw_appending

bool GlassFreeList::flw_appending
protected

Definition at line 82 of file glass_freelist.h.

◆ p

uint8_t* GlassFreeList::p
private

Current freelist block.

Definition at line 86 of file glass_freelist.h.

◆ pw

uint8_t* GlassFreeList::pw
private

Current freelist block we're writing.

Definition at line 89 of file glass_freelist.h.

◆ revision

uint4 GlassFreeList::revision
protected

Definition at line 76 of file glass_freelist.h.


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