dlvhex
2.5.0
|
Memory encoding. More...
#include <vs10/bm/encoding.h>
Public Types | |
typedef unsigned char * | position_type |
typedef unsigned char * | position_type |
Public Member Functions | |
encoder (unsigned char *buf, unsigned size) | |
Construction. | |
void | put_8 (unsigned char c) |
Puts one character into the encoding buffer. | |
void | put_16 (bm::short_t s) |
Puts short word (16 bits) into the encoding buffer. | |
void | put_16 (const bm::short_t *s, unsigned count) |
Method puts array of short words (16 bits) into the encoding buffer. | |
void | put_32 (bm::word_t w) |
Puts 32 bits word into encoding buffer. | |
void | put_32 (const bm::word_t *w, unsigned count) |
Encodes array of 32-bit words. | |
void | put_prefixed_array_32 (unsigned char c, const bm::word_t *w, unsigned count) |
void | put_prefixed_array_16 (unsigned char c, const bm::short_t *s, unsigned count, bool encode_count) |
unsigned | size () const |
Returns size of the current encoding stream. | |
unsigned char * | get_pos () const |
Get current memory stream position. | |
void | set_pos (unsigned char *buf_pos) |
Set current memory stream position. | |
encoder (unsigned char *buf, unsigned size) | |
void | put_8 (unsigned char c) |
void | put_16 (bm::short_t s) |
void | put_16 (const bm::short_t *s, unsigned count) |
void | put_32 (bm::word_t w) |
void | put_32 (const bm::word_t *w, unsigned count) |
void | put_prefixed_array_32 (unsigned char c, const bm::word_t *w, unsigned count) |
void | put_prefixed_array_16 (unsigned char c, const bm::short_t *s, unsigned count, bool encode_count) |
unsigned | size () const |
unsigned char * | get_pos () const |
void | set_pos (unsigned char *buf_pos) |
Private Attributes | |
unsigned char * | buf_ |
unsigned char * | start_ |
unsigned int | size_ |
Memory encoding.
Class for encoding data into memory. Properly handles aligment issues with integer data types.
Definition at line 45 of file encoding.h.
typedef unsigned char* bm::encoder::position_type |
Definition at line 48 of file encoding.h.
typedef unsigned char* bm::encoder::position_type |
Definition at line 48 of file encoding.h.
bm::encoder::encoder | ( | unsigned char * | buf, |
unsigned | size | ||
) | [inline] |
Construction.
buf | - memory buffer pointer. |
size | - size of the buffer |
Definition at line 509 of file encoding.h.
bm::encoder::encoder | ( | unsigned char * | buf, |
unsigned | size | ||
) |
encoder::position_type bm::encoder::get_pos | ( | ) | const [inline] |
Get current memory stream position.
Definition at line 611 of file encoding.h.
References buf_.
Referenced by bm::serializer< BV >::gamma_gap_array(), and bm::serializer< BV >::gamma_gap_block().
unsigned char* bm::encoder::get_pos | ( | ) | const |
BMFORCEINLINE void bm::encoder::put_16 | ( | bm::short_t | s | ) |
Puts short word (16 bits) into the encoding buffer.
s | - short word to encode |
Definition at line 554 of file encoding.h.
References buf_.
Referenced by bm::serializer< BV >::encode_bit_interval(), bm::serializer< BV >::encode_gap_block(), bm::serializer< BV >::encode_header(), bm::serializer< BV >::gamma_gap_block(), put_prefixed_array_16(), and bm::serializer< BV >::serialize().
void bm::encoder::put_16 | ( | bm::short_t | s | ) |
void bm::encoder::put_16 | ( | const bm::short_t * | s, |
unsigned | count | ||
) | [inline] |
Method puts array of short words (16 bits) into the encoding buffer.
Definition at line 569 of file encoding.h.
References buf_.
void bm::encoder::put_16 | ( | const bm::short_t * | s, |
unsigned | count | ||
) |
BMFORCEINLINE void bm::encoder::put_32 | ( | bm::word_t | w | ) |
Puts 32 bits word into encoding buffer.
w | - word to encode. |
Definition at line 630 of file encoding.h.
References buf_.
Referenced by bm::serializer< BV >::encode_bit_interval(), bm::serializer< BV >::encode_header(), and put_prefixed_array_32().
void bm::encoder::put_32 | ( | bm::word_t | w | ) |
void bm::encoder::put_32 | ( | const bm::word_t * | w, |
unsigned | count | ||
) | [inline] |
void bm::encoder::put_32 | ( | const bm::word_t * | w, |
unsigned | count | ||
) |
BMFORCEINLINE void bm::encoder::put_8 | ( | unsigned char | c | ) |
Puts one character into the encoding buffer.
c | - character to encode |
Definition at line 544 of file encoding.h.
References buf_.
Referenced by bm::serializer< BV >::encode_bit_interval(), bm::serializer< BV >::encode_gap_block(), bm::serializer< BV >::encode_header(), bm::serializer< BV >::gamma_gap_array(), bm::serializer< BV >::gamma_gap_block(), put_prefixed_array_16(), put_prefixed_array_32(), and bm::serializer< BV >::serialize().
void bm::encoder::put_8 | ( | unsigned char | c | ) |
void bm::encoder::put_prefixed_array_16 | ( | unsigned char | c, |
const bm::short_t * | s, | ||
unsigned | count, | ||
bool | encode_count | ||
) |
void bm::encoder::put_prefixed_array_16 | ( | unsigned char | c, |
const bm::short_t * | s, | ||
unsigned | count, | ||
bool | encode_count | ||
) | [inline] |
Encode 8-bit prefix + an array
Definition at line 527 of file encoding.h.
References put_16(), and put_8().
Referenced by bm::serializer< BV >::gamma_gap_array().
void bm::encoder::put_prefixed_array_32 | ( | unsigned char | c, |
const bm::word_t * | w, | ||
unsigned | count | ||
) | [inline] |
Encode 8-bit prefix + an array
Definition at line 516 of file encoding.h.
References put_32(), and put_8().
Referenced by bm::serializer< BV >::serialize().
void bm::encoder::put_prefixed_array_32 | ( | unsigned char | c, |
const bm::word_t * | w, | ||
unsigned | count | ||
) |
void bm::encoder::set_pos | ( | unsigned char * | buf_pos | ) | [inline] |
Set current memory stream position.
Definition at line 619 of file encoding.h.
References buf_.
Referenced by bm::serializer< BV >::gamma_gap_array(), and bm::serializer< BV >::gamma_gap_block().
void bm::encoder::set_pos | ( | unsigned char * | buf_pos | ) |
unsigned bm::encoder::size | ( | ) | const |
unsigned bm::encoder::size | ( | ) | const [inline] |
Returns size of the current encoding stream.
Definition at line 603 of file encoding.h.
Referenced by bm::serializer< BV >::serialize().
unsigned char * bm::encoder::buf_ [private] |
unsigned int bm::encoder::size_ [private] |
Definition at line 67 of file encoding.h.
unsigned char * bm::encoder::start_ [private] |
Definition at line 66 of file encoding.h.
Referenced by size().