CUBRID Engine  latest
CRC::Table< CRCType, CRCWidth > Struct Template Reference

CRC lookup table. After construction, the CRC parameters are fixed. More...

#include <CRC.h>

Collaboration diagram for CRC::Table< CRCType, CRCWidth >:
Collaboration graph

Public Member Functions

 Table (const Parameters< CRCType, CRCWidth > &parameters)
 Constructs a CRC table from a set of CRC parameters. More...
 
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...
 

Private Member Functions

void InitTable ()
 Initializes a CRC table. More...
 

Private Attributes

Parameters< CRCType, CRCWidth > parameters
 CRC parameters used to construct the table. More...
 
CRCType table [1<< CHAR_BIT]
 CRC lookup table. 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.

Definition at line 149 of file CRC.h.

Constructor & Destructor Documentation

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

Constructs a CRC table from a set of CRC parameters.

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

Definition at line 328 of file CRC.h.

References CRC::Table< CRCType, CRCWidth >::InitTable(), and CRC::Table< CRCType, CRCWidth >::parameters.

Member Function Documentation

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

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

Definition at line 356 of file CRC.h.

References CRC::Table< CRCType, CRCWidth >::parameters.

Referenced by CRC::Calculate(), and CRC::CalculateRemainder().

Here is the caller graph for this function:

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

Gets the CRC table.

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

Definition at line 368 of file CRC.h.

References CRC::Table< CRCType, CRCWidth >::table.

template<typename CRCType , crcpp_uint16 CRCWidth>
void CRC::Table< CRCType, CRCWidth >::InitTable ( )
inlineprivate

Initializes a CRC table.

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

Definition at line 392 of file CRC.h.

References crcpp_constexpr, CRC::Table< CRCType, CRCWidth >::parameters, and CRC::Table< CRCType, CRCWidth >::table.

Referenced by CRC::Table< CRCType, CRCWidth >::Table().

Here is the caller graph for this function:

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

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

Definition at line 381 of file CRC.h.

References CRC::Table< CRCType, CRCWidth >::table.

Member Data Documentation

template<typename CRCType, crcpp_uint16 CRCWidth>
CRCType CRC::Table< CRCType, CRCWidth >::table[1<< CHAR_BIT]
private

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