ivutils
Loading...
Searching...
No Matches
group_pack< T, comp_pr, set_t, index_t, group_pr > Class Template Reference

Packer optimized to pack groups of data. More...

#include <seqpack.h>

Inheritance diagram for group_pack< T, comp_pr, set_t, index_t, group_pr >:
Collaboration diagram for group_pack< T, comp_pr, set_t, index_t, group_pr >:

Classes

class  iterator
 total number of packed elements More...
 

Public Member Functions

template<class packer_t >
int aux_depends_on (const packer_t &other)
 this allows to share auxiliary data with other packer THE PACKERS MUST BE SYNCRONIZED EXTERNALLY: next_group must be called in sync with parent packer USE WITH CARE
 
template<class rec_it >
index_t next_group (rec_it beg, index_t n=1)
 put a group of n elements starting from beg packing the group with 0 elements will lead to the following behaviour when unpacked: get_group_count(it) will return 0, *it will return the next recorded element (if it exists) then after ++it, *it will return the same element, but get_group_count(it) will return the next group count THE ELEMENTS POINTED BY BEG WILL NOT BE RECORDED WHEN n=0 DO NOT USE *it if get_group_count(it) returns 0!
 
std::size_t packed_size () const
 returns the size in bytes ignoring vector overheads
 
std::size_t data_size () const
 returns full unpacked sequence size in bytes
 
- Public Member Functions inherited from data_pack< T, comp_pr, set_t, index_t >
template<class rec_it >
index_t next_group (rec_it beg, index_t n=1)
 put a group of n elements starting with beg
 
std::size_t packed_size () const
 returns the size in bytes ignoring vector overheads
 
std::size_t data_size () const
 returns full unpacked sequence size in bytes
 

Protected Attributes

mngptr< index_pack< index_t > > npack
 packer of number of elements in each packed group.
 
index_pack< index_t > ipack
 container for unique values of packed data
 
- Protected Attributes inherited from data_pack< T, comp_pr, set_t, index_t >
index_pack< index_t > ipack
 container for unique values of packed data
 

Detailed Description

template<class T, class comp_pr = std::equal_to<T>, class set_t = vector_set<T, comp_pr>, class index_t = std::ptrdiff_t, class group_pr = subgroup_test<typename set_t::key_compare>>
class group_pack< T, comp_pr, set_t, index_t, group_pr >

Packer optimized to pack groups of data.

set_t can be container_set (vector_set or list_set). The comparison predicate is of type comp_pr which must have bool opertor()(const T&,const T&) returning true for duplicated sequences

Member Data Documentation

◆ npack

template<class T , class comp_pr = std::equal_to<T>, class set_t = vector_set<T, comp_pr>, class index_t = std::ptrdiff_t, class group_pr = subgroup_test<typename set_t::key_compare>>
mngptr<index_pack<index_t> > group_pack< T, comp_pr, set_t, index_t, group_pr >::npack
protected

packer of number of elements in each packed group.

this reference can be shared with some other group_pack


The documentation for this class was generated from the following file: