xrootd
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
XrdNetCache Class Reference

#include <XrdNetCache.hh>

Collaboration diagram for XrdNetCache:
Collaboration graph
[legend]

Classes

struct  anItem
 

Public Member Functions

void Add (XrdNetAddrInfo *hAddr, const char *hName)
 
char * Find (XrdNetAddrInfo *hAddr)
 
 XrdNetCache (int psize=987, int csize=1597)
 
 ~XrdNetCache ()
 

Static Public Member Functions

static void SetKT (int ktval)
 

Private Member Functions

void Expand ()
 
int GenKey (anItem &Item, XrdNetAddrInfo *hAddr)
 
anItemLocate (anItem &Item)
 

Private Attributes

XrdSysMutex myMutex
 
anItem ** nashtable
 
int prevtablesize
 
int nashtablesize
 
int nashnum
 
int Threshold
 

Static Private Attributes

static const int LoadMax = 80
 
static int keepTime
 

Constructor & Destructor Documentation

◆ XrdNetCache()

XrdNetCache::XrdNetCache ( int  psize = 987,
int  csize = 1597 
)

Constructor. When allocateing a new hash, two adjacent Fibonocci numbers. The series is simply n[j] = n[j-1] + n[j-2].

Parameters
psizethe correct Fibonocci antecedent to csize.
csizethe initial size of the table.

◆ ~XrdNetCache()

XrdNetCache::~XrdNetCache ( )
inline

Destructor. The XrdNetCache object is not designed to be deleted. Doing so will cause memory to be lost.

Member Function Documentation

◆ Add()

void XrdNetCache::Add ( XrdNetAddrInfo hAddr,
const char *  hName 
)

Add an address-hostname association to the cache. The address must be an INET family address; otherwise it is not added.

Parameters
hAddrpoints to the address of the name.
hNamepoints to the name to be associated with the address.

◆ Expand()

void XrdNetCache::Expand ( )
private

◆ Find()

char * XrdNetCache::Find ( XrdNetAddrInfo hAddr)

Locate an address-hostname association in the cache.

Parameters
hAddrpoints to the address of the name.
Returns
Success: an strdup'd string of the corresponding name. Failure: 0;

◆ GenKey()

int XrdNetCache::GenKey ( anItem Item,
XrdNetAddrInfo hAddr 
)
private

◆ Locate()

anItem * XrdNetCache::Locate ( anItem Item)
private

◆ SetKT()

static void XrdNetCache::SetKT ( int  ktval)
inlinestatic

Set the default keep time for entries in the cache during initialization.

Parameters
ktvalthe number of seconds to keep an entry in the cache.

References keepTime.

Member Data Documentation

◆ keepTime

int XrdNetCache::keepTime
staticprivate

Referenced by SetKT().

◆ LoadMax

const int XrdNetCache::LoadMax = 80
staticprivate

◆ myMutex

XrdSysMutex XrdNetCache::myMutex
private

◆ nashnum

int XrdNetCache::nashnum
private

◆ nashtable

anItem** XrdNetCache::nashtable
private

◆ nashtablesize

int XrdNetCache::nashtablesize
private

◆ prevtablesize

int XrdNetCache::prevtablesize
private

◆ Threshold

int XrdNetCache::Threshold
private

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