Embedded Template Library  1.0
 All Classes Files Functions Variables Typedefs Friends Modules Pages
etl::checksum< TSum, ENDIANNESS > Class Template Reference

#include <checksum.h>

Public Types

typedef TSum value_type
 

Public Member Functions

 STATIC_ASSERT (is_unsigned< TSum >::value,"Signed TSum template parameter")
 
 checksum ()
 Default constructor.
 
template<typename TIterator >
 checksum (TIterator begin, const TIterator end)
 
void reset ()
 Resets the CRC to the initial state.
 
template<typename TValue >
void add (TValue value)
 
void add (uint8_t value)
 
template<typename TIterator >
void add (TIterator begin, const TIterator end)
 
value_type value () const
 Gets the checksum value.
 
template<typename TValue >
checksum< TSum, ENDIANNESS > & operator+= (TValue value)
 
 operator value_type () const
 Conversion operator to value_type.
 

Detailed Description

template<typename TSum, const int ENDIANNESS = endian::little>
class etl::checksum< TSum, ENDIANNESS >

Calculates the checksum.

Template Parameters
TSumThe type used for the sum.
ENDIANNESSThe endianness of the calculation for input types larger than uint8_t. Default = endian::little.

Constructor & Destructor Documentation

template<typename TSum , const int ENDIANNESS = endian::little>
template<typename TIterator >
etl::checksum< TSum, ENDIANNESS >::checksum ( TIterator  begin,
const TIterator  end 
)
inline

Constructor from range.

Parameters
beginStart of the range.
endEnd of the range.

Member Function Documentation

template<typename TSum , const int ENDIANNESS = endian::little>
template<typename TValue >
void etl::checksum< TSum, ENDIANNESS >::add ( TValue  value)
inline
Parameters
valueThe value to add to the checksum.
template<typename TSum , const int ENDIANNESS = endian::little>
void etl::checksum< TSum, ENDIANNESS >::add ( uint8_t  value)
inline
Parameters
valueThe char to add to the checksum.
template<typename TSum , const int ENDIANNESS = endian::little>
template<typename TIterator >
void etl::checksum< TSum, ENDIANNESS >::add ( TIterator  begin,
const TIterator  end 
)
inline
Parameters
beginStart of the range.
endEnd of the range.
Returns
The checksum result.
template<typename TSum , const int ENDIANNESS = endian::little>
template<typename TValue >
checksum<TSum, ENDIANNESS>& etl::checksum< TSum, ENDIANNESS >::operator+= ( TValue  value)
inline
Parameters
valueThe value to add to the checksum.

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