|
BitMagic-C++
|
Memory encoding. More...
#include <encoding.h>
Public Types | |
| typedef unsigned char * | position_type |
Public Member Functions | |
| encoder (unsigned char *buf, size_t size) BMNOEXCEPT | |
| Construction. | |
| void | put_8 (unsigned char c) BMNOEXCEPT |
| Puts one character into the encoding buffer. | |
| void | put_16 (bm::short_t s) BMNOEXCEPT |
| Puts short word (16 bits) into the encoding buffer. | |
| void | put_16 (const bm::short_t *s, unsigned count) BMNOEXCEPT |
| Method puts array of short words (16 bits) into the encoding buffer. | |
| void | put_24 (bm::word_t w) BMNOEXCEPT |
| Puts 24 bits word into encoding buffer. | |
| void | put_32 (bm::word_t w) BMNOEXCEPT |
| Puts 32 bits word into encoding buffer. | |
| void | put_32 (const bm::word_t *w, unsigned count) BMNOEXCEPT |
| Encodes array of 32-bit words. | |
| void | put_48 (bm::id64_t w) BMNOEXCEPT |
| Puts 48 bits word into encoding buffer. | |
| void | put_64 (bm::id64_t w) BMNOEXCEPT |
| Puts 64 bits word into encoding buffer. | |
| void | put_h64 (bm::id64_t w) BMNOEXCEPT |
| Puts 64 bits word into encoding buffer with h-compression. | |
| void | put_8_16_32 (unsigned w, unsigned char c8, unsigned char c16, unsigned char c32) BMNOEXCEPT |
| but gat plus value based on its VBR evaluation | |
| void | put_prefixed_array_32 (unsigned char c, const bm::word_t *w, unsigned count) BMNOEXCEPT |
| Encode 8-bit prefix + an array. | |
| void | put_prefixed_array_16 (unsigned char c, const bm::short_t *s, unsigned count, bool encode_count) BMNOEXCEPT |
| Encode 8-bit prefix + an array. | |
| void | memcpy (const unsigned char *src, size_t count) BMNOEXCEPT |
| copy bytes into target buffer or just rewind if src is NULL | |
| size_t | size () const BMNOEXCEPT |
| Returns size of the current encoding stream. | |
| unsigned char * | get_pos () const BMNOEXCEPT |
| Get current memory stream position. | |
| void | set_pos (unsigned char *buf_pos) BMNOEXCEPT |
| Set current memory stream position. | |
Memory encoding.
Class for encoding data into memory. Class handles aligment issues with the integer data types.
Definition at line 49 of file encoding.h.
| typedef unsigned char* bm::encoder::position_type |
Definition at line 52 of file encoding.h.
|
inline |
Construction.
| buf | - memory buffer pointer. |
| size | - size of the buffer |
Definition at line 398 of file encoding.h.
References BMNOEXCEPT.
|
inline |
Get current memory stream position.
Definition at line 537 of file encoding.h.
References BMNOEXCEPT.
Referenced by bm::compressed_collection_serializer< CBC >::serialize().
|
inline |
copy bytes into target buffer or just rewind if src is NULL
Definition at line 516 of file encoding.h.
References BM_ASSERT, BMNOEXCEPT, and memcpy().
Referenced by bm::sparse_vector_serializer< SV >::encode_remap_matrix(), bm::decoder::get_16(), bm::decoder::get_16(), bm::decoder::get_32(), bm::decoder::get_32(), bm::decoder::get_64(), bm::decoder_base::memcpy(), memcpy(), put_16(), put_16(), put_32(), put_32(), put_64(), and bm::compressed_collection_serializer< CBC >::serialize().
| 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 444 of file encoding.h.
References BMFORCEINLINE, BMNOEXCEPT, and memcpy().
Referenced by bm::serializer< BV >::encode_gap_block(), bm::sparse_vector_serializer< SV >::encode_remap_matrix(), put_8_16_32(), put_prefixed_array_16(), and bm::serializer< BV >::serialize().
|
inline |
Method puts array of short words (16 bits) into the encoding buffer.
Definition at line 459 of file encoding.h.
References BM_ASSERT, BMNOEXCEPT, and memcpy().
|
inline |
Puts 24 bits word into encoding buffer.
| w | - word to encode. |
Definition at line 555 of file encoding.h.
References BM_ASSERT, and BMNOEXCEPT.
|
inline |
Puts 32 bits word into encoding buffer.
| w | - word to encode. |
Definition at line 571 of file encoding.h.
References BMNOEXCEPT, and memcpy().
Referenced by bm::sparse_vector_serializer< SV >::encode_remap_matrix(), put_8_16_32(), put_prefixed_array_32(), bm::serializer< BV >::serialize(), and bm::sparse_vector_serializer< SV >::serialize().
|
inline |
Encodes array of 32-bit words.
Definition at line 644 of file encoding.h.
References BMNOEXCEPT, and memcpy().
|
inline |
Puts 48 bits word into encoding buffer.
| w | - word to encode. |
Definition at line 589 of file encoding.h.
References BM_ASSERT, and BMNOEXCEPT.
|
inline |
Puts 64 bits word into encoding buffer.
| w | - word to encode. |
Definition at line 606 of file encoding.h.
References BMNOEXCEPT, and memcpy().
Referenced by bm::sparse_vector_serializer< SV >::encode_remap_matrix(), bm::compressed_collection_serializer< CBC >::serialize(), bm::serializer< BV >::serialize(), and bm::sparse_vector_serializer< SV >::serialize().
| BMFORCEINLINE void bm::encoder::put_8 | ( | unsigned char | c | ) |
Puts one character into the encoding buffer.
| c | - character to encode |
Definition at line 434 of file encoding.h.
References BMFORCEINLINE, and BMNOEXCEPT.
Referenced by bm::serializer< BV >::encode_gap_block(), bm::sparse_vector_serializer< SV >::encode_remap_matrix(), put_8_16_32(), put_h64(), put_prefixed_array_16(), put_prefixed_array_32(), bm::compressed_collection_serializer< CBC >::serialize(), bm::serializer< BV >::serialize(), and bm::sparse_vector_serializer< SV >::serialize().
|
inline |
but gat plus value based on its VBR evaluation
Definition at line 487 of file encoding.h.
References BMNOEXCEPT, put_16(), put_32(), and put_8().
Referenced by bm::serializer< BV >::serialize().
|
inline |
Puts 64 bits word into encoding buffer with h-compression.
| w | - word to encode. |
Definition at line 628 of file encoding.h.
References BMNOEXCEPT, bm::compute_h64_mask(), and put_8().
|
inline |
Encode 8-bit prefix + an array.
Definition at line 417 of file encoding.h.
References BMNOEXCEPT, put_16(), and put_8().
|
inline |
Encode 8-bit prefix + an array.
Definition at line 406 of file encoding.h.
References BMNOEXCEPT, put_32(), and put_8().
Referenced by bm::serializer< BV >::serialize().
|
inline |
Set current memory stream position.
Definition at line 545 of file encoding.h.
References BMNOEXCEPT.
Referenced by bm::compressed_collection_serializer< CBC >::serialize(), and bm::serializer< BV >::serialize().
|
inline |
Returns size of the current encoding stream.
Definition at line 529 of file encoding.h.
References BMNOEXCEPT.
Referenced by bm::compressed_collection_serializer< CBC >::serialize(), bm::serializer< BV >::serialize(), and bm::sparse_vector_serializer< SV >::serialize().