diff options
author | Mike Buland <eichlan@xagasoft.com> | 2019-05-25 23:04:09 -0700 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2019-05-25 23:04:09 -0700 |
commit | 26aa4bd668a2f2358b03634bce78c58085f14164 (patch) | |
tree | 49ddbcfec9af34e0a49d00614d7437c39988b7ef /src/unstable/blobbuilder.h | |
parent | 3a27454dca4a16d021a4d418f0725adccc5baabb (diff) | |
download | libbu++-26aa4bd668a2f2358b03634bce78c58085f14164.tar.gz libbu++-26aa4bd668a2f2358b03634bce78c58085f14164.tar.bz2 libbu++-26aa4bd668a2f2358b03634bce78c58085f14164.tar.xz libbu++-26aa4bd668a2f2358b03634bce78c58085f14164.zip |
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.
Diffstat (limited to 'src/unstable/blobbuilder.h')
-rw-r--r-- | src/unstable/blobbuilder.h | 53 |
1 files changed, 53 insertions, 0 deletions
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 @@ | |||
5 | * terms of the license contained in the file LICENSE. | 5 | * terms of the license contained in the file LICENSE. |
6 | */ | 6 | */ |
7 | 7 | ||
8 | #ifndef BU_BLOB_BUILDER_H | ||
9 | #define BU_BLOB_BUILDER_H | ||
8 | 10 | ||
11 | #include "bu/config.h" | ||
12 | #include "bu/sharedcore.h" | ||
13 | |||
14 | namespace Bu | ||
15 | { | ||
16 | class BlobBuilder; | ||
17 | |||
18 | class BlobBuilderCore | ||
19 | { | ||
20 | friend class BlobBuilder; | ||
21 | friend class SharedCore<BlobBuilder, BlobBuilderCore>; | ||
22 | private: | ||
23 | class Chunk | ||
24 | { | ||
25 | public: | ||
26 | Chunk(); | ||
27 | ~Chunk(); | ||
28 | |||
29 | int16_t iFill; | ||
30 | int16_t iLength; | ||
31 | char *pData; | ||
32 | Chunk *pNext; | ||
33 | }; | ||
34 | |||
35 | BlobBuilderCore(); | ||
36 | BlobBuilderCore( const BlobBuilderCore &rSrc ); | ||
37 | virtual ~BlobBuilderCore(); | ||
38 | |||
39 | void clear(); | ||
40 | |||
41 | Chunk *pFirst; | ||
42 | Chunk *pLast; | ||
43 | int32_t iLength; | ||
44 | }; | ||
45 | |||
46 | class BlobBuilder : public Bu::SharedCore<BlobBuilder, BlobBuilderCore> | ||
47 | { | ||
48 | protected: | ||
49 | using SharedCore<BlobBuilder, BlobBuilderCore>::core; | ||
50 | using SharedCore<BlobBuilder, BlobBuilderCore>::_hardCopy; | ||
51 | |||
52 | public: | ||
53 | BlobBuilder(); | ||
54 | BlobBuilder( const BlobBuilder &rSrc ); | ||
55 | virtual ~BlobBuilder(); | ||
56 | |||
57 | private: | ||
58 | }; | ||
59 | }; | ||
60 | |||
61 | #endif | ||