Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
daqdataformats::NOvACheckSum Class Reference

#include "/cvmfs/nova-development.opensciencegrid.org/novasoft/releases/N20-12-01/DAQDataFormats/cxx/include/NOvACheckSum.h"

Public Member Functions

 ~NOvACheckSum ()
 Default Destructor. More...
 
uint32_t processCRC (void *buffer, uint32_t size)
 

Static Public Member Functions

static NOvACheckSumgetInstance ()
 Method to obtain the class instance. More...
 

Private Member Functions

 NOvACheckSum ()
 Default Constructor. Has to be private, since we are using singleton. More...
 

Private Attributes

nova_crc_32_type _CRC32
 CRC-32C object. Used when producing CRC. More...
 

Static Private Attributes

static NOvACheckSum_instanceID = NULL
 Instance pointer for the singleton class. More...
 

Detailed Description

Definition at line 10 of file NOvACheckSum.h.

Constructor & Destructor Documentation

daqdataformats::NOvACheckSum::~NOvACheckSum ( )

Default Destructor.

Definition at line 11 of file NOvACheckSum.cpp.

11 {}
daqdataformats::NOvACheckSum::NOvACheckSum ( )
private

Default Constructor. Has to be private, since we are using singleton.

Definition at line 10 of file NOvACheckSum.cpp.

Referenced by getInstance().

10 {}

Member Function Documentation

NOvACheckSum * daqdataformats::NOvACheckSum::getInstance ( )
static

Method to obtain the class instance.

getInstance method returns the current instance if there is one or creates the initial instance if there is not one

Definition at line 16 of file NOvACheckSum.cpp.

References _instanceID, and NOvACheckSum().

Referenced by daqdataformats::RawDAQData::calculateCheckSum().

16  {
17  if(_instanceID == NULL) // Check if there is an instance active
18  _instanceID = new NOvACheckSum(); // If there is not, make a new one
19 
20  return _instanceID;
21  }// end of NOvACheckSum::getInstance
static NOvACheckSum * _instanceID
Instance pointer for the singleton class.
Definition: NOvACheckSum.h:22
NOvACheckSum()
Default Constructor. Has to be private, since we are using singleton.
uint32_t daqdataformats::NOvACheckSum::processCRC ( void buffer,
uint32_t  size 
)

Reset _CRC32 object

Calculate CRC

return it

Definition at line 25 of file NOvACheckSum.cpp.

References _CRC32.

Referenced by daqdataformats::RawDAQData::calculateCheckSum().

25  {
26 
27  /// Reset _CRC32 object
28  _CRC32.reset();
29  /// Calculate CRC
30  _CRC32.process_bytes((char*)buffer, size * 4);
31 
32  /// return it
33  return _CRC32.checksum();
34  }
nova_crc_32_type _CRC32
CRC-32C object. Used when producing CRC.
Definition: NOvACheckSum.h:24
::xsd::cxx::tree::buffer< char > buffer
Definition: Database.h:179

Member Data Documentation

nova_crc_32_type daqdataformats::NOvACheckSum::_CRC32
private

CRC-32C object. Used when producing CRC.

Definition at line 24 of file NOvACheckSum.h.

Referenced by processCRC().

NOvACheckSum * daqdataformats::NOvACheckSum::_instanceID = NULL
staticprivate

Instance pointer for the singleton class.

Definition at line 22 of file NOvACheckSum.h.

Referenced by getInstance().


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