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) {
94 first_unused_block = 0;
95 flw_appending =
false;
101 first_unused_block = 0;
102 flw_appending =
false;
107 bool empty()
const {
return fl == fl_end; }
110 uint4 * blk_to_free = NULL);
133 bool unpack(
const char ** pstart,
const char * end) {
140 flw_appending =
false;
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;
173 elt_type mask =
static_cast<elt_type
>(1) << (n & (BITS_PER_ELT - 1));
175 if (
rare(n >= bitmap_size))
return false;
176 if ((bitmap[n] & mask) == 0)
return false;
182 uint4 count_set_bits(
uint4 * p_first_bad_blk)
const;
185 #endif // XAPIAN_INCLUDED_GLASS_FREELIST_H
XAPIAN_REVISION_TYPE rev
Revision number of a database.
Class managing a Btree table in a Glass database.
Definitions, types, etc for use inside glass.
int revision()
Report the revision of the library which the program is linked with.
bool operator==(const GlassFLCursor &o) const
uint8_t * p
Current freelist block.
bool operator!=(const GlassFLCursor &o) const
uint4 get_first_unused_block() const
void set_revision(uint4 revision_)
bool unpack(const char **pstart, const char *end)
bool unpack(const std::string &s)
void pack_uint(std::string &s, U value)
Append an encoded unsigned integer to a string.
void pack(std::string &buf)
bool unpack(const char **p, const char *end)
uint4 n
Block number of current freelist chunk.
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(std::string &buf)
unsigned c
Current offset in block.
uint4 get_revision() const
void swap(GlassFLCursor &o)
void set_first_unused_block(uint4 base)
uint8_t * pw
Current freelist block we're writing.