XRootD
XrdOucPinKing< T > Class Template Reference

#include <XrdOucPinKing.hh>

+ Collaboration diagram for XrdOucPinKing< T >:

Public Member Functions

 XrdOucPinKing (const char *drctv, XrdOucEnv &envR, XrdSysError &errR, XrdVersionInfo *vinfo=0)
 
 ~XrdOucPinKing ()
 
void Add (const char *path, const char *parms, bool push=false)
 
T * Load (const char *Symbol)
 

Detailed Description

template<class T>
class XrdOucPinKing< T >

Definition at line 49 of file XrdOucPinKing.hh.

Constructor & Destructor Documentation

◆ XrdOucPinKing()

template<class T >
XrdOucPinKing< T >::XrdOucPinKing ( const char *  drctv,
XrdOucEnv envR,
XrdSysError errR,
XrdVersionInfo *  vinfo = 0 
)
inline

Constructor

Parameters
drctvRef to the directive that initiated the load. The text is used in error messages to relate the directive to the error. E.g. "sec.entlib" -> "Unable to load sec.entlib plugin...."
envRRef to environment.
errRRef to the message routing object.
vinfoPointer to the version information of the caller. If the pointer is nil, no version checking occurs.

Definition at line 91 of file XrdOucPinKing.hh.

95  : Drctv(drctv), eInfo(envR), eMsg(errR), vInfo(vinfo)
96  {pinVec.push_back(pinInfo(0,0));}

◆ ~XrdOucPinKing()

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

Destructor

Upon deletion, if the plugin was successfully loaded, it is persisted.

Definition at line 104 of file XrdOucPinKing.hh.

104 {}

Member Function Documentation

◆ Add()

template<class T >
void XrdOucPinKing< T >::Add ( const char *  path,
const char *  parms,
bool  push = false 
)
inline

Add an Pin object to the load list.

Parameters
pathPointer to the pin's path.
parmsPointer to the pin's parameters.
pushWhen true pushes the pin onto the load stack. Otherwise, replaces or defines the base plugin.

Definition at line 62 of file XrdOucPinKing.hh.

65  {if (push) pinVec.push_back(pinInfo(path, parms));
66  else pinVec[0] = pinInfo(path, parms);
67  }

◆ Load()

template<class T >
T * XrdOucPinKing< T >::Load ( const char *  Symbol)

Load all necessary plugins.

Parameters
SymbolPointer to the external symobol of the plugin.
Returns
Pointer to the plugin upon success and nil upon failure.

Definition at line 130 of file XrdOucPinKing.hh.

131 {
132  XrdOucPinObject<T> *objPIN;
133  T *lastPIN = 0;
134  typename std::vector<pinInfo>::iterator it;
135 
136  for (it = pinVec.begin(); it != pinVec.end(); it++)
137  {if (it->path.size() == 0) continue;
138  it->pinP = new XrdOucPinLoader(&eMsg, vInfo, Drctv, it->path.c_str());
139  objPIN = (XrdOucPinObject<T> *)(it->pinP->Resolve(Symbol));
140  if (!objPIN
141  || !(lastPIN = objPIN->getInstance(it->parm.c_str(), eInfo,
142  *(eMsg.logger()), lastPIN)))
143  return 0;
144  }
145  return lastPIN;
146 }
virtual T * getInstance(const char *parms, XrdOucEnv &envR, XrdSysLogger &logR, T *prevP)=0
XrdSysLogger * logger(XrdSysLogger *lp=0)
Definition: XrdSysError.hh:141

References eMsg, and XrdOucPinObject< T >::getInstance().

+ Here is the call graph for this function:

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