COMMS
Template library intended to help with implementation of communication protocols.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
comms::protocol::checksum::BasicSum< TResult, TInitValue > Class Template Reference

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

Detailed Description

template<typename TResult = std::uint8_t, TResult TInitValue = 0>
class comms::protocol::checksum::BasicSum< TResult, TInitValue >

Summary of all bytes checksum calculator.

The checksum calculator class that sums all the bytes and returns the result as a checksum value.

Template Parameters
TResultType of the checksum result value.
TInitValueInitial value

Public Member Functions

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

Member Function Documentation

◆ operator()()

template<typename TResult = std::uint8_t, TResult TInitValue = 0>
template<typename TIter >
TResult comms::protocol::checksum::BasicSum< TResult, TInitValue >::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: