22 #ifndef XAPIAN_INCLUDED_GLASS_FREELIST_H
23 #define XAPIAN_INCLUDED_GLASS_FREELIST_H
41 return n == o.
n &&
c == o.
c;
53 void pack(std::string & buf) {
58 bool unpack(
const char ** p,
const char * end) {
110 uint4 * blk_to_free = NULL);
133 bool unpack(
const char ** pstart,
const char * end) {
146 const char * ptr = s.data();
147 const char * end = ptr + s.size();
148 return unpack(&ptr, end) && ptr == end;
172 const unsigned BITS_PER_ELT =
sizeof(
elt_type) * 8;
176 if ((
bitmap[n] & mask) == 0)
return false;
bool unpack(const char **p, const char *end)
void pack(std::string &buf)
uint4 n
Block number of current freelist chunk.
bool operator!=(const GlassFLCursor &o) const
void swap(GlassFLCursor &o)
unsigned c
Current offset in block.
bool operator==(const GlassFLCursor &o) const
GlassFreeListChecker(const GlassFreeListChecker &)
GlassFreeListChecker & operator=(const GlassFreeListChecker &)
uint4 count_set_bits(uint4 *p_first_bad_blk) const
Count how many bits are still set.
void set_first_unused_block(uint4 base)
void operator=(const GlassFreeList &)
void pack(std::string &buf)
void write_block(const GlassTable *B, uint4 n, uint8_t *p, uint4 rev)
GlassFreeList(const GlassFreeList &)
uint8_t * pw
Current freelist block we're writing.
uint4 get_first_unused_block() const
bool unpack(const std::string &s)
void mark_block_unused(const GlassTable *B, uint4 block_size, uint4 n)
uint4 walk(const GlassTable *B, uint4 block_size, bool inclusive)
void set_revision(uint4 revision_)
void commit(const GlassTable *B, uint4 block_size)
void read_block(const GlassTable *B, uint4 n, uint8_t *p)
uint8_t * p
Current freelist block.
bool unpack(const char **pstart, const char *end)
uint4 get_block(const GlassTable *B, uint4 block_size, uint4 *blk_to_free=NULL)
uint4 get_revision() const
Class managing a Btree table in a Glass database.
Definitions, types, etc for use inside glass.
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Pack types into strings and unpack them again.
bool unpack_uint(const char **p, const char *end, U *result)
Decode an unsigned integer from a string.
void pack_uint(std::string &s, U value)
Append an encoded unsigned integer to a string.