add_to_free_list);
104 unsigned Remap(
unsigned id,
boolignore_free_list=
false);
118 boolignore_free_list=
false);
129 template<
classTBV>
137 template<
classTBV>
145 ERR_POST_XX(Db_Bdb_RangeMap, 1,
"Exception in ~CBDB_RangeMap()"<< ex.
GetMsg());
147 catch(exception& ex)
149 ERR_POST_XX(Db_Bdb_RangeMap, 2,
"Exception in ~CBDB_RangeMap()"<< ex.
what());
155 template<
classTBV>
167m_FreeList->clear(
true);
171 template<
classTBV>
179 returnUpdateInsert(
buf);
182 template<
classTBV>
186 booladd_to_free_list)
188 if(from == 0 && to == 0) {
189 BDB_THROW(eInvalidValue,
"0-0 range is reserved.");
192 BDB_THROW(eInvalidValue,
"Incorrect range values.");
204 unsignedfrom_db = this->FromId;
205 unsignedto_db = this->ToId;
209 if(from >= from_db && from <= to_db) {
211 "Range overlaps with the previous range.");
219 unsignedfrom_db = this->FromId;
220 unsignedto_db = this->ToId;
224 if(to >= from_db && to <= to_db) {
226 "Range overlaps with the next range.");
237 if(add_to_free_list) {
238m_FreeList->set_range(from, to,
true);
244 template<
classTBV>
247 if(!ignore_free_list) {
248 if(m_FreeList->test(
id)) {
262 unsignedfrom_id = this->FromId;
263 unsignedto_id = this->ToId;
264 if(from_id <=
id&&
id<= to_id) {
265 returndst + (
id- from_id);
271 template<
classTBV>
275 boolignore_free_list)
278 unsignedfrom_id, to_id, dst;
279from_id = to_id = dst = 0;
281 typenameTBV::enumerator en(bv_src.first());
282 for( ;en.valid(); ++en) {
284 if(!ignore_free_list) {
285 if(m_FreeList->test(
id)) {
290 if(from_id <=
id&&
id<= to_id) {
291bv_dst->set(dst + (
id- from_id));
293bv_remapped->set(
id);
300cur.
FetchFirst(&ptr,
sizeof(dst), eReallocForbidden);
302from_id = this->FromId;
304 if(from_id <=
id&&
id<= to_id) {
305bv_dst->set(dst + (
id- from_id));
307bv_remapped->set(
id);
BDB library BLOB support.
Berkeley BDB file cursor.
Berkeley DB BLOB File class.
Berkeley DB file cursor class.
Range map class, stores unsigned integer range mappings like 10 to 15 maps into 100 to 115.
TBitVector & GetFreeList()
EBDB_ErrCode AddRange(unsigned from, unsigned to, unsigned dest, bool add_to_free_list)
Add remapping range.
unsigned Remap(unsigned id, bool ignore_free_list=false)
Remap one single id.
CBDB_FieldUint4 FromId
From id.
const TBitVector & GetFreeList() const
Get list of free ids.
void LoadFreeList()
Load free list (Storage should be open first)
CBDB_FieldUint4 ToId
To id.
EBDB_ErrCode Save()
Save free list.
Reallocable memory buffer (no memory copy overhead) Mimics vector<>, without the overhead of explicit...
Include a standard set of the NCBI C++ Toolkit most basic headers.
EBDB_ErrCode ReadRealloc(TBuffer &buffer)
Read BLOB into vector.
void SetCondition(ECondition cond_from, ECondition cond_to=eNotSet)
Set search condition(type of interval)
EBDB_ErrCode FetchFirst()
void BindKey(const char *field_name, CBDB_Field *key_field, size_t buf_size=0)
EBDB_ErrCode
BDB Return codes.
CBDB_ConditionHandle From
#define BDB_THROW(errcode, message)
#define ERR_POST_XX(error_name, err_subcode, message)
Error posting with error code having given name and with given error subcode.
const string & GetMsg(void) const
Get message string.
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
@ BM_GAP
GAP compression is ON.
size_t deserialize(BV &bv, const unsigned char *buf, bm::word_t *temp_block=0, const bm::bv_ref_vector< BV > *ref_vect=0)
Bitvector deserialization from a memory BLOB.
Definition of all error codes used in bdb library (bdb.lib and ncbi_xcache_bdb.lib).
Compressed bitset (entry point to bm.h)
Bitset relates utilities.
void BV_Serialize(const TBV &bv, TBuffer &buf, bm::word_t *tmp_block=0, bool optimize_bv=false)
Serialize bitset into a vector<char> compatible buffer.
Defines NCBI C++ exception handling.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4