#include <buffer.hh>
Collaboration diagram for oln::utils::buffer:
Public Types | |
typedef ntg::int_u32 | value_type |
Used data type. | |
Public Member Functions | |
buffer () | |
Initialization of data. | |
template<class E> void | add (const E &e, bool count=true) |
Add every bits of e in data. | |
void | push_back (bool bit, bool is_padding=false) |
Push back a bit at the end of the buffer. | |
ntg::int_u32 | operator[] (unsigned n) const |
Return the nth word. | |
void | append_padding () |
Append padding bits. | |
void | append_length () |
Append length. | |
unsigned | size () const |
Return the number of words. | |
unsigned | bit_len () const |
Return the length in bits. | |
bool | is_append_padding () const |
Tell if the buffer has already been padded. | |
bool | is_append_length () const |
Tell if the length has already been appended. | |
Protected Member Functions | |
value_type | reorder (value_type x) const |
Change order of data in a word. | |
Protected Attributes | |
unsigned char | current_bit_ |
Number of the current bit in the current word. | |
std::vector< value_type > | data_ |
The buffer data. | |
value_type | len1_ |
first word length | |
value_type | len2_ |
second word length | |
bool | padding_appended_ |
Status of padding. | |
bool | length_appended_ |
Status of length appending. | |
Static Protected Attributes | |
const unsigned | length_ = 100 |
Definition at line 38 of file buffer.hh.
|
Add every bits of e in data.
|
|
Push back a bit at the end of the buffer.
true -> push back a 1
|
|
Change order of data in a word.
|
|
Capacity chunk. |