Grok 20.3.2
grk::TagTree< T > Class Template Reference

#include <TagTree.h>

Classes

struct  Node

Public Member Functions

 TagTree (uint16_t leavesWidth, uint16_t leavesHeight)
 TagTree constructor.
 ~TagTree ()=default
constexpr T getUninitializedValue () const noexcept
void reset ()
 Reset a tag tree (set all leaves to 0).
void set (uint64_t leafno, T value)
 Set the value of a leaf of a tag tree.
bool encode (t1_t2::BitIO *bio, uint64_t leafno, T threshold)
 Encode the value of a leaf of the tag tree up to a given threshold.
void decode (t1_t2::BitIO *bio, uint64_t leafno, T threshold, T *value)
 Decode the value of a leaf of the tag tree up to a given threshold.

Private Member Functions

void buildTree ()

Private Attributes

uint16_t leavesWidth_
uint16_t leavesHeight_
std::vector< Nodenodes_
std::vector< uint32_t > parents_
std::vector< T > leafCache_

Constructor & Destructor Documentation

◆ TagTree()

template<typename T>
grk::TagTree< T >::TagTree ( uint16_t leavesWidth,
uint16_t leavesHeight )
inline

TagTree constructor.

Parameters
leavesWidthWidth of the array of leaves of the tree
leavesHeightHeight of the array of leaves of the tree
Returns
a new tag tree if successful, otherwise nullptr

◆ ~TagTree()

template<typename T>
grk::TagTree< T >::~TagTree ( )
default

Member Function Documentation

◆ buildTree()

template<typename T>
void grk::TagTree< T >::buildTree ( )
inlineprivate

◆ decode()

template<typename T>
void grk::TagTree< T >::decode ( t1_t2::BitIO * bio,
uint64_t leafno,
T threshold,
T * value )
inline

Decode the value of a leaf of the tag tree up to a given threshold.

Parameters
bioPointer to a BIO handle
leafnoNumber that identifies the leaf to decode
thresholdThreshold to use when decoding value of the leaf
valuethe node's value

◆ encode()

template<typename T>
bool grk::TagTree< T >::encode ( t1_t2::BitIO * bio,
uint64_t leafno,
T threshold )
inline

Encode the value of a leaf of the tag tree up to a given threshold.

Parameters
bioBIO handle
leafnoleaf to compress
thresholdThreshold to use when encoding value of the leaf
Returns
true if successful, otherwise false

◆ getUninitializedValue()

template<typename T>
T grk::TagTree< T >::getUninitializedValue ( ) const
inlineconstexprnoexcept

◆ reset()

template<typename T>
void grk::TagTree< T >::reset ( )
inline

Reset a tag tree (set all leaves to 0).

Referenced by grk::TagTree< uint8_t >::TagTree().

◆ set()

template<typename T>
void grk::TagTree< T >::set ( uint64_t leafno,
T value )
inline

Set the value of a leaf of a tag tree.

Parameters
leafnoleaf to modify
valuenew value of leaf

Member Data Documentation

◆ leafCache_

template<typename T>
std::vector<T> grk::TagTree< T >::leafCache_
private

◆ leavesHeight_

template<typename T>
uint16_t grk::TagTree< T >::leavesHeight_
private

◆ leavesWidth_

template<typename T>
uint16_t grk::TagTree< T >::leavesWidth_
private

◆ nodes_

template<typename T>
std::vector<Node> grk::TagTree< T >::nodes_
private

◆ parents_

template<typename T>
std::vector<uint32_t> grk::TagTree< T >::parents_
private

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