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::BasicXor< TResult, TInitValue > Class Template Reference

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

Detailed Description

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

Exclusive OR (XOR) of all bytes checksum calculator.

The checksum calculator class that applies XOR operation on 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::BasicXor< 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: