libxcks  0.1.0.1
libxcks::ThreadSafeChecksumCalculator Class Reference

A thread safe checksums calculator. More...

Public Member Functions

 ThreadSafeChecksumCalculator ()=delete
 Deleted default constructor. More...
 
 ThreadSafeChecksumCalculator (const ThreadSafeChecksumCalculator &)=delete
 Deleted copy constructor. More...
 
ThreadSafeChecksumCalculatoroperator= (const ThreadSafeChecksumCalculator &)=delete
 Delete assignment operator. More...
 
 ThreadSafeChecksumCalculator (const ArrayChecksum &ckArray)
 Constructor. More...
 
void resetChecksumToProcess ()
 Resets the current checksum to process. More...
 
ChecksumnextChecksumToProcess ()
 Gets the next checksum to process. More...
 

Static Public Member Functions

static void updateChecksum (ThreadSafeChecksumCalculator *c, const uint8_t *buf, size_t len)
 Updates the checksums with specified array of bytes. More...
 

Protected Attributes

ArrayChecksum checksums
 Array of checksums. More...
 
size_t curCk
 Current checksum to process. More...
 
shared_mutex mutex
 Mutex. More...
 

Detailed Description

A thread safe checksums calculator.

Definition at line 54 of file ckcalculator.cpp.

Constructor & Destructor Documentation

◆ ThreadSafeChecksumCalculator() [1/3]

libxcks::ThreadSafeChecksumCalculator::ThreadSafeChecksumCalculator ( )
delete

Deleted default constructor.

◆ ThreadSafeChecksumCalculator() [2/3]

libxcks::ThreadSafeChecksumCalculator::ThreadSafeChecksumCalculator ( const ThreadSafeChecksumCalculator )
delete

Deleted copy constructor.

◆ ThreadSafeChecksumCalculator() [3/3]

libxcks::ThreadSafeChecksumCalculator::ThreadSafeChecksumCalculator ( const ArrayChecksum ckArray)
inline

Constructor.

Parameters
ckArrayThe array of checksums.

Definition at line 76 of file ckcalculator.cpp.

Member Function Documentation

◆ nextChecksumToProcess()

Checksum* libxcks::ThreadSafeChecksumCalculator::nextChecksumToProcess ( )
inline

Gets the next checksum to process.

Returns
The next checksum to process or nullptr if there is no more checksum to process.

Definition at line 94 of file ckcalculator.cpp.

◆ operator=()

ThreadSafeChecksumCalculator& libxcks::ThreadSafeChecksumCalculator::operator= ( const ThreadSafeChecksumCalculator )
delete

Delete assignment operator.

◆ resetChecksumToProcess()

void libxcks::ThreadSafeChecksumCalculator::resetChecksumToProcess ( )
inline

Resets the current checksum to process.

Definition at line 82 of file ckcalculator.cpp.

◆ updateChecksum()

static void libxcks::ThreadSafeChecksumCalculator::updateChecksum ( ThreadSafeChecksumCalculator c,
const uint8_t *  buf,
size_t  len 
)
inlinestatic

Updates the checksums with specified array of bytes.

Parameters
cThe checksum instance to update.
bufThe buffer to use.
lenThe buffer's length.

Definition at line 110 of file ckcalculator.cpp.

Member Data Documentation

◆ checksums

ArrayChecksum libxcks::ThreadSafeChecksumCalculator::checksums
protected

Array of checksums.

Definition at line 57 of file ckcalculator.cpp.

◆ curCk

size_t libxcks::ThreadSafeChecksumCalculator::curCk
protected

Current checksum to process.

Definition at line 58 of file ckcalculator.cpp.

◆ mutex

shared_mutex libxcks::ThreadSafeChecksumCalculator::mutex
mutableprotected

Mutex.

Definition at line 59 of file ckcalculator.cpp.


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