|
My Project
|
Represents a binary code as a stack of bits. More...
#include <Code.h>
Public Member Functions | |
| Code () | |
| Default constructor. Initializes an empty code. | |
| bool | empty () const |
| Checks if the code stack is empty. | |
| bool | full () const |
| Checks if the code stack has reached its maximum capacity. | |
| bool | push_bit (uint8_t bit) |
| Gets the current number of bits in the code. | |
| bool | pop_bit (uint8_t &bit) |
| Pops the last bit off the code stack. | |
| uint8_t | get_bit (uint32_t index) const |
| Retrieves a bit at a specific index without removing it. | |
Represents a binary code as a stack of bits.
| bool Code::empty | ( | ) | const |
Checks if the code stack is empty.
| bool Code::full | ( | ) | const |
Checks if the code stack has reached its maximum capacity.
| uint8_t Code::get_bit | ( | uint32_t | index | ) | const |
Retrieves a bit at a specific index without removing it.
| index | The position of the bit to retrieve. |
| bool Code::pop_bit | ( | uint8_t & | bit | ) |
Pops the last bit off the code stack.
| bit | Reference to a variable where the popped bit will be stored. |
| bool Code::push_bit | ( | uint8_t | bit | ) |
Gets the current number of bits in the code.
Pushes a single bit (0 or 1) onto the code stack.
| bit | The bit to add. |