AFF3CT
A Fast Forward Error Correction Tool!
 All Classes Files Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
CRC_i< B > Class Template Referenceabstract

Adds/builds and checks a Cyclic Redundancy Check (CRC) for a set of information bits. More...

#include <CRC.hpp>

Inheritance diagram for CRC_i< B >:
Module SC_CRC< B > CRC_NO< B > CRC_polynomial< B > CRC_polynomial_double< B > CRC_polynomial_inter< B >

Public Member Functions

 CRC_i (const int K, const int n_frames=1, const std::string name="CRC_i")
 Constructor. More...
 
virtual ~CRC_i ()
 Destructor.
 
virtual int size () const =0
 Gets the size of the CRC (the number of bits for the CRC signature). More...
 
virtual void build (mipp::vector< B > &U_K)=0
 Computes and adds the CRC in the vector of information bits (the CRC bits are often put at the end of the vector). More...
 
virtual bool check (const mipp::vector< B > &V_K, const int n_frames=-1)=0
 Checks if the CRC is verified or not. More...
 
- Public Member Functions inherited from Module
 Module (const int n_frames=1, const std::string name="Module")
 Constructor. More...
 
virtual ~Module ()
 Destructor.
 
virtual void set_n_frames (const int n_frames)
 Set the number of frames. More...
 
virtual int get_n_frames () const
 Get the number of frames. More...
 
void rename (const std::string name)
 Rename the Module. More...
 

Protected Attributes

const int K
 
- Protected Attributes inherited from Module
int n_frames
 
std::string name
 

Detailed Description

template<typename B>
class CRC_i< B >

Adds/builds and checks a Cyclic Redundancy Check (CRC) for a set of information bits.

Template Parameters
Btype of the bits in the CRC.

Please use CRC for inheritance (instead of CRC_i).

Constructor & Destructor Documentation

template<typename B >
CRC_i< B >::CRC_i ( const int  K,
const int  n_frames = 1,
const std::string  name = "CRC_i< B >" 
)
inline

Constructor.

Parameters
Knumber of information bits (the CRC bits are included in K).
n_framesnumber of frames to process in the CRC.
nameCRC's name.

Member Function Documentation

template<typename B >
virtual void CRC_i< B >::build ( mipp::vector< B > &  U_K)
pure virtual

Computes and adds the CRC in the vector of information bits (the CRC bits are often put at the end of the vector).

Parameters
U_Ka vector (size = K - CRC<B>::size()) containing the information bits, adds "CRC<B>::size()" bits in U_K.

Implemented in CRC_polynomial< B >, CRC_polynomial_double< B >, and CRC_NO< B >.

template<typename B >
virtual bool CRC_i< B >::check ( const mipp::vector< B > &  V_K,
const int  n_frames = -1 
)
pure virtual

Checks if the CRC is verified or not.

Parameters
V_Ka vector containing information bits plus the CRC bits.
n_framesyou should not use this parameter unless you know what you are doing, this parameter redefine the number of frames to check specifically in this method.
Returns
true if the CRC is verified, false otherwise.

Implemented in CRC_polynomial< B >, CRC_polynomial_inter< B >, and CRC_NO< B >.

template<typename B >
virtual int CRC_i< B >::size ( ) const
pure virtual

Gets the size of the CRC (the number of bits for the CRC signature).

Returns
the size of the CRC.

Implemented in CRC_polynomial< B >, and CRC_NO< B >.

Member Data Documentation

template<typename B >
const int CRC_i< B >::K
protected

Number of information bits (the CRC bits are included in K)


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