Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
U
uniset2
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
UniSet project repositories
uniset2
Commits
c9927aaa
Commit
c9927aaa
authored
Jul 29, 2009
by
Ivan Donchevskiy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
\include Comments for Storages.h
parent
80a9435e
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
43 additions
and
0 deletions
+43
-0
Storages.h
include/Storages.h
+43
-0
No files found.
include/Storages.h
View file @
c9927aaa
...
@@ -36,28 +36,33 @@
...
@@ -36,28 +36,33 @@
#define key_size 20
#define key_size 20
/*! TableBlockStorage */
struct
StorageAttr
struct
StorageAttr
{
{
int
k_size
,
inf_size
,
size
,
block_number
;
int
k_size
,
inf_size
,
size
,
block_number
;
int
lim
,
seekpos
;
int
lim
,
seekpos
;
}
__attribute__
((
__packed__
));
}
__attribute__
((
__packed__
));
/*! CycleStorage */
struct
CycleStorageAttr
struct
CycleStorageAttr
{
{
int
size
,
inf_size
,
seekpos
;
int
size
,
inf_size
,
seekpos
;
}
__attribute__
((
__packed__
));
}
__attribute__
((
__packed__
));
/*! TableStorage */
struct
TableStorageElem
struct
TableStorageElem
{
{
char
status
;
char
status
;
char
key
[
key_size
];
char
key
[
key_size
];
}
__attribute__
((
__packed__
));
}
__attribute__
((
__packed__
));
/*! TableBlockStorage */
struct
TableBlockStorageElem
struct
TableBlockStorageElem
{
{
int
count
;
int
count
;
}
__attribute__
((
__packed__
));
}
__attribute__
((
__packed__
));
/*! CycleStorage */
struct
CycleStorageElem
struct
CycleStorageElem
{
{
char
status
;
char
status
;
...
@@ -79,14 +84,32 @@ class TableStorage
...
@@ -79,14 +84,32 @@ class TableStorage
class
TableBlockStorage
class
TableBlockStorage
{
{
public
:
public
:
/*! */
TableBlockStorage
();
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
(
const
char
*
name
,
int
key_sz
,
int
inf_sz
,
int
sz
,
int
block_num
,
int
block_lim
,
int
seek
,
bool
create
=
false
);
~
TableBlockStorage
();
~
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
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
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
AddRow
(
void
*
key
,
void
*
val
);
/*! , , */
bool
DelRow
(
void
*
key
);
bool
DelRow
(
void
*
key
);
/*! , 0 */
void
*
FindKeyValue
(
void
*
key
,
void
*
val
);
void
*
FindKeyValue
(
void
*
key
,
void
*
val
);
/*! ( ) */
int
GetCurBlock
(
void
);
int
GetCurBlock
(
void
);
protected
:
protected
:
FILE
*
file
;
FILE
*
file
;
...
@@ -106,16 +129,36 @@ class TableBlockStorage
...
@@ -106,16 +129,36 @@ class TableBlockStorage
class
CycleStorage
class
CycleStorage
{
{
public
:
public
:
/*! */
CycleStorage
();
CycleStorage
();
/*! Open, create=true
*/
CycleStorage
(
const
char
*
name
,
int
inf_sz
,
int
sz
,
int
seek
,
bool
create
=
false
);
CycleStorage
(
const
char
*
name
,
int
inf_sz
,
int
sz
,
int
seek
,
bool
create
=
false
);
~
CycleStorage
();
~
CycleStorage
();
/*! inf_sz - , sz - ,
seek - ( , ) */
bool
Open
(
const
char
*
name
,
int
inf_sz
,
int
sz
,
int
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
Create
(
const
char
*
name
,
int
inf_sz
,
int
sz
,
int
seek
);
/*! */
bool
AddRow
(
void
*
str
);
bool
AddRow
(
void
*
str
);
/*! row */
bool
DelRow
(
int
row
);
bool
DelRow
(
int
row
);
/*! *?
bool DelAllRows(void);
bool DelAllRows(void);
/*! num */
void
*
ViewRow
(
int
num
,
void
*
str
);
void
*
ViewRow
(
int
num
,
void
*
str
);
/*! Xml- name */
bool
ExportToXML
(
const
char
*
name
);
bool
ExportToXML
(
const
char
*
name
);
/*! - / ( ) */
int
GetIter
(
void
);
int
GetIter
(
void
);
protected
:
protected
:
FILE
*
file
;
FILE
*
file
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment