ivutils
Loading...
Searching...
No Matches
pair_pack< T1, T2, packer_t1, packer_t2, pair_tt, index_t > Class Template Reference

Class for packing pairs of data of two different types. More...

#include <seqpack.h>

Inheritance diagram for pair_pack< T1, T2, packer_t1, packer_t2, pair_tt, index_t >:
Collaboration diagram for pair_pack< T1, T2, packer_t1, packer_t2, pair_tt, index_t >:

Public Member Functions

 pair_pack (packer_t1 *sp1=new packer_t1(), packer_t2 *sp2=new packer_t2())
 constructor with possible packer construction specification
 
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
 

Detailed Description

template<class T1, class T2, class packer_t1 = data_pack<T1>, class packer_t2 = data_pack<T2>, class pair_tt = std::pair<typename packer_t1::value_t,typename packer_t2::value_t >, class index_t = std::ptrdiff_t>
class pair_pack< T1, T2, packer_t1, packer_t2, pair_tt, index_t >

Class for packing pairs of data of two different types.

The types are packed by different packers but recovered simultaneously by an iterator pair_tt is the returned value type, it must have at least one of the following constructors pair_tt(value_t1 &a,value_t2 &b) pair_tt(const value_t1 &a,const value_t2 &b) pair_tt(value_t1 a,value_t2 b) which may construct a type passing arguments either by value or by reference. WARNING: recording by the returned references is possible for some packers, but may lead to changes in other packed elements, the policy of recording is determined by packers By default the returned value type of pair_pack is pair<value_t1,value_t2> returned by value (no recording possible) see refpair_pack()


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