NCBI C++ ToolKit
|
Search Toolkit Book for bm::encoder
Memory encoding. More...
#include <util/bitset/encoding.h>
Public Types | |
typedef unsigned char * | position_type |
Public Member Functions | |
encoder (unsigned char *buf, size_t size) noexcept | |
Construction. More... | |
void | put_8 (unsigned char c) noexcept |
Puts one character into the encoding buffer. More... | |
void | put_16 (bm::short_t s) noexcept |
Puts short word (16 bits) into the encoding buffer. More... | |
void | put_16 (const bm::short_t *s, unsigned count) noexcept |
Method puts array of short words (16 bits) into the encoding buffer. More... | |
void | put_24 (bm::word_t w) noexcept |
Puts 24 bits word into encoding buffer. More... | |
void | put_32 (bm::word_t w) noexcept |
Puts 32 bits word into encoding buffer. More... | |
void | put_32 (const bm::word_t *w, unsigned count) noexcept |
Encodes array of 32-bit words. More... | |
void | put_48 (bm::id64_t w) noexcept |
Puts 48 bits word into encoding buffer. More... | |
void | put_64 (bm::id64_t w) noexcept |
Puts 64 bits word into encoding buffer. More... | |
void | put_h64 (bm::id64_t w) noexcept |
Puts 64 bits word into encoding buffer with h-compression. More... | |
void | put_8_16_32 (unsigned w, unsigned char c8, unsigned char c16, unsigned char c32) noexcept |
but gat plus value based on its VBR evaluation More... | |
void | put_prefixed_array_32 (unsigned char c, const bm::word_t *w, unsigned count) noexcept |
Encode 8-bit prefix + an array. More... | |
void | put_prefixed_array_16 (unsigned char c, const bm::short_t *s, unsigned count, bool encode_count) noexcept |
Encode 8-bit prefix + an array. More... | |
void | memcpy (const unsigned char *src, size_t count) noexcept |
copy bytes into target buffer or just rewind if src is NULL More... | |
size_t | size () const noexcept |
Returns size of the current encoding stream. More... | |
unsigned char * | get_pos () const noexcept |
Get current memory stream position. More... | |
void | set_pos (unsigned char *buf_pos) noexcept |
Set current memory stream position. More... | |
Private Attributes | |
unsigned char * | buf_ |
unsigned char * | start_ |
size_t | size_ |
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.
|
inlinenoexcept |
Construction.
buf | - memory buffer pointer. |
size | - size of the buffer |
Definition at line 398 of file encoding.h.
References size_.
|
inlinenoexcept |
Get current memory stream position.
Definition at line 537 of file encoding.h.
References buf_.
Referenced by bm::compressed_collection_serializer< CBC >::serialize().
|
inlinenoexcept |
copy bytes into target buffer or just rewind if src is NULL
Definition at line 516 of file encoding.h.
References BM_ASSERT, buf_, count, size_, and start_.
Referenced by bm::sparse_vector_serializer< SV >::encode_remap_matrix(), bm::decoder::get_16(), bm::decoder::get_32(), bm::decoder::get_64(), bm::decoder_base::memcpy(), put_16(), put_32(), put_64(), and bm::compressed_collection_serializer< CBC >::serialize().
|
inlinenoexcept |
Puts short word (16 bits) into the encoding buffer.
s | - short word to encode |
Definition at line 444 of file encoding.h.
References buf_, 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().
|
inlinenoexcept |
|
inlinenoexcept |
Puts 24 bits word into encoding buffer.
w | - word to encode. |
Definition at line 555 of file encoding.h.
References BM_ASSERT, and buf_.
Referenced by BitEncoderTest().
|
inlinenoexcept |
Puts 32 bits word into encoding buffer.
w | - word to encode. |
Definition at line 571 of file encoding.h.
References buf_, 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().
|
inlinenoexcept |
|
inlinenoexcept |
Puts 48 bits word into encoding buffer.
w | - word to encode. |
Definition at line 589 of file encoding.h.
References BM_ASSERT, and buf_.
Referenced by BitEncoderTest().
|
inlinenoexcept |
Puts 64 bits word into encoding buffer.
w | - word to encode. |
Definition at line 606 of file encoding.h.
References buf_, and memcpy().
Referenced by bm::sparse_vector_serializer< SV >::encode_remap_matrix(), bm::serializer< BV >::serialize(), bm::compressed_collection_serializer< CBC >::serialize(), and bm::sparse_vector_serializer< SV >::serialize().
|
inlinenoexcept |
Puts one character into the encoding buffer.
c | - character to encode |
Definition at line 434 of file encoding.h.
References buf_.
Referenced by BitEncoderTest(), 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::serializer< BV >::serialize(), bm::compressed_collection_serializer< CBC >::serialize(), and bm::sparse_vector_serializer< SV >::serialize().
|
inlinenoexcept |
but gat plus value based on its VBR evaluation
Definition at line 487 of file encoding.h.
References put_16(), put_32(), and put_8().
Referenced by bm::serializer< BV >::serialize().
|
inlinenoexcept |
Puts 64 bits word into encoding buffer with h-compression.
w | - word to encode. |
Definition at line 628 of file encoding.h.
References bm::compute_h64_mask(), i, and put_8().
Referenced by BitEncoderTest().
|
inlinenoexcept |
Encode 8-bit prefix + an array.
Definition at line 417 of file encoding.h.
|
inlinenoexcept |
Encode 8-bit prefix + an array.
Definition at line 406 of file encoding.h.
References count, put_32(), and put_8().
Referenced by bm::serializer< BV >::serialize().
|
inlinenoexcept |
Set current memory stream position.
Definition at line 545 of file encoding.h.
References buf_.
Referenced by bm::serializer< BV >::serialize(), and bm::compressed_collection_serializer< CBC >::serialize().
|
inlinenoexcept |
Returns size of the current encoding stream.
Definition at line 529 of file encoding.h.
Referenced by BitEncoderTest(), InterpolativeCodingTest(), bm::serializer< BV >::serialize(), bm::compressed_collection_serializer< CBC >::serialize(), and bm::sparse_vector_serializer< SV >::serialize().
|
private |
Definition at line 77 of file encoding.h.
Referenced by bm::decoder_base::decoder_base(), bm::decoder::get_16(), bm::decoder::get_24(), bm::decoder::get_32(), bm::decoder::get_32_AND(), bm::decoder::get_32_OR(), bm::decoder::get_48(), bm::decoder::get_64(), bm::decoder_base::get_8(), bm::decoder_base::get_h64(), get_pos(), bm::decoder_base::get_pos(), memcpy(), bm::decoder_base::memcpy(), put_16(), put_24(), put_32(), put_48(), put_64(), put_8(), bm::decoder_base::seek(), bm::decoder_base::set_pos(), set_pos(), size(), and bm::decoder_base::size().
|
private |
Definition at line 79 of file encoding.h.
|
private |
Definition at line 78 of file encoding.h.
Referenced by bm::decoder_base::decoder_base(), memcpy(), size(), and bm::decoder_base::size().