Project
Loading...
Searching...
No Matches
o2::data_compression::HuffmanNode< _CodeType > Class Template Reference

Container holding information to build Huffman tree. More...

#include <HuffmanCodec.h>

Public Types

using self_type = HuffmanNode
 
using pointer = self_type *
 
using shared_pointer = std::shared_ptr< self_type >
 
using CodeType = _CodeType
 

Public Member Functions

 HuffmanNode ()
 
 HuffmanNode (const HuffmanNode &other)=default
 
HuffmanNodeoperator= (const HuffmanNode &other)=default
 
 ~HuffmanNode ()=default
 
 HuffmanNode (double weight, uint16_t index=~uint16_t(0))
 
 HuffmanNode (shared_pointer left, shared_pointer right)
 
bool operator< (const HuffmanNode &other) const
 
CodeType getBinaryCode () const
 
uint16_t getBinaryCodeLength () const
 
uint16_t getIndex () const
 
pointer getLeftChild () const
 
pointer getRightChild () const
 
void setBinaryCode (uint16_t codeLen, CodeType code)
 
self_typeoperator<<= (bool bit)
 
self_typeoperator>>= (bool bit)
 
void print (std::ostream &stream=std::cout) const
 

Detailed Description

template<typename _CodeType>
class o2::data_compression::HuffmanNode< _CodeType >

Container holding information to build Huffman tree.

The container holds information about child nodes in the tree, the accumulated weight (probability) according to coding model. Leave node, i.e. the end of the tree branches, also contain the Huffman code after assignment.

Definition at line 51 of file HuffmanCodec.h.

Member Typedef Documentation

◆ CodeType

template<typename _CodeType >
using o2::data_compression::HuffmanNode< _CodeType >::CodeType = _CodeType

Definition at line 57 of file HuffmanCodec.h.

◆ pointer

template<typename _CodeType >
using o2::data_compression::HuffmanNode< _CodeType >::pointer = self_type*

Definition at line 55 of file HuffmanCodec.h.

◆ self_type

template<typename _CodeType >
using o2::data_compression::HuffmanNode< _CodeType >::self_type = HuffmanNode

Definition at line 54 of file HuffmanCodec.h.

◆ shared_pointer

template<typename _CodeType >
using o2::data_compression::HuffmanNode< _CodeType >::shared_pointer = std::shared_ptr<self_type>

Definition at line 56 of file HuffmanCodec.h.

Constructor & Destructor Documentation

◆ HuffmanNode() [1/4]

template<typename _CodeType >
o2::data_compression::HuffmanNode< _CodeType >::HuffmanNode ( )
inline

Definition at line 59 of file HuffmanCodec.h.

◆ HuffmanNode() [2/4]

template<typename _CodeType >
o2::data_compression::HuffmanNode< _CodeType >::HuffmanNode ( const HuffmanNode< _CodeType > &  other)
default

◆ ~HuffmanNode()

template<typename _CodeType >
o2::data_compression::HuffmanNode< _CodeType >::~HuffmanNode ( )
default

◆ HuffmanNode() [3/4]

template<typename _CodeType >
o2::data_compression::HuffmanNode< _CodeType >::HuffmanNode ( double  weight,
uint16_t  index = ~uint16_t(0) 
)
inline

Definition at line 64 of file HuffmanCodec.h.

◆ HuffmanNode() [4/4]

template<typename _CodeType >
o2::data_compression::HuffmanNode< _CodeType >::HuffmanNode ( shared_pointer  left,
shared_pointer  right 
)
inline

Definition at line 69 of file HuffmanCodec.h.

Member Function Documentation

◆ getBinaryCode()

template<typename _CodeType >
CodeType o2::data_compression::HuffmanNode< _CodeType >::getBinaryCode ( ) const
inline

Definition at line 81 of file HuffmanCodec.h.

◆ getBinaryCodeLength()

template<typename _CodeType >
uint16_t o2::data_compression::HuffmanNode< _CodeType >::getBinaryCodeLength ( ) const
inline

Definition at line 82 of file HuffmanCodec.h.

◆ getIndex()

template<typename _CodeType >
uint16_t o2::data_compression::HuffmanNode< _CodeType >::getIndex ( ) const
inline

Definition at line 83 of file HuffmanCodec.h.

◆ getLeftChild()

template<typename _CodeType >
pointer o2::data_compression::HuffmanNode< _CodeType >::getLeftChild ( ) const
inline

Definition at line 86 of file HuffmanCodec.h.

◆ getRightChild()

template<typename _CodeType >
pointer o2::data_compression::HuffmanNode< _CodeType >::getRightChild ( ) const
inline

Definition at line 87 of file HuffmanCodec.h.

◆ operator<()

template<typename _CodeType >
bool o2::data_compression::HuffmanNode< _CodeType >::operator< ( const HuffmanNode< _CodeType > &  other) const
inline

Definition at line 79 of file HuffmanCodec.h.

◆ operator<<=()

template<typename _CodeType >
self_type & o2::data_compression::HuffmanNode< _CodeType >::operator<<= ( bool  bit)
inline

Definition at line 95 of file HuffmanCodec.h.

◆ operator=()

template<typename _CodeType >
HuffmanNode & o2::data_compression::HuffmanNode< _CodeType >::operator= ( const HuffmanNode< _CodeType > &  other)
default

◆ operator>>=()

template<typename _CodeType >
self_type & o2::data_compression::HuffmanNode< _CodeType >::operator>>= ( bool  bit)
inline

Definition at line 108 of file HuffmanCodec.h.

◆ print()

template<typename _CodeType >
void o2::data_compression::HuffmanNode< _CodeType >::print ( std::ostream &  stream = std::cout) const
inline

Definition at line 119 of file HuffmanCodec.h.

◆ setBinaryCode()

template<typename _CodeType >
void o2::data_compression::HuffmanNode< _CodeType >::setBinaryCode ( uint16_t  codeLen,
CodeType  code 
)
inline

Definition at line 88 of file HuffmanCodec.h.


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