3 #ifndef __DbBufStorage_H
4 #define __DbBufStorage_H
15 #include <mix/trans.h>
17 #include <mix/DynAr.H>
18 #include <mix/IntAr.H>
19 #include <mix/LongAr.H>
21 #include <ldb/DbTableTypes.H>
49 #define DB_CLUSTER_START_VOLUME 20
53 #define DB_CLUSTER_DEFAULT_QUANT 20
58 #define DB_CLUSTER_LIMIT_SIZE (200*1024)
85 void add_items (DbIndex nCount, DbIndex* pLocal,
86 Logic* bSequent = NULL);
106 Logic slot_is_empty (DbIndex iLocal)
const;
109 void slot_usage (DbIndex iLocal, Logic bUsed);
236 #define AnyAr DbLineEntries
237 #define AnyType DbLineEntry
238 #define AnyFormatSpec "\n\t%d: %s, %s, data location=(%p %u), access id=%u"
239 #define AnyPrintList i, item.get_loaded()? "loaded": "not loaded", \
240 item.get_changed()? "changed": "not changed", \
241 item.pDataClu, item.iLocalIndex, item.iAccessId
242 #define AnyPrintf fprintf(stderr,
243 #include <mix/AnyAr.H>
255 #define AnyAr DbDataClusters
256 #define AnyType DbDataClusterPtr
257 #define AnyPrintItem item->print_self()
258 #include <mix/AnyAr.H>
303 void insert_line (DbIndex line, DbIndex lines_cnt);
340 void allocate_lines (
const DbIndex* pIndeces,
unsigned nIndeces);
343 DbLineEntries letable;
346 DbDataClusters dclist;
352 unsigned nLinesLimit;
376 return letable.count();
DbDataCluster * pDataClu
Definition: DbBufStorage.H:166
unsigned iAccessId
Definition: DbBufStorage.H:176
void insert_line(DbIndex line, DbIndex lines_cnt)
void add_items(DbIndex nCount, DbIndex *pLocal, Logic *bSequent=NULL)
DbLineEntry & operator[](DbIndex line) const
Definition: DbBufStorage.H:384
static void good_line_range(DbIndex line1, DbIndex line2, DbIndex line[2])
void sequent_lines(DbIndex line1, DbIndex line2, DbIndexAr &arLine, DbIndexAr &arCnt) const
Logic get_loaded() const
Definition: DbBufStorage.H:195
void change_lines(DbIndex line1, DbIndex line2)
DbIndex iLocalIndex
Definition: DbBufStorage.H:169
void * data_item(DbIndex iLocal) const
DbDataCluster(unsigned nItemSize, DbIndex nStartVolume=DB_CLUSTER_START_VOLUME)
UIntAr DbIndexAr
Definition: DbBufStorage.H:265
Definition: DbBufStorage.H:275
Definition: DbBufStorage.H:67
void exchange_lines(DbIndex line1, DbIndex line2)
void * line_pointer(DbIndex line) const
Definition: DbBufStorage.H:132
void set_loaded(Logic bFlag)
Definition: DbBufStorage.H:205
DbIndex empty_slots() const
DbBufStorage(unsigned nItemSize)
DbLineEntry & operator=(const DbLineEntry &rLEntry)
DbDataCluster * DbDataClusterPtr
Definition: DbBufStorage.H:253
#define DB_CLUSTER_START_VOLUME
Definition: DbBufStorage.H:49
DbIndex total_slots() const
void set_changed(Logic bFlag)
Definition: DbBufStorage.H:225
void remove_lines(DbIndex line1, DbIndex line2)
DbIndex max_lines_in_cluster() const
void release_items(DbIndex nCount, const DbIndex *pLocal)
Logic get_changed() const
Definition: DbBufStorage.H:215
DbIndex lines_count() const
Definition: DbBufStorage.H:374
void preload_lines(DbIndex line1, DbIndex line2)
void set_item_size(unsigned nItemSize)