test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ESCrcKchipFast Class Reference

#include <ESCrcKchipFast.h>

Public Member Functions

void add (unsigned int data)
 
 ESCrcKchipFast ()
 
uint32_t get_crc ()
 
void init ()
 
bool isCrcOk (unsigned int crcin=0x0000)
 
void reset ()
 
 ~ESCrcKchipFast ()
 

Private Attributes

uint32_t crc
 

Detailed Description

Definition at line 4 of file ESCrcKchipFast.h.

Constructor & Destructor Documentation

ESCrcKchipFast::ESCrcKchipFast ( )
inline

Definition at line 12 of file ESCrcKchipFast.h.

References init(), and reset().

12  {
13  init();
14  reset() ;
15  };
ESCrcKchipFast::~ESCrcKchipFast ( )
inline

Definition at line 44 of file ESCrcKchipFast.h.

44 { } ;

Member Function Documentation

void ESCrcKchipFast::add ( unsigned int  data)
inline

Definition at line 25 of file ESCrcKchipFast.h.

References crc, and i.

Referenced by counter.Counter::register().

25  {
26  for (int i=0;i<16;i++)
27  {
28  if ((crc&0x0001) == (data&0x0001))
29  crc=crc>>1;
30  else
31  crc=(crc>>1)^0x8408; // flipped 0x1021;
32  data=(data>>1);
33  }
34  };
int i
Definition: DBlmapReader.cc:9
uint32_t ESCrcKchipFast::get_crc ( )
inline

Definition at line 36 of file ESCrcKchipFast.h.

References crc.

Referenced by isCrcOk().

36  {
37  return crc ;
38  };
void ESCrcKchipFast::init ( void  )
inline

Definition at line 17 of file ESCrcKchipFast.h.

References crc.

Referenced by ESCrcKchipFast().

17  {
18  crc = 0x0ffff ;
19  }
bool ESCrcKchipFast::isCrcOk ( unsigned int  crcin = 0x0000)
inline

Definition at line 40 of file ESCrcKchipFast.h.

References get_crc().

40  {
41  return ((get_crc()==crcin) ? true : false );
42  };
uint32_t get_crc()
void ESCrcKchipFast::reset ( void  )
inline

Definition at line 21 of file ESCrcKchipFast.h.

References crc.

Referenced by ESCrcKchipFast().

21  {
22  crc = 0x0ffff ;
23  } ;

Member Data Documentation

uint32_t ESCrcKchipFast::crc
private

Definition at line 8 of file ESCrcKchipFast.h.

Referenced by add(), get_crc(), init(), and reset().