XRootD
XrdCmsKey Class Reference

#include <XrdCmsKey.hh>

+ Collaboration diagram for XrdCmsKey:

Public Member Functions

 XrdCmsKey (char *key=0, int klen=0)
 
 ~XrdCmsKey ()
 
int Equiv (XrdCmsKey &oth)
 
int operator!= (const XrdCmsKey &oth)
 
XrdCmsKeyoperator= (const XrdCmsKey &rhs)
 
int operator== (const XrdCmsKey &oth)
 
void setHash ()
 

Public Attributes

unsigned int Hash
 
short Len
 
unsigned char Ref
 
unsigned char TOD
 
XrdCmsKeyItemTODRef
 
char * Val
 

Detailed Description

Definition at line 47 of file XrdCmsKey.hh.

Constructor & Destructor Documentation

◆ XrdCmsKey()

XrdCmsKey::XrdCmsKey ( char *  key = 0,
int  klen = 0 
)
inline

Definition at line 75 of file XrdCmsKey.hh.

76  : TODRef(0), Val(key), Hash(0), Len(klen), Ref('\0') {}
unsigned int Hash
Definition: XrdCmsKey.hh:53
XrdCmsKeyItem * TODRef
Definition: XrdCmsKey.hh:51
char * Val
Definition: XrdCmsKey.hh:52
unsigned char Ref
Definition: XrdCmsKey.hh:56
short Len
Definition: XrdCmsKey.hh:54

◆ ~XrdCmsKey()

XrdCmsKey::~XrdCmsKey ( )
inline

Definition at line 77 of file XrdCmsKey.hh.

77 {};

Member Function Documentation

◆ Equiv()

int XrdCmsKey::Equiv ( XrdCmsKey oth)
inline

Definition at line 60 of file XrdCmsKey.hh.

61  {return Hash == oth.Hash && Ref == oth.Ref;}

References Hash, and Ref.

Referenced by XrdCmsCache::AddFile(), XrdCmsCache::UnkFile(), and XrdCmsCache::WT4File().

+ Here is the caller graph for this function:

◆ operator!=()

int XrdCmsKey::operator!= ( const XrdCmsKey oth)
inline

Definition at line 72 of file XrdCmsKey.hh.

73  {return Hash != oth.Hash || strcmp(Val, oth.Val);}

References Hash, and Val.

◆ operator=()

XrdCmsKey& XrdCmsKey::operator= ( const XrdCmsKey rhs)
inline

Definition at line 63 of file XrdCmsKey.hh.

64  {Val = strdup(rhs.Val); Hash = rhs.Hash;
65  Len = rhs.Len;
66  return *this;
67  }

References Hash, Len, and Val.

◆ operator==()

int XrdCmsKey::operator== ( const XrdCmsKey oth)
inline

Definition at line 69 of file XrdCmsKey.hh.

70  {return Hash == oth.Hash && !strcmp(Val, oth.Val);}

References Hash, and Val.

◆ setHash()

void XrdCmsKey::setHash ( )

Definition at line 48 of file XrdCmsKey.cc.

49 {
50  if (!Len) Len = strlen(Val);
51  if (!(Hash = XrdOucCRC::CRC32((const unsigned char *)Val, Len))) Hash = 1;
52 }
static uint32_t CRC32(const unsigned char *data, int count)
Definition: XrdOucCRC.cc:171

References XrdOucCRC::CRC32(), and Hash.

Referenced by XrdCmsNash::Add(), and XrdCmsNash::Find().

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

Member Data Documentation

◆ Hash

◆ Len

short XrdCmsKey::Len

◆ Ref

unsigned char XrdCmsKey::Ref

◆ TOD

unsigned char XrdCmsKey::TOD

◆ TODRef

◆ Val


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