From 26aa4bd668a2f2358b03634bce78c58085f14164 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Sat, 25 May 2019 23:04:09 -0700 Subject: Started work on the SharedCore BlobBuilder. This will contain everything that made Bu::String flexible and fast when building, and a nightmare for multi-threaded programming. --- src/unstable/blobbuilder.h | 53 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) (limited to 'src/unstable/blobbuilder.h') diff --git a/src/unstable/blobbuilder.h b/src/unstable/blobbuilder.h index 73271f8..8cc2a24 100644 --- a/src/unstable/blobbuilder.h +++ b/src/unstable/blobbuilder.h @@ -5,4 +5,57 @@ * terms of the license contained in the file LICENSE. */ +#ifndef BU_BLOB_BUILDER_H +#define BU_BLOB_BUILDER_H +#include "bu/config.h" +#include "bu/sharedcore.h" + +namespace Bu +{ + class BlobBuilder; + + class BlobBuilderCore + { + friend class BlobBuilder; + friend class SharedCore; + private: + class Chunk + { + public: + Chunk(); + ~Chunk(); + + int16_t iFill; + int16_t iLength; + char *pData; + Chunk *pNext; + }; + + BlobBuilderCore(); + BlobBuilderCore( const BlobBuilderCore &rSrc ); + virtual ~BlobBuilderCore(); + + void clear(); + + Chunk *pFirst; + Chunk *pLast; + int32_t iLength; + }; + + class BlobBuilder : public Bu::SharedCore + { + protected: + using SharedCore::core; + using SharedCore::_hardCopy; + + public: + BlobBuilder(); + BlobBuilder( const BlobBuilder &rSrc ); + virtual ~BlobBuilder(); + + private: + }; +}; + +#endif -- cgit v1.2.3