NDEVR
API Documentation
CheckSumGenerator< t_hash_type >

Logic for generating checksums based on initial value and a type. More...

Public Member Functions

 CheckSumGenerator ()
 Constructs a CheckSumGenerator with default initial values.
t_hash_type getCheckSum ()
 Returns the current computed checksum value.
template<class t_type, class t_allocator, class t_memory_manager>
void update (const Buffer< t_type, t_allocator, t_memory_manager > &buffer)
 Updates the checksum by processing all elements in the given buffer.
template<class t_type, class t_allocator, class t_memory_manager>
void update (const Buffer< t_type, t_allocator, t_memory_manager > &buffer, uint04 max_size)
 Updates the checksum by processing elements in the buffer up to a maximum count.
template<>
void update (const t_hash_type &hash_value)
 Specialization that directly incorporates a hash-type value into the checksum.
template<class t_type>
void update (const t_type &object)
 Updates the checksum with a single object by splitting it into hash-type-sized chunks.

Public Attributes

t_hash_type m_checksum
 The running checksum value accumulated from all processed data.
t_hash_type type_buffer
 Temporary buffer used for copying object data during checksum computation.

Detailed Description

template<class t_hash_type>
class CheckSumGenerator< t_hash_type >

Logic for generating checksums based on initial value and a type.


Checksums can be used to validate data or data streams.

Definition at line 43 of file CheckSumGenerator.h.

Member Function Documentation

◆ getCheckSum()

template<class t_hash_type>
t_hash_type CheckSumGenerator< t_hash_type >::getCheckSum ( )
inline

Returns the current computed checksum value.

Returns
The accumulated checksum.

Definition at line 128 of file CheckSumGenerator.h.

References m_checksum.

◆ update() [1/4]

template<class t_hash_type>
template<class t_type, class t_allocator, class t_memory_manager>
void CheckSumGenerator< t_hash_type >::update ( const Buffer< t_type, t_allocator, t_memory_manager > & buffer)
inline

Updates the checksum by processing all elements in the given buffer.

Parameters
[in]bufferThe buffer of elements to incorporate into the checksum.

Definition at line 58 of file CheckSumGenerator.h.

References m_checksum, and update().

Referenced by update(), update(), and update().

◆ update() [2/4]

template<class t_hash_type>
template<class t_type, class t_allocator, class t_memory_manager>
void CheckSumGenerator< t_hash_type >::update ( const Buffer< t_type, t_allocator, t_memory_manager > & buffer,
uint04 max_size )
inline

Updates the checksum by processing elements in the buffer up to a maximum count.

Parameters
[in]bufferThe buffer of elements to incorporate into the checksum.
[in]max_sizeThe maximum number of elements to process from the buffer.

Definition at line 75 of file CheckSumGenerator.h.

References getMin(), and update().

◆ update() [3/4]

template<class t_hash_type>
template<>
void CheckSumGenerator< t_hash_type >::update ( const t_hash_type & hash_value)
inline

Specialization that directly incorporates a hash-type value into the checksum.

Parameters
[in]hash_valueThe value to fold into the running checksum.

Definition at line 120 of file CheckSumGenerator.h.

References m_checksum.

◆ update() [4/4]

template<class t_hash_type>
template<class t_type>
void CheckSumGenerator< t_hash_type >::update ( const t_type & object)
inline

Updates the checksum with a single object by splitting it into hash-type-sized chunks.

Parameters
[in]objectThe object to incorporate into the checksum.

Definition at line 88 of file CheckSumGenerator.h.

References type_buffer, and update().


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