blob: 4b63906a8739a20981da14a4cf832f85e6caa8a9 [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 Shelleyd0af3582019-09-19 10:48:59 -050062 static const uint64_t UINT64_BIT_LEN;
63 static const uint64_t UINT8_BIT_LEN;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050064
65 public: // functions
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050066 /**
67 * @brief Constructor
68 * @param i_bitLen The number of bits in the bit string.
69 * @param i_bufAddr The starting address of the memory buffer.
Ben Tynera8126fd2019-08-01 19:40:07 -050070 * @param i_offset By default, position 0 will be the first bit of the
71 * buffer's start address. However, this parameter can be
72 * used to indicate that position 0 actually starts
73 * somewhere in the middle of the buffer.
74 * @pre Use getMinBytes() to calulate the minimum number of bytes needed
75 * to allocate sufficient memory space for this bit string.
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050076 */
Zane Shelleyfe27b652019-10-28 11:33:07 -050077 BitString(uint64_t i_bitLen, void* i_bufAddr, uint64_t i_offset = 0) :
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050078 iv_bitLen(i_bitLen), iv_bufAddr(i_bufAddr), iv_offset(i_offset)
79 {}
80
81 /** @brief Destructor */
82 virtual ~BitString() {}
83
84 /** @return The number of bits in the bit string buffer. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050085 uint64_t getBitLen() const
86 {
87 return iv_bitLen;
88 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050089
90 /** @return The address of the bit string buffer. Note that this may
91 * return nullptr. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -050092 void* getBufAddr() const
93 {
94 return iv_bufAddr;
95 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -050096
97 /**
98 * @param i_bitLen The number of bits for a bit string.
99 * @param i_offset Optional starting position of the bit string within the
100 * memory buffer.
Ben Tynera8126fd2019-08-01 19:40:07 -0500101 * @return The minimum number of bytes required to allocate sufficient
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500102 * memory space for a bit string.
103 */
Zane Shelley83da2452019-10-25 15:45:34 -0500104 static uint64_t getMinBytes(uint64_t i_bitLen, uint64_t i_offset = 0)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500105 {
Zane Shelley83da2452019-10-25 15:45:34 -0500106 return (i_bitLen + i_offset + UINT8_BIT_LEN - 1) / UINT8_BIT_LEN;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500107 }
108
109 /**
110 * @brief Returns a left-justified value of the given length from the bit
111 * string starting at the given position.
112 * @param i_pos The starting position of the target range.
113 * @param i_len The number of bits of the target range.
114 * @return The value of the field range specified (left-justified).
115 * @pre nullptr != getBufAddr()
116 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500117 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500118 * @pre i_pos + i_len <= getBitLen()
119 */
Zane Shelley83da2452019-10-25 15:45:34 -0500120 uint64_t getFieldLeft(uint64_t i_pos, uint64_t i_len) const
Ben Tynera8126fd2019-08-01 19:40:07 -0500121 {
122 return getFieldRight(i_pos, i_len) << (UINT64_BIT_LEN - i_len);
123 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500124
125 /**
126 * @brief Returns a right-justified value of the given length from the bit
127 * string starting at the given position.
128 * @param i_pos The starting position of the target range.
129 * @param i_len The number of bits of the target range.
130 * @return The value of the field range specified (right-justified).
131 * @pre nullptr != getBufAddr()
132 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500133 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500134 * @pre i_pos + i_len <= getBitLen()
135 */
Zane Shelley83da2452019-10-25 15:45:34 -0500136 uint64_t getFieldRight(uint64_t i_pos, uint64_t i_len) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500137
138 /**
139 * @brief Sets a left-justified value of the given length into the bit
140 * string starting at the given position.
141 * @param i_pos The starting position of the target range.
142 * @param i_len The number of bits of the target range.
143 * @param i_val The left-justified value to set.
144 * @pre nullptr != getBufAddr()
145 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500146 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500147 * @pre i_pos + i_len <= getBitLen()
148 */
Zane Shelley83da2452019-10-25 15:45:34 -0500149 void setFieldLeft(uint64_t i_pos, uint64_t i_len, uint64_t i_val);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500150
151 /**
152 * @brief Sets a right-justified value of the given length into the bit
153 * string starting at the given position.
154 * @param i_pos The starting position of the target range.
155 * @param i_len The number of bits of the target range.
156 * @param i_val The right-justified value to set.
157 * @pre nullptr != getBufAddr()
158 * @pre 0 < i_len
Ben Tynera8126fd2019-08-01 19:40:07 -0500159 * @pre i_len <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500160 * @pre i_pos + i_len <= getBitLen()
161 */
Zane Shelley83da2452019-10-25 15:45:34 -0500162 void setFieldRight(uint64_t i_pos, uint64_t i_len, uint64_t i_val)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500163 {
Zane Shelley83da2452019-10-25 15:45:34 -0500164 setFieldLeft(i_pos, i_len, i_val << (UINT64_BIT_LEN - i_len));
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500165 }
166
167 /**
168 * @param i_pos The target position.
169 * @return True if the bit at the given position is set(1), false otherwise.
170 * @pre i_pos < getBitLen().
171 */
Zane Shelley83da2452019-10-25 15:45:34 -0500172 bool isBitSet(uint64_t i_pos) const
Ben Tynera8126fd2019-08-01 19:40:07 -0500173 {
174 return 0 != getFieldRight(i_pos, 1);
175 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500176
177 /**
178 * @brief Sets the target position to 1.
179 * @param i_pos The target position.
180 * @pre i_pos < getBitLen().
181 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500182 void setBit(uint64_t i_pos)
183 {
184 setFieldRight(i_pos, 1, 1);
185 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500186
187 /** @brief Sets the entire bit string to 1's. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500188 void setAll()
189 {
190 setPattern(UINT64_MAX);
191 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500192
193 /**
194 * @brief Sets the target position to 0.
195 * @param i_pos The target position.
196 * @pre i_pos < getBitLen().
197 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500198 void clearBit(uint64_t i_pos)
199 {
200 setFieldRight(i_pos, 1, 0);
201 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500202
203 /** @brief Sets the entire bit string to 0's. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500204 void clearAll()
205 {
206 setPattern(0);
207 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500208
209 /**
210 * @brief Sets a range within the string based on the pattern and length
211 * provided.
212 * @param i_sPos Starting position of this string.
213 * @param i_sLen The length of the target range.
214 * @param i_pattern The pattern to set (right justified).
215 * @param i_pLen The length of the pattern.
216 * @pre nullptr != getBufAddr()
217 * @pre 0 < i_sLen
218 * @pre i_sPos + i_sLen <= getBitLen()
Ben Tynera8126fd2019-08-01 19:40:07 -0500219 * @pre 0 < i_pLen <= UINT64_BIT_LEN
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500220 * @post The pattern is repeated/truncated as needed.
221 *
222 * Examples: i_sPos(0), i_sLen(10), i_pattern(0xA), i_pLen(4)
223 * Old String: 0000000000
224 * New String: 1010101010
225 *
226 * i_sPos(3), i_sLen(4), i_pattern(0x3), i_pLen(3)
227 * Old String: 0001001000
228 * New String: 0000110000
229 */
Zane Shelley83da2452019-10-25 15:45:34 -0500230 void setPattern(uint64_t i_sPos, uint64_t i_sLen, uint64_t i_pattern,
231 uint64_t i_pLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500232
233 /**
234 * @brief Sets entire string based on the pattern and length provided.
235 * @param i_pattern The pattern to set (right justified).
236 * @param i_pLen The length of the pattern.
237 * @note See definition above for prerequisites.
238 * @post The entire string is filled with the pattern.
239 * @post The pattern is repeated/truncated as needed.
240 */
Zane Shelley83da2452019-10-25 15:45:34 -0500241 void setPattern(uint64_t i_pattern, uint64_t i_pLen)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500242 {
Zane Shelley83da2452019-10-25 15:45:34 -0500243 setPattern(0, getBitLen(), i_pattern, i_pLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500244 }
245
246 /**
Ben Tynera8126fd2019-08-01 19:40:07 -0500247 * @brief Sets entire string based on the pattern provided.
248 * @param i_pattern The pattern to set (right justified).
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500249 * @note See definition above for prerequisites.
250 * @post The entire string is filled with the pattern.
251 * @post The pattern is repeated/truncated as needed.
252 */
Zane Shelley83da2452019-10-25 15:45:34 -0500253 void setPattern(uint64_t i_pattern)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500254 {
Zane Shelley83da2452019-10-25 15:45:34 -0500255 setPattern(i_pattern, sizeof(i_pattern) * 8);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500256 }
257
258 /**
259 * @brief Set bits in this string based on the given string.
260 * @param i_sStr The source string.
261 * @param i_sPos The starting position of the source string.
262 * @param i_sLen The number of bits to copy from the source string.
263 * @param i_dPos The starting position of the this string.
264 * @pre nullptr != getBufAddr()
265 * @pre nullptr != i_sStr.getBufAddr()
266 * @pre 0 < i_sLen
267 * @pre i_sPos + i_sLen <= i_sStr.getBitLen()
268 * @pre i_dPos < getBitLen()
269 * @post Source bits in given range are copied to this starting at i_dPos.
270 * @note If the length of the given string is greater than the length of
271 * this string, then the extra bits are ignored.
272 * @note If the length of the given string is less than the length of this
273 * string, then the extra bits in this string are not modified.
274 * @note This string and the source string may specify overlapping memory.
275 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500276 void setString(const BitString& i_sStr, uint64_t i_sPos, uint64_t i_sLen,
Zane Shelley83da2452019-10-25 15:45:34 -0500277 uint64_t i_dPos = 0);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500278
279 /**
280 * @brief Set bits in this string based on the provided string.
281 * @param i_sStr The source string.
282 * @note This will try to copy as much of the source as possible to this
283 * string, starting with the first bit in each string.
284 * @note See the other definition of this function for details and
285 * restrictions.
286 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500287 void setString(const BitString& i_sStr)
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500288 {
Zane Shelley83da2452019-10-25 15:45:34 -0500289 setString(i_sStr, 0, i_sStr.getBitLen());
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500290 }
291
292 /**
293 * @brief Masks (clears) any bits set in this string that correspond to bits
294 * set in the given string (this & ~mask).
Ben Tynera8126fd2019-08-01 19:40:07 -0500295 * @param i_mask The mask string (right justified).
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500296 * @note If the length of the given string is greater than the length of
297 * this string, then the extra bits are ignored.
298 * @note If the length of the given string is less than the length of this
299 * string, then the extra bits in this string are not modified.
300 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500301 void maskString(const BitString& i_mask);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500302
303 /**
304 * @param i_str The string to compare.
305 * @return True if the strings are equivalent, false otherwise.
306 * @pre Both strings must be of equal length and have same values to be
307 * equal.
308 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500309 bool isEqual(const BitString& i_str) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500310
311 /** @return True if there are no bit set(1) in this bit string, false
312 * otherwise. */
313 bool isZero() const;
314
315 /**
316 * @param i_pos The starting position of the target range.
317 * @param i_len The length of the target range.
318 * @return The number of bits that are set(1) in given range of this string.
319 * @pre nullptr != getBufAddr()
320 * @pre i_pos + i_len <= getBitLen()
321 */
Zane Shelley83da2452019-10-25 15:45:34 -0500322 uint64_t getSetCount(uint64_t i_pos, uint64_t i_len) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500323
324 /** @return The number of bits that are set(1) in this string. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500325 uint64_t getSetCount() const
326 {
327 return getSetCount(0, getBitLen());
328 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500329
330 /** @brief Comparison operator. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500331 bool operator==(const BitString& i_str) const
332 {
333 return isEqual(i_str);
334 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500335
336 /** @brief Bitwise NOT operator. */
337 BitStringBuffer operator~() const;
338
339 /** @brief Bitwise AND operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500340 BitStringBuffer operator&(const BitString& i_bs) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500341
342 /** @brief Bitwise OR operator. */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500343 BitStringBuffer operator|(const BitString& i_bs) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500344
345 /** @brief Right shift operator. */
Zane Shelley83da2452019-10-25 15:45:34 -0500346 BitStringBuffer operator>>(uint64_t i_shift) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500347
348 /** @brief Left shift operator. */
Zane Shelley83da2452019-10-25 15:45:34 -0500349 BitStringBuffer operator<<(uint64_t i_shift) const;
Zane Shelleyd0af3582019-09-19 10:48:59 -0500350
351 /**
352 * @brief Explicitly disables copy from BitString.
353 *
Zane Shelleyfe27b652019-10-28 11:33:07 -0500354 * Prevents assigning a BitString& to a BitString, which would strip
Zane Shelleyd0af3582019-09-19 10:48:59 -0500355 * polymorphism.
356 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500357 BitString(const BitString& i_bs) = delete;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500358
Ben Tynera8126fd2019-08-01 19:40:07 -0500359 /**
360 * @brief Explicitly disables assignment from BitStringBuffer.
361 *
362 * Allowing this would be dangerous if the BitStringBuffer goes out of scope
363 * because the BitString would point to memory that is no longer in context.
364 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500365 BitString& operator=(const BitStringBuffer& i_bsb) = delete;
Ben Tynera8126fd2019-08-01 19:40:07 -0500366
367 /**
368 * @brief Explicitly disables copy from BitStringBuffer.
369 *
370 * Allowing this would be dangerous if the BitStringBuffer goes out of scope
371 * because the BitString would point to memory that is no longer in context.
372 */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500373 BitString(const BitStringBuffer& i_bsb) = delete;
Ben Tynera8126fd2019-08-01 19:40:07 -0500374
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500375 protected: // functions
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500376 /**
377 * @param i_newBufAddr The starting address of the new bit string buffer.
378 * @pre Before calling this function, make sure you deallocate the old
379 * buffer to avoid memory leaks.
380 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500381 void setBufAddr(void* i_newBufAddr)
382 {
383 iv_bufAddr = i_newBufAddr;
384 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500385
386 /** @param i_newBitLen The new bit length of this bit string buffer. */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500387 void setBitLen(uint64_t i_newBitLen)
388 {
389 iv_bitLen = i_newBitLen;
390 }
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500391
392 private: // functions
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500393 /**
394 * @brief Given a bit position within the bit string, this function returns
395 * the address that contains the bit position and the bit position
396 * relative to that address.
397 * @param o_relPos The returned relative position.
398 * @param i_absPos The inputted absolute position.
399 * @return The relative address.
400 * @pre nullptr != getBufAddr()
401 * @pre i_absPos < getBitLen()
402 */
Zane Shelley7f7a42d2019-10-28 13:28:31 -0500403 uint8_t* getRelativePosition(uint64_t& o_relPos, uint64_t i_absPos) const;
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500404
Zane Shelley7c8faa12019-10-28 22:26:28 -0500405 private:
406 uint64_t iv_bitLen; ///< The bit length of this buffer.
407 void* iv_bufAddr; ///< The beginning address of this buffer.
408 uint64_t iv_offset; ///< Start position offset
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500409};
410
411//##############################################################################
412// BitStringBuffer class
413//##############################################################################
414
415/** A BitStringBuffer is a BitString that maintains its own buffer in memory. It
416 * guarantees that sufficient memory is allocated and deallocated in the
417 * constructor and destructor, respectively. In addition, the assignment
418 * operator will adjust the amount of memory needed, as necessary, for the
419 * assignment. */
420class BitStringBuffer : public BitString
421{
422 public: // functions
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500423 /**
424 * @brief Constructor
425 * @param i_bitLen Number of bits in the string.
426 */
Zane Shelley83da2452019-10-25 15:45:34 -0500427 explicit BitStringBuffer(uint64_t i_bitLen);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500428
429 /** @brief Destructor */
430 ~BitStringBuffer();
431
432 /** @brief Copy constructor from BitString */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500433 BitStringBuffer(const BitString& i_bs);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500434
435 /** @brief Copy constructor from BitStringBuffer */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500436 BitStringBuffer(const BitStringBuffer& i_bsb);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500437
438 /** @brief Assignment from BitString */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500439 BitStringBuffer& operator=(const BitString& i_bs);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500440
441 /** @brief Assignment from BitStringBuffer */
Zane Shelleyfe27b652019-10-28 11:33:07 -0500442 BitStringBuffer& operator=(const BitStringBuffer& i_bsb);
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500443
444 private: // functions
Zane Shelleyfd3f9cc2019-07-29 15:02:24 -0500445 /** @brief Deallocates the old buffer, if needed, and initializes the new
446 * buffer. */
447 void initBuffer();
448};
449
Zane Shelley871adec2019-07-30 11:01:39 -0500450} // end namespace libhei