blob: a227ffc63931458b0cfffca8fc687e847796c555 [file] [log] [blame]
Zane Shelley871adec2019-07-30 11:01:39 -05001#pragma once
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -05002
Ben Tynera8126fd2019-08-01 19:40:07 -05003#include <stdint.h>
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -05004
Zane Shelley871adec2019-07-30 11:01:39 -05005namespace libhei
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -05006{
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -05007
8class BitStringBuffer;
9
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050010//##############################################################################
11// BitString class
12//##############################################################################
13
14/**
15 * A BitString is general purpose class providing the ability to manipulate
16 * individual bits within an allocated section of contiguous memory.
17 *
18 * A BitString does not "own" the memory, it only accesses and manipulates the
19 * bits in the range specified. Users will need to ensure memory is allocated
20 * and deallocated appropriately. As an alternative, a BitStringBuffer is a
21 * BitString that will allocate and maintain its own memory.
22 *
23 * The length of a BitString is only limited by the amount of memory that
24 * contains the data buffer.
25 *
Ben Tynera8126fd2019-08-01 19:40:07 -050026 * !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! IMPORTANT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050027 *
Ben Tynera8126fd2019-08-01 19:40:07 -050028 * - The bit positions are ordered 0 to n (left to right), where n is the bit
29 * length minus one.
30 * - The data stored in memory is assumed to be in big-endian byte format.
31 *
32 * So, for example:
33 *
34 * uint8_t a[2]; // 16 bits of memory
35 * BitString bs { 16, a }; // init BitString for a
Zane Shelley83da2452019-10-25 15:45:34 -050036 * bs.setFieldRight(0, 16, 0x1122); // set all 16 bits to 0x1122
Ben Tynera8126fd2019-08-01 19:40:07 -050037 *
38 * Results in:
39 *
40 * a[0] == bs.getFieldRight(0, 8) (i.e. 0x11)
41 * a[1] == bs.getFieldRight(8, 8) (i.e. 0x22)
42 *
43 * It is very important you do NOT do this:
44 *
45 * uint16_t x = 0x1122; // 16 bits of memory
46 * BitString bs { 16, &x }; // init BitString for x
47 *
48 * The results are undefined, or at least not portable. For example:
49 *
50 * Big-endian:
51 * x is stored in memory as |0x11|0x22|.
52 * Therefore, bs.getFieldRight(0, 8) returns 0x11.
53 *
54 * Little-endian:
55 * x is stored in memory as |0x22|0x11|.
56 * Therefore, bs.getFieldRight(0, 8) returns 0x22.
57 *
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050058 */
59class BitString
60{
Ben Tynera8126fd2019-08-01 19:40:07 -050061 private: // constants
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050062
Zane Shelleyd0af3582019-09-19 10:48:59 -050063 static const uint64_t UINT64_BIT_LEN;
64 static const uint64_t UINT8_BIT_LEN;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050065
66 public: // functions
67
68 /**
69 * @brief Constructor
70 * @param i_bitLen The number of bits in the bit string.
71 * @param i_bufAddr The starting address of the memory buffer.
Ben Tynera8126fd2019-08-01 19:40:07 -050072 * @param i_offset By default, position 0 will be the first bit of the
73 * buffer's start address. However, this parameter can be
74 * used to indicate that position 0 actually starts
75 * somewhere in the middle of the buffer.
76 * @pre Use getMinBytes() to calulate the minimum number of bytes needed
77 * to allocate sufficient memory space for this bit string.
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050078 */
Zane Shelleyfe27b652019-10-28 11:33:07 -050079 BitString(uint64_t i_bitLen, void* i_bufAddr, uint64_t i_offset = 0) :
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050080 iv_bitLen(i_bitLen), iv_bufAddr(i_bufAddr), iv_offset(i_offset)
81 {}
82
83 /** @brief Destructor */
84 virtual ~BitString() {}
85
86 /** @return The number of bits in the bit string buffer. */
Zane Shelleyd0af3582019-09-19 10:48:59 -050087 uint64_t getBitLen() const { return iv_bitLen; }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050088
89 /** @return The address of the bit string buffer. Note that this may
90 * return nullptr. */
Zane Shelleyfe27b652019-10-28 11:33:07 -050091 void* getBufAddr() const { return iv_bufAddr; }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050092
93 /**
94 * @param i_bitLen The number of bits for a bit string.
95 * @param i_offset Optional starting position of the bit string within the
96 * memory buffer.
Ben Tynera8126fd2019-08-01 19:40:07 -050097 * @return The minimum number of bytes required to allocate sufficient
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050098 * memory space for a bit string.
99 */
Zane Shelley83da2452019-10-25 15:45:34 -0500100 static uint64_t getMinBytes(uint64_t i_bitLen, uint64_t i_offset = 0)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500101 {
Zane Shelley83da2452019-10-25 15:45:34 -0500102 return (i_bitLen + i_offset + UINT8_BIT_LEN - 1) / UINT8_BIT_LEN;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500103 }
104
105 /**
106 * @brief Returns a left-justified value of the given length from the bit
107 * string starting at the given position.
108 * @param i_pos The starting position of the target range.
109 * @param i_len The number of bits of the target range.
110 * @return The value of the field range specified (left-justified).
111 * @pre nullptr != getBufAddr()
112 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500113 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500114 * @pre i_pos + i_len <= getBitLen()
115 */
Zane Shelley83da2452019-10-25 15:45:34 -0500116 uint64_t getFieldLeft(uint64_t i_pos, uint64_t i_len) const
Ben Tynera8126fd2019-08-01 19:40:07 -0500117 {
118 return getFieldRight(i_pos, i_len) << (UINT64_BIT_LEN - i_len);
119 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500120
121 /**
122 * @brief Returns a right-justified value of the given length from the bit
123 * string starting at the given position.
124 * @param i_pos The starting position of the target range.
125 * @param i_len The number of bits of the target range.
126 * @return The value of the field range specified (right-justified).
127 * @pre nullptr != getBufAddr()
128 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500129 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500130 * @pre i_pos + i_len <= getBitLen()
131 */
Zane Shelley83da2452019-10-25 15:45:34 -0500132 uint64_t getFieldRight(uint64_t i_pos, uint64_t i_len) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500133
134 /**
135 * @brief Sets a left-justified value of the given length into the bit
136 * string starting at the given position.
137 * @param i_pos The starting position of the target range.
138 * @param i_len The number of bits of the target range.
139 * @param i_val The left-justified value to set.
140 * @pre nullptr != getBufAddr()
141 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500142 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500143 * @pre i_pos + i_len <= getBitLen()
144 */
Zane Shelley83da2452019-10-25 15:45:34 -0500145 void setFieldLeft(uint64_t i_pos, uint64_t i_len, uint64_t i_val);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500146
147 /**
148 * @brief Sets a right-justified value of the given length into the bit
149 * string starting at the given position.
150 * @param i_pos The starting position of the target range.
151 * @param i_len The number of bits of the target range.
152 * @param i_val The right-justified value to set.
153 * @pre nullptr != getBufAddr()
154 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500155 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500156 * @pre i_pos + i_len <= getBitLen()
157 */
Zane Shelley83da2452019-10-25 15:45:34 -0500158 void setFieldRight(uint64_t i_pos, uint64_t i_len, uint64_t i_val)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500159 {
Zane Shelley83da2452019-10-25 15:45:34 -0500160 setFieldLeft(i_pos, i_len, i_val << (UINT64_BIT_LEN - i_len));
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500161 }
162
163 /**
164 * @param i_pos The target position.
165 * @return True if the bit at the given position is set(1), false otherwise.
166 * @pre i_pos < getBitLen().
167 */
Zane Shelley83da2452019-10-25 15:45:34 -0500168 bool isBitSet(uint64_t i_pos) const
Ben Tynera8126fd2019-08-01 19:40:07 -0500169 {
170 return 0 != getFieldRight(i_pos, 1);
171 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500172
173 /**
174 * @brief Sets the target position to 1.
175 * @param i_pos The target position.
176 * @pre i_pos < getBitLen().
177 */
Zane Shelley83da2452019-10-25 15:45:34 -0500178 void setBit(uint64_t i_pos) { setFieldRight(i_pos, 1, 1); }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500179
180 /** @brief Sets the entire bit string to 1's. */
Ben Tynera8126fd2019-08-01 19:40:07 -0500181 void setAll() { setPattern(UINT64_MAX); }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500182
183 /**
184 * @brief Sets the target position to 0.
185 * @param i_pos The target position.
186 * @pre i_pos < getBitLen().
187 */
Zane Shelley83da2452019-10-25 15:45:34 -0500188 void clearBit(uint64_t i_pos) { setFieldRight(i_pos, 1, 0); }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500189
190 /** @brief Sets the entire bit string to 0's. */
191 void clearAll() { setPattern(0); }
192
193 /**
194 * @brief Sets a range within the string based on the pattern and length
195 * provided.
196 * @param i_sPos Starting position of this string.
197 * @param i_sLen The length of the target range.
198 * @param i_pattern The pattern to set (right justified).
199 * @param i_pLen The length of the pattern.
200 * @pre nullptr != getBufAddr()
201 * @pre 0 < i_sLen
202 * @pre i_sPos + i_sLen <= getBitLen()
Ben Tynera8126fd2019-08-01 19:40:07 -0500203 * @pre 0 < i_pLen <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500204 * @post The pattern is repeated/truncated as needed.
205 *
206 * Examples: i_sPos(0), i_sLen(10), i_pattern(0xA), i_pLen(4)
207 * Old String: 0000000000
208 * New String: 1010101010
209 *
210 * i_sPos(3), i_sLen(4), i_pattern(0x3), i_pLen(3)
211 * Old String: 0001001000
212 * New String: 0000110000
213 */
Zane Shelley83da2452019-10-25 15:45:34 -0500214 void setPattern(uint64_t i_sPos, uint64_t i_sLen, uint64_t i_pattern,
215 uint64_t i_pLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500216
217 /**
218 * @brief Sets entire string based on the pattern and length provided.
219 * @param i_pattern The pattern to set (right justified).
220 * @param i_pLen The length of the pattern.
221 * @note See definition above for prerequisites.
222 * @post The entire string is filled with the pattern.
223 * @post The pattern is repeated/truncated as needed.
224 */
Zane Shelley83da2452019-10-25 15:45:34 -0500225 void setPattern(uint64_t i_pattern, uint64_t i_pLen)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500226 {
Zane Shelley83da2452019-10-25 15:45:34 -0500227 setPattern(0, getBitLen(), i_pattern, i_pLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500228 }
229
230 /**
Ben Tynera8126fd2019-08-01 19:40:07 -0500231 * @brief Sets entire string based on the pattern provided.
232 * @param i_pattern The pattern to set (right justified).
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500233 * @note See definition above for prerequisites.
234 * @post The entire string is filled with the pattern.
235 * @post The pattern is repeated/truncated as needed.
236 */
Zane Shelley83da2452019-10-25 15:45:34 -0500237 void setPattern(uint64_t i_pattern)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500238 {
Zane Shelley83da2452019-10-25 15:45:34 -0500239 setPattern(i_pattern, sizeof(i_pattern) * 8);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500240 }
241
242 /**
243 * @brief Set bits in this string based on the given string.
244 * @param i_sStr The source string.
245 * @param i_sPos The starting position of the source string.
246 * @param i_sLen The number of bits to copy from the source string.
247 * @param i_dPos The starting position of the this string.
248 * @pre nullptr != getBufAddr()
249 * @pre nullptr != i_sStr.getBufAddr()
250 * @pre 0 < i_sLen
251 * @pre i_sPos + i_sLen <= i_sStr.getBitLen()
252 * @pre i_dPos < getBitLen()
253 * @post Source bits in given range are copied to this starting at i_dPos.
254 * @note If the length of the given string is greater than the length of
255 * this string, then the extra bits are ignored.
256 * @note If the length of the given string is less than the length of this
257 * string, then the extra bits in this string are not modified.
258 * @note This string and the source string may specify overlapping memory.
259 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500260 void setString(const BitString& i_sStr, uint64_t i_sPos, uint64_t i_sLen,
Zane Shelley83da2452019-10-25 15:45:34 -0500261 uint64_t i_dPos = 0);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500262
263 /**
264 * @brief Set bits in this string based on the provided string.
265 * @param i_sStr The source string.
266 * @note This will try to copy as much of the source as possible to this
267 * string, starting with the first bit in each string.
268 * @note See the other definition of this function for details and
269 * restrictions.
270 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500271 void setString(const BitString& i_sStr)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500272 {
Zane Shelley83da2452019-10-25 15:45:34 -0500273 setString(i_sStr, 0, i_sStr.getBitLen());
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500274 }
275
276 /**
277 * @brief Masks (clears) any bits set in this string that correspond to bits
278 * set in the given string (this & ~mask).
Ben Tynera8126fd2019-08-01 19:40:07 -0500279 * @param i_mask The mask string (right justified).
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500280 * @note If the length of the given string is greater than the length of
281 * this string, then the extra bits are ignored.
282 * @note If the length of the given string is less than the length of this
283 * string, then the extra bits in this string are not modified.
284 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500285 void maskString(const BitString& i_mask);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500286
287 /**
288 * @param i_str The string to compare.
289 * @return True if the strings are equivalent, false otherwise.
290 * @pre Both strings must be of equal length and have same values to be
291 * equal.
292 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500293 bool isEqual(const BitString& i_str) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500294
295 /** @return True if there are no bit set(1) in this bit string, false
296 * otherwise. */
297 bool isZero() const;
298
299 /**
300 * @param i_pos The starting position of the target range.
301 * @param i_len The length of the target range.
302 * @return The number of bits that are set(1) in given range of this string.
303 * @pre nullptr != getBufAddr()
304 * @pre i_pos + i_len <= getBitLen()
305 */
Zane Shelley83da2452019-10-25 15:45:34 -0500306 uint64_t getSetCount(uint64_t i_pos, uint64_t i_len) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500307
308 /** @return The number of bits that are set(1) in this string. */
Zane Shelley83da2452019-10-25 15:45:34 -0500309 uint64_t getSetCount() const { return getSetCount(0, getBitLen()); }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500310
311 /** @brief Comparison operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500312 bool operator==(const BitString& i_str) const { return isEqual(i_str); }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500313
314 /** @brief Bitwise NOT operator. */
315 BitStringBuffer operator~() const;
316
317 /** @brief Bitwise AND operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500318 BitStringBuffer operator&(const BitString& i_bs) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500319
320 /** @brief Bitwise OR operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500321 BitStringBuffer operator|(const BitString& i_bs) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500322
323 /** @brief Right shift operator. */
Zane Shelley83da2452019-10-25 15:45:34 -0500324 BitStringBuffer operator>>(uint64_t i_shift) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500325
326 /** @brief Left shift operator. */
Zane Shelley83da2452019-10-25 15:45:34 -0500327 BitStringBuffer operator<<(uint64_t i_shift) const;
Zane Shelleyd0af3582019-09-19 10:48:59 -0500328
329 /**
330 * @brief Explicitly disables copy from BitString.
331 *
Zane Shelleyfe27b652019-10-28 11:33:07 -0500332 * Prevents assigning a BitString& to a BitString, which would strip
Zane Shelleyd0af3582019-09-19 10:48:59 -0500333 * polymorphism.
334 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500335 BitString(const BitString& i_bs) = delete;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500336
Ben Tynera8126fd2019-08-01 19:40:07 -0500337 /**
338 * @brief Explicitly disables assignment from BitStringBuffer.
339 *
340 * Allowing this would be dangerous if the BitStringBuffer goes out of scope
341 * because the BitString would point to memory that is no longer in context.
342 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500343 BitString& operator=(const BitStringBuffer& i_bsb) = delete;
Ben Tynera8126fd2019-08-01 19:40:07 -0500344
345 /**
346 * @brief Explicitly disables copy from BitStringBuffer.
347 *
348 * Allowing this would be dangerous if the BitStringBuffer goes out of scope
349 * because the BitString would point to memory that is no longer in context.
350 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500351 BitString(const BitStringBuffer& i_bsb) = delete;
Ben Tynera8126fd2019-08-01 19:40:07 -0500352
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500353 protected: // functions
354
355 /**
356 * @param i_newBufAddr The starting address of the new bit string buffer.
357 * @pre Before calling this function, make sure you deallocate the old
358 * buffer to avoid memory leaks.
359 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500360 void setBufAddr(void* i_newBufAddr) { iv_bufAddr = i_newBufAddr; }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500361
362 /** @param i_newBitLen The new bit length of this bit string buffer. */
Zane Shelley83da2452019-10-25 15:45:34 -0500363 void setBitLen(uint64_t i_newBitLen) { iv_bitLen = i_newBitLen; }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500364
365 private: // functions
366
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500367 /**
368 * @brief Given a bit position within the bit string, this function returns
369 * the address that contains the bit position and the bit position
370 * relative to that address.
371 * @param o_relPos The returned relative position.
372 * @param i_absPos The inputted absolute position.
373 * @return The relative address.
374 * @pre nullptr != getBufAddr()
375 * @pre i_absPos < getBitLen()
376 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500377 uint8_t* getRelativePosition(uint64_t& o_relPos,
378 uint64_t i_absPos) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500379
380 private: // instance variables
381
Zane Shelleyfe27b652019-10-28 11:33:07 -0500382 uint64_t iv_bitLen; ///< The bit length of this buffer.
383 void* iv_bufAddr; ///< The beginning address of this buffer.
384 uint64_t iv_offset; ///< Start position offset
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500385};
386
387//##############################################################################
388// BitStringBuffer class
389//##############################################################################
390
391/** A BitStringBuffer is a BitString that maintains its own buffer in memory. It
392 * guarantees that sufficient memory is allocated and deallocated in the
393 * constructor and destructor, respectively. In addition, the assignment
394 * operator will adjust the amount of memory needed, as necessary, for the
395 * assignment. */
396class BitStringBuffer : public BitString
397{
398 public: // functions
399
400 /**
401 * @brief Constructor
402 * @param i_bitLen Number of bits in the string.
403 */
Zane Shelley83da2452019-10-25 15:45:34 -0500404 explicit BitStringBuffer(uint64_t i_bitLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500405
406 /** @brief Destructor */
407 ~BitStringBuffer();
408
409 /** @brief Copy constructor from BitString */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500410 BitStringBuffer(const BitString& i_bs);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500411
412 /** @brief Copy constructor from BitStringBuffer */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500413 BitStringBuffer(const BitStringBuffer& i_bsb);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500414
415 /** @brief Assignment from BitString */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500416 BitStringBuffer& operator=(const BitString& i_bs);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500417
418 /** @brief Assignment from BitStringBuffer */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500419 BitStringBuffer& operator=(const BitStringBuffer& i_bsb);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500420
421 private: // functions
422
423 /** @brief Deallocates the old buffer, if needed, and initializes the new
424 * buffer. */
425 void initBuffer();
426};
427
Zane Shelley871adec2019-07-30 11:01:39 -0500428} // end namespace libhei