XRootD
XrdCksCalc Class Referenceabstract

#include <XrdCksCalc.hh>

+ Inheritance diagram for XrdCksCalc:
+ Collaboration diagram for XrdCksCalc:

Public Member Functions

 XrdCksCalc ()
 Constructor. More...
 
virtual ~XrdCksCalc ()
 Destructor. More...
 
virtual char * Calc (const char *Buff, int BLen)
 
virtual char * Current ()
 
virtual char * Final ()=0
 
virtual void Init ()=0
 
virtual XrdCksCalcNew ()=0
 
virtual void Recycle ()
 Recycle the checksum object as it is no longer needed. A default is given. More...
 
virtual const char * Type (int &csSize)=0
 
virtual void Update (const char *Buff, int BLen)=0
 

Detailed Description

This class defines the interface to a checksum computation. When this class is used to define a plugin computation, the initial XrdCksCalc computation object is created by the XrdCksCalcInit() function defined at the end of this file.

Definition at line 39 of file XrdCksCalc.hh.

Constructor & Destructor Documentation

◆ XrdCksCalc()

XrdCksCalc::XrdCksCalc ( )
inline

Constructor.

Definition at line 123 of file XrdCksCalc.hh.

123 {}

◆ ~XrdCksCalc()

virtual XrdCksCalc::~XrdCksCalc ( )
inlinevirtual

Destructor.

Definition at line 129 of file XrdCksCalc.hh.

129 {}

Member Function Documentation

◆ Calc()

virtual char* XrdCksCalc::Calc ( const char *  Buff,
int  BLen 
)
inlinevirtual

Calculate a one-time checksum. The obvious default implementation is provided and assumes that Init() may be called more than once.

Parameters
Buff-> Data to be checksummed.
BLen-> Length of the data in Buff.
Returns
the checksum value in binary format. The pointer to the value becomes invalid once the associated object is deleted.

Definition at line 54 of file XrdCksCalc.hh.

55  {Init(); Update(Buff, BLen); return Final();}
virtual char * Final()=0
virtual void Update(const char *Buff, int BLen)=0
virtual void Init()=0

References Final(), Init(), and Update().

+ Here is the call graph for this function:

◆ Current()

virtual char* XrdCksCalc::Current ( )
inlinevirtual

Get the current binary checksum value (defaults to final). However, the final checksum result is not affected.

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

Reimplemented in XrdCksCalcmd5.

Definition at line 65 of file XrdCksCalc.hh.

65 {return Final();}

References Final().

+ Here is the call graph for this function:

◆ Final()

virtual char* XrdCksCalc::Final ( )
pure 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.

Implemented in XrdCksCalczcrc32, XrdCksCalcmd5, XrdCksCalccrc32C, XrdCksCalccrc32, and XrdCksCalcadler32.

Referenced by Calc(), XrdCksManager::Calc(), XrdPfc::Info::CalcCksumMd5(), XrdCl::CheckSumManager::Calculate(), Current(), and XrdCl::CheckSumHelper::GetRawCheckSum().

+ Here is the caller graph for this function:

◆ Init()

virtual void XrdCksCalc::Init ( )
pure virtual

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

Implemented in XrdCksCalczcrc32, XrdCksCalcmd5, XrdCksCalccrc32C, XrdCksCalccrc32, and XrdCksCalcadler32.

Referenced by Calc(), and XrdPfc::Info::CalcCksumMd5().

+ Here is the caller graph for this function:

◆ New()

virtual XrdCksCalc* XrdCksCalc::New ( )
pure virtual

Get a new instance of the underlying checksum calculation object.

Returns
the checksum calculation object.

Implemented in XrdCksCalczcrc32, XrdCksCalcmd5, XrdCksCalccrc32C, XrdCksCalccrc32, and XrdCksCalcadler32.

Referenced by XrdCksManager::Calc(), and XrdCl::CheckSumManager::GetCalculator().

+ Here is the caller graph for this function:

◆ Recycle()

virtual void XrdCksCalc::Recycle ( )
inlinevirtual

Recycle the checksum object as it is no longer needed. A default is given.

Definition at line 95 of file XrdCksCalc.hh.

95 {delete this;}

Referenced by XrdCksManager::Calc().

+ Here is the caller graph for this function:

◆ Type()

virtual const char* XrdCksCalc::Type ( int &  csSize)
pure 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.

Implemented in XrdCksCalczcrc32, XrdCksCalcmd5, XrdCksCalccrc32C, XrdCksCalccrc32, and XrdCksCalcadler32.

Referenced by XrdCl::CheckSumManager::Calculate().

+ Here is the caller graph for this function:

◆ Update()

virtual void XrdCksCalc::Update ( const char *  Buff,
int  BLen 
)
pure 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.

Implemented in XrdCksCalczcrc32, XrdCksCalcmd5, XrdCksCalccrc32C, XrdCksCalccrc32, and XrdCksCalcadler32.

Referenced by Calc(), XrdCksManOss::Calc(), XrdCksManager::Calc(), XrdPfc::Info::CalcCksumMd5(), XrdCl::CheckSumManager::Calculate(), and XrdCl::CheckSumHelper::Update().

+ Here is the caller graph for this function:

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