Loading...
Searching...
No Matches
XrdCmsRTable Class Reference

`#include <XrdCmsRTable.hh>`

Collaboration diagram for XrdCmsRTable:

## Public Member Functions

| XrdCmsRTable ()
| ~XrdCmsRTable ()
short | Add (XrdCmsNode *nP)
void | Del (XrdCmsNode *nP)
XrdCmsNode * | Find (short Num, int Inst)
void | Lock ()
void | Send (const char *What, const char *data, int dlen)
void | UnLock ()

## Detailed Description

Definition at line 39 of file XrdCmsRTable.hh.

## Constructor & Destructor Documentation

## XrdCmsRTable()

XrdCmsRTable::XrdCmsRTable | ( |  | ) |

inline

Definition at line 55 of file XrdCmsRTable.hh.

{memset(Rtable, 0, sizeof(Rtable)); Hwm = -1;}

## ~XrdCmsRTable()

XrdCmsRTable::~XrdCmsRTable | ( |  | ) |

inline

Definition at line 57 of file XrdCmsRTable.hh.

{}

## Member Function Documentation

## Add()

short XrdCmsRTable::Add | ( | XrdCmsNode * | nP | ) |

Definition at line 46 of file XrdCmsRTable.cc.

{
int i;
// Find a free slot for this node.
//
myMutex.Lock();
for (i = 1; i < maxRD; i++) if (!Rtable[i]) break;
// Insert the node if found
//
if (i >= maxRD) i = 0;
else {Rtable[i] = nP;
if (i > Hwm) Hwm = i;
}
// All done
//
myMutex.UnLock();
return static_cast<short>(i);
}
maxRD
#define maxRD
Definition XrdCmsTypes.hh:44

References maxRD.

## Del()

void XrdCmsRTable::Del | ( | XrdCmsNode * | nP | ) |

Definition at line 72 of file XrdCmsRTable.cc.

{
int i;
// Find the slot for this node.
//
myMutex.Lock();
for (i = 1; i <= Hwm; i++) if (Rtable[i] == nP) break;
// Remove the node if found
//
if (i <= Hwm)
{Rtable[i] = 0;
if (i == Hwm) {while(--i) if (Rtable[i]) break; Hwm = i;}
}
// All done
//
myMutex.UnLock();
}

## Find()

XrdCmsNode * XrdCmsRTable::Find | ( | short | Num,
|  | int | Inst )

Definition at line 101 of file XrdCmsRTable.cc.

{
// Find the instance of the node in the indicated slot
//
if (Num <= Hwm && Rtable[Num] && Rtable[Num]->Inst() == Inst)
return Rtable[Num];
return (XrdCmsNode *)0;
}

## Lock()

void XrdCmsRTable::Lock | ( |  | ) |

inline

Definition at line 51 of file XrdCmsRTable.hh.

{myMutex.Lock();}

## Send()

void XrdCmsRTable::Send | ( | const char * | What,
|  | const char * | data,
|  | int | dlen )

Definition at line 115 of file XrdCmsRTable.cc.

{
EPNAME("Send");
int i;
// Send the data to all nodes in this table
//
myMutex.Lock();
for (i = 1; i <= Hwm; i++)
if (Rtable[i])
{DEBUG(What <<" to " <<Rtable[i]->Ident);
Rtable[i]->Send(data, dlen);
}
myMutex.UnLock();
}
DEBUG
#define DEBUG(x)
Definition XrdBwmTrace.hh:54
EPNAME
#define EPNAME(x)
Definition XrdBwmTrace.hh:56

References DEBUG, and EPNAME.

## UnLock()

void XrdCmsRTable::UnLock | ( |  | ) |

inline

Definition at line 53 of file XrdCmsRTable.hh.

{myMutex.UnLock();}

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

- XrdCmsRTable.hh
- XrdCmsRTable.cc