BitMagic-C++
|
Compressed (sparse collection of objects) More...
#include <bmsparsevec_util.h>
Public Types | |
typedef BV | bvector_type |
typedef BV::size_type | size_type |
typedef size_type | key_type |
typedef size_type | address_type |
typedef Value | value_type |
typedef Value | mapped_type |
typedef std::vector< value_type > | container_type |
typedef bm::bvps_addr_resolver< bvector_type > | address_resolver_type |
Public Member Functions | |
compressed_collection () | |
bool | push_back (key_type key, const value_type &val) |
Add new value to compressed collection. More... | |
const value_type & | at (key_type key) const |
find and return const associated value (with bounds/presense checking) More... | |
value_type & | at (key_type key) |
find and return associated value (with bounds/presense checking) More... | |
void | sync () |
Checkpoint method to prepare collection for reading. More... | |
void | optimize (bm::word_t *temp_block=0) |
perform memory optimizations/compression More... | |
bool | resolve (key_type key, address_type *addr) const |
Resolve key address (index) in the dense vector. More... | |
const value_type & | get (address_type addr) const |
Get access to associated value by resolved address. More... | |
const address_resolver_type & | resolver () const |
Get address resolver. More... | |
address_resolver_type & | resolver () |
Get address resolver. More... | |
size_t | size () const |
size of collection More... | |
bool | equal (const compressed_collection< Value, BV > &ccoll) const |
perform equality comparison with another collection More... | |
container_type & | container () |
return dense container for direct access (this should be treated as an internal function designed for deserialization) More... | |
Protected Member Functions | |
void | throw_range_error (const char *err_msg) const |
More... | |
Protected Attributes | |
address_resolver_type | addr_res_ |
address resolver More... | |
container_type | dense_vect_ |
compressed space container More... | |
key_type | last_add_ |
last added element More... | |
Compressed (sparse collection of objects)
Definition at line 226 of file bmsparsevec_util.h.
compressed_collection< Value, BV >::value_type & bm::compressed_collection< Value, BV >::at | ( | key_type | key | ) |
find and return associated value (with bounds/presense checking)
Definition at line 684 of file bmsparsevec_util.h.
const compressed_collection< Value, BV >::value_type & bm::compressed_collection< Value, BV >::at | ( | key_type | key | ) | const |
find and return const associated value (with bounds/presense checking)
Definition at line 669 of file bmsparsevec_util.h.
|
inline |
return dense container for direct access (this should be treated as an internal function designed for deserialization)
Definition at line 296 of file bmsparsevec_util.h.
References bm::compressed_collection< Value, BV >::dense_vect_.
bool bm::compressed_collection< Value, BV >::equal | ( | const compressed_collection< Value, BV > & | ccoll | ) | const |
perform equality comparison with another collection
Definition at line 711 of file bmsparsevec_util.h.
References bm::compressed_collection< Value, BV >::addr_res_, BM_ASSERT, bm::compressed_collection< Value, BV >::dense_vect_, and bm::bvps_addr_resolver< BV >::get_bvector().
const compressed_collection< Value, BV >::value_type & bm::compressed_collection< Value, BV >::get | ( | address_type | addr | ) | const |
Get access to associated value by resolved address.
Definition at line 660 of file bmsparsevec_util.h.
void bm::compressed_collection< Value, BV >::optimize | ( | bm::word_t * | temp_block = 0 | ) |
perform memory optimizations/compression
Definition at line 639 of file bmsparsevec_util.h.
bool bm::compressed_collection< Value, BV >::push_back | ( | key_type | key, |
const value_type & | val | ||
) |
Add new value to compressed collection.
Must be added in sorted key order (growing).
Unsorted will not be added!
Definition at line 610 of file bmsparsevec_util.h.
References BM_ASSERT.
bool bm::compressed_collection< Value, BV >::resolve | ( | key_type | key, |
address_type * | addr | ||
) | const |
Resolve key address (index) in the dense vector.
Definition at line 647 of file bmsparsevec_util.h.
|
inline |
Get address resolver.
Definition at line 283 of file bmsparsevec_util.h.
References bm::compressed_collection< Value, BV >::addr_res_.
|
inline |
Get address resolver.
Definition at line 279 of file bmsparsevec_util.h.
References bm::compressed_collection< Value, BV >::addr_res_.
|
inline |
size of collection
Definition at line 287 of file bmsparsevec_util.h.
References bm::compressed_collection< Value, BV >::dense_vect_.
void bm::compressed_collection< Value, BV >::sync |
Checkpoint method to prepare collection for reading.
Definition at line 631 of file bmsparsevec_util.h.
|
protected |
Definition at line 699 of file bmsparsevec_util.h.
References BM_ASSERT_THROW.
|
protected |
address resolver
Definition at line 302 of file bmsparsevec_util.h.
Referenced by bm::compressed_collection< Value, BV >::equal(), and bm::compressed_collection< Value, BV >::resolver().
|
protected |
compressed space container
Definition at line 303 of file bmsparsevec_util.h.
Referenced by bm::compressed_collection< Value, BV >::container(), bm::compressed_collection< Value, BV >::equal(), and bm::compressed_collection< Value, BV >::size().
|
protected |
last added element
Definition at line 304 of file bmsparsevec_util.h.