XRootD
XrdCksCalccrc32C Class Reference

#include <XrdCksCalccrc32C.hh>

+ Inheritance diagram for XrdCksCalccrc32C:
+ Collaboration diagram for XrdCksCalccrc32C:

Public Member Functions

 XrdCksCalccrc32C ()
 
virtual ~XrdCksCalccrc32C ()
 
char * Final ()
 
void Init ()
 
XrdCksCalcNew ()
 
const char * Type (int &csSz)
 
void Update (const char *Buff, int BLen)
 
- Public Member Functions inherited from XrdCksCalc
 XrdCksCalc ()
 Constructor. More...
 
virtual ~XrdCksCalc ()
 Destructor. More...
 
virtual char * Calc (const char *Buff, int BLen)
 
virtual char * Current ()
 
virtual void Recycle ()
 Recycle the checksum object as it is no longer needed. A default is given. More...
 

Detailed Description

Definition at line 42 of file XrdCksCalccrc32C.hh.

Constructor & Destructor Documentation

◆ XrdCksCalccrc32C()

XrdCksCalccrc32C::XrdCksCalccrc32C ( )

Definition at line 47 of file XrdCksCalccrc32C.cc.

47 { Init(); }

References Init().

Referenced by New().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ ~XrdCksCalccrc32C()

XrdCksCalccrc32C::~XrdCksCalccrc32C ( )
virtual

Definition at line 49 of file XrdCksCalccrc32C.cc.

49 {}

Member Function Documentation

◆ Final()

char * XrdCksCalccrc32C::Final ( )
virtual

Get the actual checksum in binary format.

Returns
the checksum value in binary format. The pointer to the value becomes invalid once the associated object is deleted.

Implements XrdCksCalc.

Definition at line 38 of file XrdCksCalccrc32C.cc.

39 {
40  TheResult = C32CResult;
41 #ifndef Xrd_Big_Endian
42  TheResult = htonl(TheResult);
43 #endif
44  return (char *)&TheResult;
45 }

◆ Init()

void XrdCksCalccrc32C::Init ( )
virtual

Initializes data structures (must be called by constructor). This is always called to reuse the object for a new checksum.

Implements XrdCksCalc.

Definition at line 33 of file XrdCksCalccrc32C.cc.

34 {
35  C32CResult = C32C_XINIT;
36 }

Referenced by XrdCksCalccrc32C().

+ Here is the caller graph for this function:

◆ New()

XrdCksCalc * XrdCksCalccrc32C::New ( )
virtual

Get a new instance of the underlying checksum calculation object.

Returns
the checksum calculation object.

Implements XrdCksCalc.

Definition at line 31 of file XrdCksCalccrc32C.cc.

References XrdCksCalccrc32C().

+ Here is the call graph for this function:

◆ Type()

const char * XrdCksCalccrc32C::Type ( int &  csSize)
virtual

Get the checksum object algorithm name and the number bytes (i.e. size) required for the checksum value.

Parameters
csSize-> Parameter to hold the size of the checksum value.
Returns
the checksum algorithm's name. The name persists event after the checksum object is deleted.

Implements XrdCksCalc.

Definition at line 25 of file XrdCksCalccrc32C.cc.

26 {
27  csSz = sizeof(TheResult);
28  return "crc32c";
29 }

◆ Update()

void XrdCksCalccrc32C::Update ( const char *  Buff,
int  BLen 
)
virtual

Compute a running checksum. This method may be called repeatedly for data segments; with Final() returning the full checksum.

Parameters
Buff-> Data to be checksummed.
BLen-> Length of the data in Buff.

Implements XrdCksCalc.

Definition at line 20 of file XrdCksCalccrc32C.cc.

21 {
22  C32CResult = (unsigned int)XrdOucCRC::Calc32C(Buff, BLen, C32CResult);
23 }
static uint32_t Calc32C(const void *data, size_t count, uint32_t prevcs=0)
Definition: XrdOucCRC.cc:190

References XrdOucCRC::Calc32C().

+ Here is the call graph for this function:

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