COMMS
Template library intended to help with implementation of communication protocols.
Public Member Functions | List of all members
comms::protocol::checksum::Crc< TResult, TPoly, TInit, TFin, TReflect, TRefrectRem > Class Template Reference

#include "comms/protocol/checksum/Crc.h"

Detailed Description

template<typename TResult, TResult TPoly, TResult TInit = 0, TResult TFin = 0, bool TReflect = false, bool TRefrectRem = false>
class comms::protocol::checksum::Crc< TResult, TPoly, TInit, TFin, TReflect, TRefrectRem >

Calculate CRC values of all the bytes in the sequence.

Template Parameters
TResultType of the checksum result value.
TPolyPolynomial value
TInitInitial value
TFinFinal XOR value
TReflectPerform reflection of every byte
TReflectRemPerform reflection of the final value
See also
Crc_CCITT
Crc_16
Crc_32

Public Member Functions

template<typename TIter >
TResult operator() (TIter &iter, std::size_t len) const
 Operator that is invoked to calculate the checksum value. More...
 

Member Function Documentation

◆ operator()()

template<typename TResult , TResult TPoly, TResult TInit = 0, TResult TFin = 0, bool TReflect = false, bool TRefrectRem = false>
template<typename TIter >
TResult comms::protocol::checksum::Crc< TResult, TPoly, TInit, TFin, TReflect, TRefrectRem >::operator() ( TIter &  iter,
std::size_t  len 
) const

Operator that is invoked to calculate the checksum value.

Parameters
[in,out]iterInput iterator,
[in]lenNumber of bytes to summarise.
Returns
The checksum value.
Postcondition
The iterator is advanced by number of bytes read (len).

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