Commit a9ecd155 authored by Ivan Donchevskiy's avatar Ivan Donchevskiy

Some private members changed to protected in CycleStorage

parent 9bcba674
...@@ -119,10 +119,13 @@ class CycleStorage ...@@ -119,10 +119,13 @@ class CycleStorage
void* ViewRow(int num, void* str); void* ViewRow(int num, void* str);
bool ExportToXML(const char* name); bool ExportToXML(const char* name);
int GetIter(void); int GetIter(void);
private: protected:
FILE *file; FILE *file;
int size,seekpos, inf_size,iter; int inf_size;
int head,tail,full_size; int head,tail;
private:
int size,seekpos, iter;
int full_size;
void filewrite(CycleStorageElem* jrn,int seek, bool needflush=true); void filewrite(CycleStorageElem* jrn,int seek, bool needflush=true);
void* ValPointer(void* pnt); void* ValPointer(void* pnt);
}; };
......
...@@ -350,7 +350,7 @@ bool CycleStorage::DelAllRows() ...@@ -350,7 +350,7 @@ bool CycleStorage::DelAllRows()
void* CycleStorage::ViewRow(int num, void* str) void* CycleStorage::ViewRow(int num, void* str)
{ {
int j=(head+num)%size; int j=(head+num)%size;
if((file==NULL)||(num>size)) return false; if((file==NULL)||(num>size)) return 0;
CycleStorageElem *jrn = (CycleStorageElem*)new char[full_size]; CycleStorageElem *jrn = (CycleStorageElem*)new char[full_size];
fseek(file,seekpos+j*full_size,0); fseek(file,seekpos+j*full_size,0);
fread(jrn,full_size,1,file); fread(jrn,full_size,1,file);
......
...@@ -298,8 +298,6 @@ bool TableBlockStorage::DelRow(void* key) ...@@ -298,8 +298,6 @@ bool TableBlockStorage::DelRow(void* key)
{ {
mem[i]->count=++max; mem[i]->count=++max;
memset(KeyPointer(i),0,k_size); memset(KeyPointer(i),0,k_size);
//for(int k=0;k<k_size;k++)
// *((char*)KeyPointer(i)+k)=0;
filewrite(i); filewrite(i);
return true; return true;
} }
...@@ -323,3 +321,8 @@ void* TableBlockStorage::FindKeyValue(void* key, void* val) ...@@ -323,3 +321,8 @@ void* TableBlockStorage::FindKeyValue(void* key, void* val)
return false; return false;
} }
int TableBlockStorage::GetCurBlock()
{
return cur_block;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment