XRootD
XrdOucMapP2X< T > Class Template Reference

#include <XrdOucMapP2X.hh>

+ Collaboration diagram for XrdOucMapP2X< T >:

Public Member Functions

 XrdOucMapP2X ()
 
 XrdOucMapP2X (const char *path, const char *name, T arg=0)
 
 ~XrdOucMapP2X ()
 
XrdOucMapP2X< T > * Find (const char *path)
 
void Insert (XrdOucMapP2X< T > *newp)
 
bool isEmpty ()
 
XrdOucMapP2X< T > * Match (const char *pd, const int pl=0)
 
void RepName (const char *newname)
 
void RepValu (T arg)
 
const char * theName ()
 
XrdOucMapP2X< T > * theNext ()
 
const char * thePath ()
 
theValu ()
 

Detailed Description

template<class T>
class XrdOucMapP2X< T >

Definition at line 37 of file XrdOucMapP2X.hh.

Constructor & Destructor Documentation

◆ XrdOucMapP2X() [1/2]

template<class T >
XrdOucMapP2X< T >::XrdOucMapP2X ( )
inline

Definition at line 86 of file XrdOucMapP2X.hh.

86 : Next(0), Name(0), Path(0), PLen(0), Valu(0) {}

◆ XrdOucMapP2X() [2/2]

template<class T >
XrdOucMapP2X< T >::XrdOucMapP2X ( const char *  path,
const char *  name,
arg = 0 
)
inline

Definition at line 88 of file XrdOucMapP2X.hh.

89  : Next(0), Name(strdup(name)), Path(strdup(path)),
90  PLen(strlen(path)), Valu(arg) {}

◆ ~XrdOucMapP2X()

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

Definition at line 92 of file XrdOucMapP2X.hh.

92 {if (Path) free(Path); if (Name) free(Name);}

Member Function Documentation

◆ Find()

template<class T >
XrdOucMapP2X<T>* XrdOucMapP2X< T >::Find ( const char *  path)
inline

Definition at line 41 of file XrdOucMapP2X.hh.

42  {XrdOucMapP2X<T> *p = Next;
43  int plen = strlen(path);
44  while(p && plen <= p->PLen)
45  {if (plen == p->PLen && !strcmp(p->Path, path))
46  return p;
47  p = p->Next;
48  }
49  return 0;
50  }

◆ Insert()

template<class T >
void XrdOucMapP2X< T >::Insert ( XrdOucMapP2X< T > *  newp)
inline

Definition at line 52 of file XrdOucMapP2X.hh.

53  {XrdOucMapP2X<T> *pp = 0, *p = Next;
54  while(p && newp->PLen < p->PLen)
55  {pp = p; p = p->Next;}
56  newp->Next = p;
57  if (pp) pp->Next = newp;
58  else Next = newp;
59  }

◆ isEmpty()

template<class T >
bool XrdOucMapP2X< T >::isEmpty ( )
inline

Definition at line 61 of file XrdOucMapP2X.hh.

61 {return Next == 0;}

◆ Match()

template<class T >
XrdOucMapP2X<T>* XrdOucMapP2X< T >::Match ( const char *  pd,
const int  pl = 0 
)
inline

Definition at line 76 of file XrdOucMapP2X.hh.

77  {int plen = (pl ? pl : strlen(pd));
78  XrdOucMapP2X<T> *p = Next;
79  while(p && plen >= p->PLen)
80  {if (!strncmp(pd, p->Path, p->PLen)) return p;
81  p=p->Next;
82  }
83  return 0;
84  }

◆ RepName()

template<class T >
void XrdOucMapP2X< T >::RepName ( const char *  newname)
inline

Definition at line 71 of file XrdOucMapP2X.hh.

72  {if (Path) {free(Name); Name = strdup(newname);}}

◆ RepValu()

template<class T >
void XrdOucMapP2X< T >::RepValu ( arg)
inline

Definition at line 74 of file XrdOucMapP2X.hh.

74 {Valu = arg;}

◆ theName()

template<class T >
const char* XrdOucMapP2X< T >::theName ( )
inline

Definition at line 63 of file XrdOucMapP2X.hh.

63 {return Name;}

◆ theNext()

template<class T >
XrdOucMapP2X<T>* XrdOucMapP2X< T >::theNext ( )
inline

Definition at line 65 of file XrdOucMapP2X.hh.

65 {return Next;}

◆ thePath()

template<class T >
const char* XrdOucMapP2X< T >::thePath ( )
inline

Definition at line 67 of file XrdOucMapP2X.hh.

67 {return Path;}

◆ theValu()

template<class T >
T XrdOucMapP2X< T >::theValu ( )
inline

Definition at line 69 of file XrdOucMapP2X.hh.

69 {return Valu;}

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