diff options
author | Mike Buland <eichlan@xagasoft.com> | 2008-07-02 03:12:36 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2008-07-02 03:12:36 +0000 |
commit | aa6471979556621151592e147be81ce940558e55 (patch) | |
tree | 487b0fade53903d32a6780fe285caa5de463a9eb /src/nids.h | |
parent | a153962ffe93e70f2419efeab904b515c99c2eda (diff) | |
download | libbu++-aa6471979556621151592e147be81ce940558e55.tar.gz libbu++-aa6471979556621151592e147be81ce940558e55.tar.bz2 libbu++-aa6471979556621151592e147be81ce940558e55.tar.xz libbu++-aa6471979556621151592e147be81ce940558e55.zip |
Caching is coming together nicely, as well as the new nids system...or
whatever it'll be called later...
Diffstat (limited to 'src/nids.h')
-rw-r--r-- | src/nids.h | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/nids.h b/src/nids.h new file mode 100644 index 0000000..9954146 --- /dev/null +++ b/src/nids.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef BU_NIDS_H | ||
2 | #define BU_NIDS_H | ||
3 | |||
4 | namespace Bu | ||
5 | { | ||
6 | class Stream; | ||
7 | |||
8 | /** | ||
9 | * Numerically Indexed Data Streams. This is a working name so I can | ||
10 | * actually get some code written instead of agonizing over the name. | ||
11 | * | ||
12 | * This is a system for creating streams that contain other streams in | ||
13 | * a flexible block-allocated system. | ||
14 | */ | ||
15 | class Nids | ||
16 | { | ||
17 | public: | ||
18 | Nids( Bu::Stream &sStore ); | ||
19 | virtual ~Nids(); | ||
20 | |||
21 | /** | ||
22 | * Create a new Nids system in the assosiated stream. This should be | ||
23 | * used carefully, it will destroy all data already within the stream. | ||
24 | * More options will probably be added soon. | ||
25 | */ | ||
26 | void initialize( int iBlockSize, int iPreAllocate=1 ); | ||
27 | |||
28 | /** | ||
29 | * Create a new stream within the Nids system. The ID of the new stream | ||
30 | * is returned. | ||
31 | */ | ||
32 | int createStream( int iPreAllocate=1 ); | ||
33 | |||
34 | /** | ||
35 | * Delete a stream that's already within the Nids. | ||
36 | */ | ||
37 | void deleteStream( int iID ); | ||
38 | |||
39 | /** | ||
40 | * Return a new Stream object assosiated with the given stream ID. | ||
41 | */ | ||
42 | Bu::Stream &openStream( int iID ); | ||
43 | |||
44 | private: | ||
45 | Bu::Stream &sStore; | ||
46 | }; | ||
47 | }; | ||
48 | |||
49 | #endif | ||