![]() |
Project
|
<<======================== Auxiliary classes =======================<< More...
#include <EncodedBlocks.h>
Public Types | |
typedef EncodedBlocks< H, N, W > | base |
template<typename source_T > | |
using | dictionaryType = std::variant< rans::RenormedSparseHistogram< source_T >, rans::RenormedDenseHistogram< source_T > > |
Public Member Functions | |
void | setHeader (const H &h) |
const H & | getHeader () const |
H & | getHeader () |
std::shared_ptr< H > | cloneHeader () const |
const auto & | getRegistry () const |
const auto & | getMetadata () const |
auto & | getMetadata (int i) const |
auto & | getBlock (int i) const |
template<typename source_T > | |
dictionaryType< source_T > | getDictionary (int i, ANSHeader ansVersion=ANSVersionUnspecified) const |
void | setANSHeader (const ANSHeader &h) |
const ANSHeader & | getANSHeader () const |
ANSHeader & | getANSHeader () |
bool | empty () const |
check if empty and valid | |
bool | flat () const |
check if flat and valid | |
void | clear () |
clear itself | |
size_t | compactify () |
Compactify by eliminating empty space. | |
size_t | size () const |
total allocated size in bytes | |
size_t | getFreeSize () const |
size remaining for additional data | |
template<typename V > | |
void | copyToFlat (V &vec) |
copy itself to flat buffer created on the fly from the vector | |
void | copyToFlat (void *base) |
copy itself to flat buffer created on the fly at the provided pointer. The destination block should be at least of size estimateSize() | |
size_t | appendToTree (TTree &tree, const std::string &name) const |
attach to tree | |
void | readFromTree (TTree &tree, const std::string &name, int ev=0) |
read from tree to non-flat object | |
template<typename VE , typename buffer_T > | |
o2::ctf::CTFIOSize | encode (const VE &src, int slot, uint8_t symbolTablePrecision, Metadata::OptStore opt, buffer_T *buffer=nullptr, const std::any &encoderExt={}, float memfc=1.f) |
encode vector src to bloc at provided slot | |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | encode (const input_IT srcBegin, const input_IT srcEnd, int slot, uint8_t symbolTablePrecision, Metadata::OptStore opt, buffer_T *buffer=nullptr, const std::any &encoderExt={}, float memfc=1.f) |
encode vector src to bloc at provided slot | |
template<class container_T , class container_IT = typename container_T::iterator> | |
o2::ctf::CTFIOSize | decode (container_T &dest, int slot, const std::any &decoderExt={}) const |
decode block at provided slot to destination vector (will be resized as needed) | |
template<typename D_IT , std::enable_if_t< detail::is_iterator_v< D_IT >, bool > = true> | |
o2::ctf::CTFIOSize | decode (D_IT dest, int slot, const std::any &decoderExt={}) const |
decode block at provided slot to destination pointer, the needed space assumed to be available | |
void | print (const std::string &prefix="", int verbosity=1) const |
print itself | |
void | dump (const std::string &prefix="", int ncol=20) const |
template<typename D_IT , std::enable_if_t< detail::is_iterator_v< D_IT >, bool > > | |
CTFIOSize | decode (D_IT dest, int slot, const std::any &decoderExt) const |
template<typename input_IT , typename buffer_T > | |
CTFIOSize | encodeRANSV1External (const input_IT srcBegin, const input_IT srcEnd, int slot, const std::any &encoderExt, buffer_T *buffer, double_t sizeEstimateSafetyFactor) |
template<typename input_IT , typename buffer_T > | |
CTFIOSize | encodeRANSV1Inplace (const input_IT srcBegin, const input_IT srcEnd, int slot, Metadata::OptStore opt, buffer_T *buffer, double_t sizeEstimateSafetyFactor) |
Static Public Member Functions | |
static constexpr int | getNBlocks () |
static size_t | getMinAlignedSize () |
static auto | get (void *head) |
cast arbitrary buffer head to container class. Head is supposed to respect the alignment | |
static auto | get (const void *head) |
static auto | getImage (const void *newHead) |
get const image of the container wrapper, with pointers in the image relocated to new head | |
static auto | create (void *head, size_t sz) |
create container from arbitrary buffer of predefined size (in bytes!!!). Head is supposed to respect the alignment | |
template<typename VD > | |
static auto | create (VD &v) |
create container from vector. Head is supposed to respect the alignment | |
static size_t | estimateBlockSize (int n) |
estimate free size needed to add new block | |
template<typename buffer_T > | |
static auto | expand (buffer_T &buffer, size_t newsizeBytes) |
expand the storage to new size in bytes | |
template<typename VD > | |
static void | readFromTree (VD &vec, TTree &tree, const std::string &name, int ev=0) |
read from tree to destination buffer vector | |
static std::vector< char > | createDictionaryBlocks (const std::vector< rans::DenseHistogram< int32_t > > &vfreq, const std::vector< Metadata > &prbits) |
create a special EncodedBlocks containing only dictionaries made from provided vector of frequency tables | |
Protected Member Functions | |
void | init (size_t sz) |
setup internal structure and registry for given buffer size (in bytes!!!) | |
size_t | estimateSize () const |
size_t | estimateSizeFromMetadata () const |
do the same using metadata info | |
void | fillFlatCopy (EncodedBlocks &dest) const |
Create its own flat copy in the destination empty flat object. | |
template<typename T > | |
auto | expandStorage (size_t slot, size_t nElemets, T *buffer=nullptr) -> decltype(auto) |
ANSHeader | checkANSVersion (ANSHeader ansVersion) const |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | entropyCodeRANSCompat (const input_IT srcBegin, const input_IT srcEnd, int slot, uint8_t symbolTablePrecision, buffer_T *buffer=nullptr, const std::any &encoderExt={}, float memfc=1.f) |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | entropyCodeRANSV1 (const input_IT srcBegin, const input_IT srcEnd, int slot, Metadata::OptStore opt, buffer_T *buffer=nullptr, const std::any &encoderExt={}, float memfc=1.f) |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | encodeRANSV1External (const input_IT srcBegin, const input_IT srcEnd, int slot, const std::any &encoderExt, buffer_T *buffer=nullptr, double_t sizeEstimateSafetyFactor=1) |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | encodeRANSV1Inplace (const input_IT srcBegin, const input_IT srcEnd, int slot, Metadata::OptStore opt, buffer_T *buffer=nullptr, double_t sizeEstimateSafetyFactor=1) |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | pack (const input_IT srcBegin, const input_IT srcEnd, int slot, rans::Metrics< typename std::iterator_traits< input_IT >::value_type > metrics, buffer_T *buffer=nullptr) |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | pack (const input_IT srcBegin, const input_IT srcEnd, int slot, buffer_T *buffer=nullptr) |
template<typename input_IT , typename buffer_T > | |
o2::ctf::CTFIOSize | store (const input_IT srcBegin, const input_IT srcEnd, int slot, Metadata::OptStore opt, buffer_T *buffer=nullptr) |
template<typename dst_IT > | |
CTFIOSize | decodeCompatImpl (dst_IT dest, int slot, const std::any &decoderExt) const |
template<typename dst_IT > | |
CTFIOSize | decodeRansV1Impl (dst_IT dest, int slot, const std::any &decoderExt) const |
template<typename dst_IT > | |
CTFIOSize | decodeUnpackImpl (dst_IT dest, int slot) const |
template<typename dst_IT > | |
CTFIOSize | decodeCopyImpl (dst_IT dest, int slot) const |
ClassDefNV (EncodedBlocks, 3) | |
Static Protected Member Functions | |
static void | relocate (const char *oldHead, char *newHead, char *wrapper, size_t newsize=0) |
template<typename D > | |
static size_t | fillTreeBranch (TTree &tree, const std::string &brname, D &dt, int compLevel, int splitLevel=99) |
add and fill single branch | |
template<typename D > | |
static bool | readTreeBranch (TTree &tree, const std::string &brname, D &dt, int ev=0) |
read single branch | |
Protected Attributes | |
Registry | mRegistry |
ANSHeader | mANSHeader |
H | mHeader |
std::array< Metadata, N > | mMetadata |
std::array< Block< W >, N > | mBlocks |
Static Protected Attributes | |
static constexpr Metadata::OptStore | FallbackStorageType {Metadata::OptStore::NONE} |
this is in fact stored, but to overcome TBuffer limits we have to define the branches per block!!! | |
<<======================== Auxiliary classes =======================<<
Definition at line 334 of file EncodedBlocks.h.
typedef EncodedBlocks<H, N, W> o2::ctf::EncodedBlocks< H, N, W >::base |
Definition at line 337 of file EncodedBlocks.h.
using o2::ctf::EncodedBlocks< H, N, W >::dictionaryType = std::variant<rans::RenormedSparseHistogram<source_T>, rans::RenormedDenseHistogram<source_T> > |
Definition at line 341 of file EncodedBlocks.h.
size_t o2::ctf::EncodedBlocks< H, N, W >::appendToTree | ( | TTree & | tree, |
const std::string & | name | ||
) | const |
|
inlineprotected |
Definition at line 564 of file EncodedBlocks.h.
|
protected |
void o2::ctf::EncodedBlocks< H, N, W >::clear | ( | ) |
|
inline |
Definition at line 350 of file EncodedBlocks.h.
|
inline |
Compactify by eliminating empty space.
Definition at line 466 of file EncodedBlocks.h.
void o2::ctf::EncodedBlocks< H, N, W >::copyToFlat | ( | V & | vec | ) |
copy itself to flat buffer created on the fly from the vector
Copy itself to flat buffer created on the fly from the vector
Definition at line 747 of file EncodedBlocks.h.
|
inline |
copy itself to flat buffer created on the fly at the provided pointer. The destination block should be at least of size estimateSize()
Definition at line 483 of file EncodedBlocks.h.
|
inlinestatic |
create container from vector. Head is supposed to respect the alignment
create container from arbitrary buffer of predefined size (in bytes!!!). Head is supposed to respect the alignment
Definition at line 871 of file EncodedBlocks.h.
|
inlinestatic |
create container from arbitrary buffer of predefined size (in bytes!!!). Head is supposed to respect the alignment
create container from arbitrary buffer of predefined size (in bytes!!!). Head is supposed to respect the alignment
Definition at line 858 of file EncodedBlocks.h.
|
static |
create a special EncodedBlocks containing only dictionaries made from provided vector of frequency tables
Definition at line 1521 of file EncodedBlocks.h.
|
inline |
decode block at provided slot to destination vector (will be resized as needed)
Definition at line 910 of file EncodedBlocks.h.
CTFIOSize o2::ctf::EncodedBlocks< H, N, W >::decode | ( | D_IT | dest, |
int | slot, | ||
const std::any & | decoderExt | ||
) | const |
Definition at line 921 of file EncodedBlocks.h.
o2::ctf::CTFIOSize o2::ctf::EncodedBlocks< H, N, W >::decode | ( | D_IT | dest, |
int | slot, | ||
const std::any & | decoderExt = {} |
||
) | const |
decode block at provided slot to destination pointer, the needed space assumed to be available
|
protected |
Definition at line 961 of file EncodedBlocks.h.
|
protected |
Definition at line 1087 of file EncodedBlocks.h.
|
protected |
Definition at line 999 of file EncodedBlocks.h.
|
protected |
Definition at line 1053 of file EncodedBlocks.h.
void o2::ctf::EncodedBlocks< H, N, W >::dump | ( | const std::string & | prefix = "" , |
int | ncol = 20 |
||
) | const |
Definition at line 1554 of file EncodedBlocks.h.
|
inline |
check if empty and valid
Definition at line 457 of file EncodedBlocks.h.
o2::ctf::CTFIOSize o2::ctf::EncodedBlocks< H, N, W >::encode | ( | const input_IT | srcBegin, |
const input_IT | srcEnd, | ||
int | slot, | ||
uint8_t | symbolTablePrecision, | ||
Metadata::OptStore | opt, | ||
buffer_T * | buffer = nullptr , |
||
const std::any & | encoderExt = {} , |
||
float | memfc = 1.f |
||
) |
|
inline |
encode vector src to bloc at provided slot
Definition at line 497 of file EncodedBlocks.h.
CTFIOSize o2::ctf::EncodedBlocks< H, N, W >::encodeRANSV1External | ( | const input_IT | srcBegin, |
const input_IT | srcEnd, | ||
int | slot, | ||
const std::any & | encoderExt, | ||
buffer_T * | buffer, | ||
double_t | sizeEstimateSafetyFactor | ||
) |
Definition at line 1296 of file EncodedBlocks.h.
|
protected |
CTFIOSize o2::ctf::EncodedBlocks< H, N, W >::encodeRANSV1Inplace | ( | const input_IT | srcBegin, |
const input_IT | srcEnd, | ||
int | slot, | ||
Metadata::OptStore | opt, | ||
buffer_T * | buffer, | ||
double_t | sizeEstimateSafetyFactor | ||
) |
Definition at line 1357 of file EncodedBlocks.h.
|
protected |
|
protected |
Definition at line 1175 of file EncodedBlocks.h.
|
protected |
Definition at line 1276 of file EncodedBlocks.h.
|
inlinestatic |
estimate free size needed to add new block
Definition at line 454 of file EncodedBlocks.h.
|
protected |
Estimate size of the buffer needed to store all compressed data in a contiguous block of memory, accounting for the alignment This method is to be called after reading object from the tree as a non-flat object!
Estimate size of the buffer needed to store all compressed data in a contiguos block of memory, accounting for alignment This method is to be called after reading object from the tree as a non-flat object!
Definition at line 758 of file EncodedBlocks.h.
|
protected |
do the same using metadata info
Estimate size from metadata This method is to be called after reading object from the tree as a non-flat object!
Definition at line 772 of file EncodedBlocks.h.
|
static |
expand the storage to new size in bytes
expand the storage to new size in bytes
Definition at line 785 of file EncodedBlocks.h.
|
protected |
Definition at line 1150 of file EncodedBlocks.h.
|
protected |
Create its own flat copy in the destination empty flat object.
Create its own flat copy in the destination empty flat object
Definition at line 732 of file EncodedBlocks.h.
|
inlinestaticprotected |
add and fill single branch
add and fill single branch
Definition at line 719 of file EncodedBlocks.h.
|
inline |
check if flat and valid
Definition at line 460 of file EncodedBlocks.h.
|
inlinestatic |
Definition at line 441 of file EncodedBlocks.h.
|
inlinestatic |
cast arbitrary buffer head to container class. Head is supposed to respect the alignment
Definition at line 440 of file EncodedBlocks.h.
|
inline |
Definition at line 433 of file EncodedBlocks.h.
|
inline |
Definition at line 432 of file EncodedBlocks.h.
|
inline |
Definition at line 362 of file EncodedBlocks.h.
|
inline |
Definition at line 370 of file EncodedBlocks.h.
|
inline |
size remaining for additional data
Definition at line 472 of file EncodedBlocks.h.
|
inline |
Definition at line 349 of file EncodedBlocks.h.
|
inline |
Definition at line 348 of file EncodedBlocks.h.
|
static |
get const image of the container wrapper, with pointers in the image relocated to new head
get const image of the container wrapper, with pointers in the image relocated to new head
Definition at line 844 of file EncodedBlocks.h.
|
inline |
Definition at line 354 of file EncodedBlocks.h.
|
inline |
Definition at line 356 of file EncodedBlocks.h.
|
inlinestatic |
Definition at line 437 of file EncodedBlocks.h.
|
inlinestaticconstexpr |
Definition at line 435 of file EncodedBlocks.h.
|
inline |
Definition at line 352 of file EncodedBlocks.h.
|
protected |
setup internal structure and registry for given buffer size (in bytes!!!)
setup internal structure and registry for given buffer size (in bytes!!!)
Definition at line 817 of file EncodedBlocks.h.
|
inlineprotected |
Definition at line 608 of file EncodedBlocks.h.
|
protected |
Definition at line 1466 of file EncodedBlocks.h.
void o2::ctf::EncodedBlocks< H, N, W >::print | ( | const std::string & | prefix = "" , |
int | verbosity = 1 |
||
) | const |
void o2::ctf::EncodedBlocks< H, N, W >::readFromTree | ( | TTree & | tree, |
const std::string & | name, | ||
int | ev = 0 |
||
) |
read from tree to non-flat object
read from tree to non-flat object
Definition at line 652 of file EncodedBlocks.h.
|
static |
read from tree to destination buffer vector
read from tree to destination buffer vector
Definition at line 664 of file EncodedBlocks.h.
|
staticprotected |
|
staticprotected |
relocate to different head position, newHead points on start of the dynamic buffer holding the data. the address of the static part might be actually different (wrapper). This different newHead and wrapper addresses must be used when the buffer pointed by newHead is const (e.g. received from the DPL input), in this case we create a wrapper, which points on these const data
relocate to different head position, newHead points on start of the dynamic buffer holding the data. the address of the static part might be actually different (wrapper). This different newHead and wrapper addresses must be used when the buffer pointed by newHead is const (e.g. received from the DPL input), in this case we create a wrapper, which points on these const data
Definition at line 800 of file EncodedBlocks.h.
|
inline |
Definition at line 428 of file EncodedBlocks.h.
|
inline |
Definition at line 344 of file EncodedBlocks.h.
|
inline |
total allocated size in bytes
Definition at line 469 of file EncodedBlocks.h.
|
protected |
Definition at line 1499 of file EncodedBlocks.h.
|
inlinestaticconstexprprotected |
this is in fact stored, but to overcome TBuffer limits we have to define the branches per block!!!
Definition at line 532 of file EncodedBlocks.h.
|
protected |
Definition at line 527 of file EncodedBlocks.h.
|
protected |
Definition at line 530 of file EncodedBlocks.h.
|
protected |
Definition at line 528 of file EncodedBlocks.h.
|
protected |
Definition at line 529 of file EncodedBlocks.h.
|
protected |
Definition at line 526 of file EncodedBlocks.h.