gatb.core-API-0.0.0
Abundance< Type, Number > Struct Template Reference

Define a type that associates a value and an abundance. More...

#include <Abundance.hpp>

Public Member Functions

 Abundance (const Type &val, const Number &abund)
 
Abundanceoperator= (const Abundance &a)
 
const Number & getAbundance () const
 
const Type & getValue () const
 
bool operator== (const Abundance &other) const
 

Static Public Member Functions

static hid_t hdf5 (bool &isCompound)
 

Detailed Description

template<typename Type, typename Number = u_int16_t>
struct gatb::core::tools::misc::Abundance< Type, Number >

Define a type that associates a value and an abundance.

We have often to count kmers, so we define a specific structure for this.

The structure has two templates types:

  • Type : the type of items (likely kmer type)
  • Number : abundance associated to the item

Constructor & Destructor Documentation

Abundance ( const Type &  val,
const Number &  abund 
)
inline

Constructor.

Parameters
[in]val: value of the item
[in]abund: abundance of the item.

Member Function Documentation

const Number& getAbundance ( ) const
inline

Get the abundance of the object

Returns
the abundance.
const Type& getValue ( ) const
inline

Get the value of the item

Returns
the value.
static hid_t hdf5 ( bool &  isCompound)
inlinestatic

Creates a HDF5 type identifier for the [kmer,abundance] structure. This type will be used for dumping Count instances in a HDF5 file (like SortingCount algorithm does).

Parameters
[in]isCompound: tells whether the structure is compound (SHOULD BE OBSOLETE IN THE FUTURE)
Returns
the HDF5 identifier for the type.
Abundance& operator= ( const Abundance< Type, Number > &  a)
inline

Affectation operator.

Parameters
[in]a: object to be copied.
Returns
the copied instance.
bool operator== ( const Abundance< Type, Number > &  other) const
inline

Equality operator. alues and abundances must be equals

Parameters
[in]other: object to be compared to
Returns
true if values and abundances are the same

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