From aa6471979556621151592e147be81ce940558e55 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Wed, 2 Jul 2008 03:12:36 +0000 Subject: Caching is coming together nicely, as well as the new nids system...or whatever it'll be called later... --- src/cachehandler.cpp | 2 ++ src/cachehandler.h | 18 ++++++++++++++++++ src/cacheptr.cpp | 0 src/cacheptr.h | 0 src/nids.cpp | 21 +++++++++++++++++++++ src/nids.h | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ src/nidsstream.cpp | 10 ++++++++++ src/nidsstream.h | 18 ++++++++++++++++++ 8 files changed, 118 insertions(+) create mode 100644 src/cachehandler.cpp create mode 100644 src/cachehandler.h create mode 100644 src/cacheptr.cpp create mode 100644 src/cacheptr.h create mode 100644 src/nids.cpp create mode 100644 src/nids.h create mode 100644 src/nidsstream.cpp create mode 100644 src/nidsstream.h (limited to 'src') diff --git a/src/cachehandler.cpp b/src/cachehandler.cpp new file mode 100644 index 0000000..d208e98 --- /dev/null +++ b/src/cachehandler.cpp @@ -0,0 +1,2 @@ +#include "bu/cachehandler.h" + diff --git a/src/cachehandler.h b/src/cachehandler.h new file mode 100644 index 0000000..8841b4e --- /dev/null +++ b/src/cachehandler.h @@ -0,0 +1,18 @@ +#ifndef BU_CACHE_HANDLER_H +#define BU_CACHE_HANDLER_H + +namespace Bu +{ + template + class CacheHandler + { + public: + CacheHandler(); + virtual ~CacheHandler(); + + forceLoad() + private: + }; +}; + +#endif diff --git a/src/cacheptr.cpp b/src/cacheptr.cpp new file mode 100644 index 0000000..e69de29 diff --git a/src/cacheptr.h b/src/cacheptr.h new file mode 100644 index 0000000..e69de29 diff --git a/src/nids.cpp b/src/nids.cpp new file mode 100644 index 0000000..b8ea13b --- /dev/null +++ b/src/nids.cpp @@ -0,0 +1,21 @@ +#include "bu/nids.h" + +Bu::Nids::Nids( Bu::Stream &sStore ) : + sStore( sStore ) +{ +} + +Bu::Nids::~Nids() +{ +} + +void Bu::Nids::initialize( int iBlockSize, int iPreAllocate ) +{ +} + +int Bu::Nids::createStream( int iPreAllocate ) +{ + return 0; +} + + 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 @@ +#ifndef BU_NIDS_H +#define BU_NIDS_H + +namespace Bu +{ + class Stream; + + /** + * Numerically Indexed Data Streams. This is a working name so I can + * actually get some code written instead of agonizing over the name. + * + * This is a system for creating streams that contain other streams in + * a flexible block-allocated system. + */ + class Nids + { + public: + Nids( Bu::Stream &sStore ); + virtual ~Nids(); + + /** + * Create a new Nids system in the assosiated stream. This should be + * used carefully, it will destroy all data already within the stream. + * More options will probably be added soon. + */ + void initialize( int iBlockSize, int iPreAllocate=1 ); + + /** + * Create a new stream within the Nids system. The ID of the new stream + * is returned. + */ + int createStream( int iPreAllocate=1 ); + + /** + * Delete a stream that's already within the Nids. + */ + void deleteStream( int iID ); + + /** + * Return a new Stream object assosiated with the given stream ID. + */ + Bu::Stream &openStream( int iID ); + + private: + Bu::Stream &sStore; + }; +}; + +#endif diff --git a/src/nidsstream.cpp b/src/nidsstream.cpp new file mode 100644 index 0000000..d05fbc0 --- /dev/null +++ b/src/nidsstream.cpp @@ -0,0 +1,10 @@ +#include "bu/nidsstream.h" + +Bu::NidsStream::NidsStream() +{ +} + +Bu::NidsStream::~NidsStream() +{ +} + diff --git a/src/nidsstream.h b/src/nidsstream.h new file mode 100644 index 0000000..08b45eb --- /dev/null +++ b/src/nidsstream.h @@ -0,0 +1,18 @@ +#ifndef BU_NIDS_STREAM_H +#define BU_NIDS_STREAM_H + +#include "bu/stream.h" + +namespace Bu +{ + class NidsStream : public Bu::Stream + { + public: + NidsStream(); + virtual ~NidsStream(); + + private: + }; +}; + +#endif -- cgit v1.2.3