Commit c9927aaa authored by Ivan Donchevskiy's avatar Ivan Donchevskiy

\include Comments for Storages.h

parent 80a9435e
......@@ -36,28 +36,33 @@
#define key_size 20
/*! TableBlockStorage */
struct StorageAttr
{
int k_size, inf_size,size,block_number;
int lim, seekpos;
} __attribute__((__packed__));
/*! CycleStorage */
struct CycleStorageAttr
{
int size, inf_size, seekpos;
} __attribute__((__packed__));
/*! TableStorage */
struct TableStorageElem
{
char status;
char key[key_size];
} __attribute__((__packed__));
/*! TableBlockStorage */
struct TableBlockStorageElem
{
int count;
} __attribute__((__packed__));
/*! CycleStorage */
struct CycleStorageElem
{
char status;
......@@ -79,14 +84,32 @@ class TableStorage
class TableBlockStorage
{
public:
/*! */
TableBlockStorage();
/*! Open, create=true
*/
TableBlockStorage(const char* name, int key_sz, int inf_sz, int sz, int block_num, int block_lim, int seek, bool create=false);
~TableBlockStorage();
/*! inf_sz - , key_sz - , sz -
block_num - - ( = sz/block_num
, ), block_lim - ,
seek - ( , ) */
bool Open(const char* name, int inf_sz, int key_sz, int sz, int block_num, int block_lim, int seek);
bool Create(const char* name, int inf_sz, int key_sz, int sz, int block_num, int block_lim, int seek);
/*! , */
bool AddRow(void* key, void* val);
/*! , , */
bool DelRow(void* key);
/*! , 0 */
void* FindKeyValue(void* key, void* val);
/*! ( ) */
int GetCurBlock(void);
protected:
FILE *file;
......@@ -106,16 +129,36 @@ class TableBlockStorage
class CycleStorage
{
public:
/*! */
CycleStorage();
/*! Open, create=true
*/
CycleStorage(const char* name, int inf_sz, int sz, int seek,bool create=false);
~CycleStorage();
/*! inf_sz - , sz - ,
seek - ( , ) */
bool Open(const char* name, int inf_sz, int sz, int seek);
bool Create(const char* name, int inf_sz, int sz, int seek);
/*! */
bool AddRow(void* str);
/*! row */
bool DelRow(int row);
/*! *?
bool DelAllRows(void);
/*! num */
void* ViewRow(int num, void* str);
/*! Xml- name */
bool ExportToXML(const char* name);
/*! - / ( ) */
int GetIter(void);
protected:
FILE *file;
......
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