Create ClassForVlistCache.h
Add class KEY_SIZE_VALUE, used in database.cpp to find important subIDs and objIDs. Add class Longlist_inMem, used in Vlist as cache
This commit is contained in:
parent
9ca106ca7e
commit
0cd6b75026
|
@ -0,0 +1,33 @@
|
||||||
|
class KEY_SIZE_VALUE
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
unsigned key, size, value;
|
||||||
|
KEY_SIZE_VALUE(unsigned _key = 0, unsigned _size = 0, unsigned _value = 0) : key(_key), size(_size), value(_value) {}
|
||||||
|
bool operator < (const KEY_SIZE_VALUE& b) const
|
||||||
|
{
|
||||||
|
return value > b.value;
|
||||||
|
}
|
||||||
|
bool operator > (const KEY_SIZE_VALUE& b) const
|
||||||
|
{
|
||||||
|
return value < b.value;
|
||||||
|
}
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
class Longlist_inMem
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
int key;
|
||||||
|
unsigned _len;
|
||||||
|
char* _str;
|
||||||
|
Longlist_inMem()
|
||||||
|
{
|
||||||
|
key = -1;
|
||||||
|
_len = 0;
|
||||||
|
_str = NULL;
|
||||||
|
}
|
||||||
|
~Longlist_inMem()
|
||||||
|
{
|
||||||
|
if(_str != NULL) delete []_str;
|
||||||
|
}
|
||||||
|
};
|
Loading…
Reference in New Issue