XRootD
XrdOucHash_Item< T > Class Template Reference

#include <XrdOucHash.hh>

+ Collaboration diagram for XrdOucHash_Item< T >:

Public Member Functions

 XrdOucHash_Item (unsigned long KeyHash, const char *KeyVal, T *KeyData, time_t KeyTime, XrdOucHash_Item< T > *KeyNext, XrdOucHash_Options KeyOpts)
 
 ~XrdOucHash_Item ()
 
int Count ()
 
T * Data ()
 
unsigned long Hash ()
 
const char * Key ()
 
XrdOucHash_Item< T > * Next ()
 
int Same (const unsigned long KeyHash, const char *KeyVal)
 
void SetNext (XrdOucHash_Item< T > *item)
 
time_t Time ()
 
void Update (int newcount, time_t newtime)
 

Detailed Description

template<class T>
class XrdOucHash_Item< T >

Definition at line 61 of file XrdOucHash.hh.

Constructor & Destructor Documentation

◆ XrdOucHash_Item()

template<class T >
XrdOucHash_Item< T >::XrdOucHash_Item ( unsigned long  KeyHash,
const char *  KeyVal,
T *  KeyData,
time_t  KeyTime,
XrdOucHash_Item< T > *  KeyNext,
XrdOucHash_Options  KeyOpts 
)
inline

Definition at line 86 of file XrdOucHash.hh.

92  {keyhash = KeyHash;
93  if (KeyOpts & Hash_keep) keyval = KeyVal;
94  else keyval = strdup(KeyVal);
95  if (KeyOpts & Hash_data_is_key) keydata = (T *)keyval;
96  else keydata = KeyData;
97  keytime = KeyTime;
98  entopts = KeyOpts;
99  next = KeyNext;
100  keycount= 0;
101  }
@ Hash_data_is_key
Definition: XrdOucHash.hh:52
@ Hash_keep
Definition: XrdOucHash.hh:55

References Hash_data_is_key, and Hash_keep.

◆ ~XrdOucHash_Item()

template<class T >
XrdOucHash_Item< T >::~XrdOucHash_Item ( )
inline

Definition at line 103 of file XrdOucHash.hh.

104  {if (!(entopts & Hash_keep))
105  {if (keydata && keydata != (T *)keyval
106  && !(entopts & Hash_keepdata))
107  {if (entopts & Hash_dofree) free(keydata);
108  else delete keydata;
109  }
110  if (keyval) free((void *)keyval);
111  }
112  keydata = 0; keyval = 0; keycount = 0;
113  }
@ Hash_keepdata
Definition: XrdOucHash.hh:57
@ Hash_dofree
Definition: XrdOucHash.hh:56

References Hash_dofree, Hash_keep, and Hash_keepdata.

Member Function Documentation

◆ Count()

template<class T >
int XrdOucHash_Item< T >::Count ( )
inline

Definition at line 64 of file XrdOucHash.hh.

64 {return keycount;}

Referenced by XrdOucHash< T >::Add().

+ Here is the caller graph for this function:

◆ Data()

template<class T >
T* XrdOucHash_Item< T >::Data ( )
inline

Definition at line 66 of file XrdOucHash.hh.

66 {return keydata;}

Referenced by XrdOucHash< T >::Add(), and XrdOucHash< T >::Apply().

+ Here is the caller graph for this function:

◆ Hash()

template<class T >
unsigned long XrdOucHash_Item< T >::Hash ( )
inline

Definition at line 68 of file XrdOucHash.hh.

68 {return keyhash;}

◆ Key()

template<class T >
const char* XrdOucHash_Item< T >::Key ( )
inline

Definition at line 70 of file XrdOucHash.hh.

70 {return keyval;}

Referenced by XrdOucHash< T >::Apply().

+ Here is the caller graph for this function:

◆ Next()

template<class T >
XrdOucHash_Item<T>* XrdOucHash_Item< T >::Next ( )
inline

Definition at line 72 of file XrdOucHash.hh.

72 {return next;}

Referenced by XrdOucHash< T >::Apply(), and XrdOucHash< T >::Purge().

+ Here is the caller graph for this function:

◆ Same()

template<class T >
int XrdOucHash_Item< T >::Same ( const unsigned long  KeyHash,
const char *  KeyVal 
)
inline

Definition at line 81 of file XrdOucHash.hh.

82  {return keyhash == KeyHash && !strcmp(keyval, KeyVal);}

◆ SetNext()

template<class T >
void XrdOucHash_Item< T >::SetNext ( XrdOucHash_Item< T > *  item)
inline

Definition at line 84 of file XrdOucHash.hh.

84 {next = item;}

Referenced by XrdOucHash< T >::Apply().

+ Here is the caller graph for this function:

◆ Time()

template<class T >
time_t XrdOucHash_Item< T >::Time ( )
inline

Definition at line 74 of file XrdOucHash.hh.

74 {return keytime;}

Referenced by XrdOucHash< T >::Add(), and XrdOucHash< T >::Apply().

+ Here is the caller graph for this function:

◆ Update()

template<class T >
void XrdOucHash_Item< T >::Update ( int  newcount,
time_t  newtime 
)
inline

Definition at line 76 of file XrdOucHash.hh.

77  {keycount = newcount;
78  if (newtime) keytime = newtime;
79  }

Referenced by XrdOucHash< T >::Add().

+ Here is the caller graph for this function:

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