CRC::Table< CRCType, CRCWidth > Struct Template Reference

CRC lookup table. More...

#include <CRC.h>

Public Member Functions

const Parameters< CRCType, CRCWidth > & GetParameters () const
 Gets the CRC parameters used to construct the CRC table. More...
 
const CRCType * GetTable () const
 Gets the CRC table. More...
 
CRCType operator[] (unsigned char index) const
 Gets an entry in the CRC table. More...
 
 Table (const Parameters< CRCType, CRCWidth > &parameters)
 Constructs a CRC table from a set of CRC parameters. More...
 

Detailed Description

template<typename CRCType, crcpp_uint16 CRCWidth>
struct CRC::Table< CRCType, CRCWidth >

CRC lookup table.

After construction, the CRC parameters are fixed.

Note
A CRC table can be used for multiple CRC calculations.

Constructor & Destructor Documentation

◆ Table()

template<typename CRCType , crcpp_uint16 CRCWidth>
CRC::Table< CRCType, CRCWidth >::Table ( const Parameters< CRCType, CRCWidth > &  parameters)

Constructs a CRC table from a set of CRC parameters.

Parameters
[in]parametersCRC parameters
Template Parameters
CRCTypeInteger type for storing the CRC result
CRCWidthNumber of bits in the CRC

Member Function Documentation

◆ GetParameters()

template<typename CRCType , crcpp_uint16 CRCWidth>
const CRC::Parameters< CRCType, CRCWidth > & CRC::Table< CRCType, CRCWidth >::GetParameters ( ) const

Gets the CRC parameters used to construct the CRC table.

Template Parameters
CRCTypeInteger type for storing the CRC result
CRCWidthNumber of bits in the CRC
Returns
CRC parameters

Referenced by CRC::Calculate().

◆ GetTable()

template<typename CRCType , crcpp_uint16 CRCWidth>
const CRCType * CRC::Table< CRCType, CRCWidth >::GetTable ( ) const

Gets the CRC table.

Template Parameters
CRCTypeInteger type for storing the CRC result
CRCWidthNumber of bits in the CRC
Returns
CRC table

◆ operator[]()

template<typename CRCType , crcpp_uint16 CRCWidth>
CRCType CRC::Table< CRCType, CRCWidth >::operator[] ( unsigned char  index) const

Gets an entry in the CRC table.

Parameters
[in]indexIndex into the CRC table
Template Parameters
CRCTypeInteger type for storing the CRC result
CRCWidthNumber of bits in the CRC
Returns
CRC table entry

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