blob: 6229441654588b7e6135ff427f7c24ddddcc3203 [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 Shelley7f7a42d2019-10-28 13:28:31 -050087 uint64_t getBitLen() const
88 {
89 return iv_bitLen;
90 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050091
92 /** @return The address of the bit string buffer. Note that this may
93 * return nullptr. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050094 void* getBufAddr() const
95 {
96 return iv_bufAddr;
97 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050098
99 /**
100 * @param i_bitLen The number of bits for a bit string.
101 * @param i_offset Optional starting position of the bit string within the
102 * memory buffer.
Ben Tynera8126fd2019-08-01 19:40:07 -0500103 * @return The minimum number of bytes required to allocate sufficient
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500104 * memory space for a bit string.
105 */
Zane Shelley83da2452019-10-25 15:45:34 -0500106 static uint64_t getMinBytes(uint64_t i_bitLen, uint64_t i_offset = 0)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500107 {
Zane Shelley83da2452019-10-25 15:45:34 -0500108 return (i_bitLen + i_offset + UINT8_BIT_LEN - 1) / UINT8_BIT_LEN;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500109 }
110
111 /**
112 * @brief Returns a left-justified value of the given length from the bit
113 * string starting at the given position.
114 * @param i_pos The starting position of the target range.
115 * @param i_len The number of bits of the target range.
116 * @return The value of the field range specified (left-justified).
117 * @pre nullptr != getBufAddr()
118 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500119 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500120 * @pre i_pos + i_len <= getBitLen()
121 */
Zane Shelley83da2452019-10-25 15:45:34 -0500122 uint64_t getFieldLeft(uint64_t i_pos, uint64_t i_len) const
Ben Tynera8126fd2019-08-01 19:40:07 -0500123 {
124 return getFieldRight(i_pos, i_len) << (UINT64_BIT_LEN - i_len);
125 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500126
127 /**
128 * @brief Returns a right-justified value of the given length from the bit
129 * string starting at the given position.
130 * @param i_pos The starting position of the target range.
131 * @param i_len The number of bits of the target range.
132 * @return The value of the field range specified (right-justified).
133 * @pre nullptr != getBufAddr()
134 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500135 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500136 * @pre i_pos + i_len <= getBitLen()
137 */
Zane Shelley83da2452019-10-25 15:45:34 -0500138 uint64_t getFieldRight(uint64_t i_pos, uint64_t i_len) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500139
140 /**
141 * @brief Sets a left-justified value of the given length into the bit
142 * string starting at the given position.
143 * @param i_pos The starting position of the target range.
144 * @param i_len The number of bits of the target range.
145 * @param i_val The left-justified value to set.
146 * @pre nullptr != getBufAddr()
147 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500148 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500149 * @pre i_pos + i_len <= getBitLen()
150 */
Zane Shelley83da2452019-10-25 15:45:34 -0500151 void setFieldLeft(uint64_t i_pos, uint64_t i_len, uint64_t i_val);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500152
153 /**
154 * @brief Sets a right-justified value of the given length into the bit
155 * string starting at the given position.
156 * @param i_pos The starting position of the target range.
157 * @param i_len The number of bits of the target range.
158 * @param i_val The right-justified value to set.
159 * @pre nullptr != getBufAddr()
160 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500161 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500162 * @pre i_pos + i_len <= getBitLen()
163 */
Zane Shelley83da2452019-10-25 15:45:34 -0500164 void setFieldRight(uint64_t i_pos, uint64_t i_len, uint64_t i_val)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500165 {
Zane Shelley83da2452019-10-25 15:45:34 -0500166 setFieldLeft(i_pos, i_len, i_val << (UINT64_BIT_LEN - i_len));
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500167 }
168
169 /**
170 * @param i_pos The target position.
171 * @return True if the bit at the given position is set(1), false otherwise.
172 * @pre i_pos < getBitLen().
173 */
Zane Shelley83da2452019-10-25 15:45:34 -0500174 bool isBitSet(uint64_t i_pos) const
Ben Tynera8126fd2019-08-01 19:40:07 -0500175 {
176 return 0 != getFieldRight(i_pos, 1);
177 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500178
179 /**
180 * @brief Sets the target position to 1.
181 * @param i_pos The target position.
182 * @pre i_pos < getBitLen().
183 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500184 void setBit(uint64_t i_pos)
185 {
186 setFieldRight(i_pos, 1, 1);
187 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500188
189 /** @brief Sets the entire bit string to 1's. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500190 void setAll()
191 {
192 setPattern(UINT64_MAX);
193 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500194
195 /**
196 * @brief Sets the target position to 0.
197 * @param i_pos The target position.
198 * @pre i_pos < getBitLen().
199 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500200 void clearBit(uint64_t i_pos)
201 {
202 setFieldRight(i_pos, 1, 0);
203 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500204
205 /** @brief Sets the entire bit string to 0's. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500206 void clearAll()
207 {
208 setPattern(0);
209 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500210
211 /**
212 * @brief Sets a range within the string based on the pattern and length
213 * provided.
214 * @param i_sPos Starting position of this string.
215 * @param i_sLen The length of the target range.
216 * @param i_pattern The pattern to set (right justified).
217 * @param i_pLen The length of the pattern.
218 * @pre nullptr != getBufAddr()
219 * @pre 0 < i_sLen
220 * @pre i_sPos + i_sLen <= getBitLen()
Ben Tynera8126fd2019-08-01 19:40:07 -0500221 * @pre 0 < i_pLen <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500222 * @post The pattern is repeated/truncated as needed.
223 *
224 * Examples: i_sPos(0), i_sLen(10), i_pattern(0xA), i_pLen(4)
225 * Old String: 0000000000
226 * New String: 1010101010
227 *
228 * i_sPos(3), i_sLen(4), i_pattern(0x3), i_pLen(3)
229 * Old String: 0001001000
230 * New String: 0000110000
231 */
Zane Shelley83da2452019-10-25 15:45:34 -0500232 void setPattern(uint64_t i_sPos, uint64_t i_sLen, uint64_t i_pattern,
233 uint64_t i_pLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500234
235 /**
236 * @brief Sets entire string based on the pattern and length provided.
237 * @param i_pattern The pattern to set (right justified).
238 * @param i_pLen The length of the pattern.
239 * @note See definition above for prerequisites.
240 * @post The entire string is filled with the pattern.
241 * @post The pattern is repeated/truncated as needed.
242 */
Zane Shelley83da2452019-10-25 15:45:34 -0500243 void setPattern(uint64_t i_pattern, uint64_t i_pLen)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500244 {
Zane Shelley83da2452019-10-25 15:45:34 -0500245 setPattern(0, getBitLen(), i_pattern, i_pLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500246 }
247
248 /**
Ben Tynera8126fd2019-08-01 19:40:07 -0500249 * @brief Sets entire string based on the pattern provided.
250 * @param i_pattern The pattern to set (right justified).
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500251 * @note See definition above for prerequisites.
252 * @post The entire string is filled with the pattern.
253 * @post The pattern is repeated/truncated as needed.
254 */
Zane Shelley83da2452019-10-25 15:45:34 -0500255 void setPattern(uint64_t i_pattern)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500256 {
Zane Shelley83da2452019-10-25 15:45:34 -0500257 setPattern(i_pattern, sizeof(i_pattern) * 8);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500258 }
259
260 /**
261 * @brief Set bits in this string based on the given string.
262 * @param i_sStr The source string.
263 * @param i_sPos The starting position of the source string.
264 * @param i_sLen The number of bits to copy from the source string.
265 * @param i_dPos The starting position of the this string.
266 * @pre nullptr != getBufAddr()
267 * @pre nullptr != i_sStr.getBufAddr()
268 * @pre 0 < i_sLen
269 * @pre i_sPos + i_sLen <= i_sStr.getBitLen()
270 * @pre i_dPos < getBitLen()
271 * @post Source bits in given range are copied to this starting at i_dPos.
272 * @note If the length of the given string is greater than the length of
273 * this string, then the extra bits are ignored.
274 * @note If the length of the given string is less than the length of this
275 * string, then the extra bits in this string are not modified.
276 * @note This string and the source string may specify overlapping memory.
277 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500278 void setString(const BitString& i_sStr, uint64_t i_sPos, uint64_t i_sLen,
Zane Shelley83da2452019-10-25 15:45:34 -0500279 uint64_t i_dPos = 0);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500280
281 /**
282 * @brief Set bits in this string based on the provided string.
283 * @param i_sStr The source string.
284 * @note This will try to copy as much of the source as possible to this
285 * string, starting with the first bit in each string.
286 * @note See the other definition of this function for details and
287 * restrictions.
288 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500289 void setString(const BitString& i_sStr)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500290 {
Zane Shelley83da2452019-10-25 15:45:34 -0500291 setString(i_sStr, 0, i_sStr.getBitLen());
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500292 }
293
294 /**
295 * @brief Masks (clears) any bits set in this string that correspond to bits
296 * set in the given string (this & ~mask).
Ben Tynera8126fd2019-08-01 19:40:07 -0500297 * @param i_mask The mask string (right justified).
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500298 * @note If the length of the given string is greater than the length of
299 * this string, then the extra bits are ignored.
300 * @note If the length of the given string is less than the length of this
301 * string, then the extra bits in this string are not modified.
302 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500303 void maskString(const BitString& i_mask);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500304
305 /**
306 * @param i_str The string to compare.
307 * @return True if the strings are equivalent, false otherwise.
308 * @pre Both strings must be of equal length and have same values to be
309 * equal.
310 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500311 bool isEqual(const BitString& i_str) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500312
313 /** @return True if there are no bit set(1) in this bit string, false
314 * otherwise. */
315 bool isZero() const;
316
317 /**
318 * @param i_pos The starting position of the target range.
319 * @param i_len The length of the target range.
320 * @return The number of bits that are set(1) in given range of this string.
321 * @pre nullptr != getBufAddr()
322 * @pre i_pos + i_len <= getBitLen()
323 */
Zane Shelley83da2452019-10-25 15:45:34 -0500324 uint64_t getSetCount(uint64_t i_pos, uint64_t i_len) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500325
326 /** @return The number of bits that are set(1) in this string. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500327 uint64_t getSetCount() const
328 {
329 return getSetCount(0, getBitLen());
330 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500331
332 /** @brief Comparison operator. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500333 bool operator==(const BitString& i_str) const
334 {
335 return isEqual(i_str);
336 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500337
338 /** @brief Bitwise NOT operator. */
339 BitStringBuffer operator~() const;
340
341 /** @brief Bitwise AND operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500342 BitStringBuffer operator&(const BitString& i_bs) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500343
344 /** @brief Bitwise OR operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500345 BitStringBuffer operator|(const BitString& i_bs) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500346
347 /** @brief Right shift operator. */
Zane Shelley83da2452019-10-25 15:45:34 -0500348 BitStringBuffer operator>>(uint64_t i_shift) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500349
350 /** @brief Left shift operator. */
Zane Shelley83da2452019-10-25 15:45:34 -0500351 BitStringBuffer operator<<(uint64_t i_shift) const;
Zane Shelleyd0af3582019-09-19 10:48:59 -0500352
353 /**
354 * @brief Explicitly disables copy from BitString.
355 *
Zane Shelleyfe27b652019-10-28 11:33:07 -0500356 * Prevents assigning a BitString& to a BitString, which would strip
Zane Shelleyd0af3582019-09-19 10:48:59 -0500357 * polymorphism.
358 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500359 BitString(const BitString& i_bs) = delete;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500360
Ben Tynera8126fd2019-08-01 19:40:07 -0500361 /**
362 * @brief Explicitly disables assignment from BitStringBuffer.
363 *
364 * Allowing this would be dangerous if the BitStringBuffer goes out of scope
365 * because the BitString would point to memory that is no longer in context.
366 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500367 BitString& operator=(const BitStringBuffer& i_bsb) = delete;
Ben Tynera8126fd2019-08-01 19:40:07 -0500368
369 /**
370 * @brief Explicitly disables copy from BitStringBuffer.
371 *
372 * Allowing this would be dangerous if the BitStringBuffer goes out of scope
373 * because the BitString would point to memory that is no longer in context.
374 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500375 BitString(const BitStringBuffer& i_bsb) = delete;
Ben Tynera8126fd2019-08-01 19:40:07 -0500376
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500377 protected: // functions
378
379 /**
380 * @param i_newBufAddr The starting address of the new bit string buffer.
381 * @pre Before calling this function, make sure you deallocate the old
382 * buffer to avoid memory leaks.
383 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500384 void setBufAddr(void* i_newBufAddr)
385 {
386 iv_bufAddr = i_newBufAddr;
387 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500388
389 /** @param i_newBitLen The new bit length of this bit string buffer. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500390 void setBitLen(uint64_t i_newBitLen)
391 {
392 iv_bitLen = i_newBitLen;
393 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500394
395 private: // functions
396
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500397 /**
398 * @brief Given a bit position within the bit string, this function returns
399 * the address that contains the bit position and the bit position
400 * relative to that address.
401 * @param o_relPos The returned relative position.
402 * @param i_absPos The inputted absolute position.
403 * @return The relative address.
404 * @pre nullptr != getBufAddr()
405 * @pre i_absPos < getBitLen()
406 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500407 uint8_t* getRelativePosition(uint64_t& o_relPos, uint64_t i_absPos) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500408
409 private: // instance variables
410
Zane Shelleyfe27b652019-10-28 11:33:07 -0500411 uint64_t iv_bitLen; ///< The bit length of this buffer.
412 void* iv_bufAddr; ///< The beginning address of this buffer.
413 uint64_t iv_offset; ///< Start position offset
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500414};
415
416//##############################################################################
417// BitStringBuffer class
418//##############################################################################
419
420/** A BitStringBuffer is a BitString that maintains its own buffer in memory. It
421 * guarantees that sufficient memory is allocated and deallocated in the
422 * constructor and destructor, respectively. In addition, the assignment
423 * operator will adjust the amount of memory needed, as necessary, for the
424 * assignment. */
425class BitStringBuffer : public BitString
426{
427 public: // functions
428
429 /**
430 * @brief Constructor
431 * @param i_bitLen Number of bits in the string.
432 */
Zane Shelley83da2452019-10-25 15:45:34 -0500433 explicit BitStringBuffer(uint64_t i_bitLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500434
435 /** @brief Destructor */
436 ~BitStringBuffer();
437
438 /** @brief Copy constructor from BitString */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500439 BitStringBuffer(const BitString& i_bs);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500440
441 /** @brief Copy constructor from BitStringBuffer */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500442 BitStringBuffer(const BitStringBuffer& i_bsb);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500443
444 /** @brief Assignment from BitString */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500445 BitStringBuffer& operator=(const BitString& i_bs);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500446
447 /** @brief Assignment from BitStringBuffer */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500448 BitStringBuffer& operator=(const BitStringBuffer& i_bsb);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500449
450 private: // functions
451
452 /** @brief Deallocates the old buffer, if needed, and initializes the new
453 * buffer. */
454 void initBuffer();
455};
456
Zane Shelley871adec2019-07-30 11:01:39 -0500457} // end namespace libhei