12 #ifndef ROOT_TPluginManager
13 #define ROOT_TPluginManager
94 #ifndef ROOT_TMethodCall
97 #ifndef ROOT_TVirtualMutex
100 #ifndef ROOT_TInterpreter
133 fBase(), fRegexp(), fClass(), fPlugin(), fCtor(), fOrigin(),
134 fCallEnv(0), fMethod(0), fCanCall(0), fIsMacro(
kTRUE), fIsGlobal(
kTRUE) { }
136 const char *className,
const char *pluginName,
137 const char *ctor,
const char *origin);
161 auto nargs =
sizeof...(params);
180 if ((
gDebug > 1) && (nargs != (
int)
sizeof...(params))) {
181 Warning(
"ExecPlugin",
"Announced number of args different from the real number of argument passed %d vs %lu",
182 nargs, (
unsigned long)
sizeof...(params) );
210 void AddHandler(
const char *base,
const char *regexp,
211 const char *className,
const char *pluginName,
212 const char *ctor = 0,
const char *origin = 0);
213 void RemoveHandler(
const char *base,
const char *regexp = 0);
TPluginHandler & operator=(const TPluginHandler &)
void LoadHandlerMacros(const char *path)
Load all plugin macros from the specified path/base directory.
R__EXTERN TVirtualMutex * gInterpreterMutex
Int_t WritePluginRecords(const char *envFile, const char *plugin=0) const
Write in the specified environment config file the plugin records.
THashTable * fBasesLoaded
void RemoveHandler(const char *base, const char *regexp=0)
Remove handler for the specified base class and the specified regexp.
void Print(Option_t *opt="") const
Print info about the plugin handler.
TPluginHandler * FindHandler(const char *base, const char *uri=0)
Returns the handler if there exists a handler for the specified URI.
void LoadHandlersFromEnv(TEnv *env)
Load plugin handlers specified in config file, like: Plugin.TFile: ^rfio: TRFIOFile RFI...
Int_t LoadPlugin()
Load the plugin library for this handler.
The TEnv class reads config files, by default named .rootrc.
Long_t ExecPluginImpl(const T &...params)
Long_t ExecPlugin(int nargs, const T &...params)
void SetupCallEnv()
Setup ctor or static method call environment.
THashTable implements a hash table to store TObject's.
#define ClassDef(name, id)
const char * GetRegexp() const
UChar_t mod R__LOCKGUARD2(gSrvAuthenticateMutex)
void LoadHandlersFromPluginDirs(const char *base=0)
Load plugin handlers specified via macros in a list of plugin directories.
const char * GetOrigin() const
Bool_t CheckForExecPlugin(Int_t nargs)
Check that we can properly run ExecPlugin.
Method or function calling interface.
R__EXTERN TPluginManager * gPluginMgr
const char * GetPlugin() const
void AddHandler(const char *base, const char *regexp, const char *className, const char *pluginName, const char *ctor=0, const char *origin=0)
Add plugin handler to the list of handlers.
Bool_t fReadingDirs
table of base classes already checked or loaded
This class implements a plugin library manager.
AtomicInt_t fCanCall
ctor method or global function
TPluginManager & operator=(const TPluginManager &pm)
Bool_t fIsMacro
if 1 fCallEnv is ok, -1 fCallEnv is not ok, 0 fCallEnv not setup yet.
void Print(Option_t *opt="") const
Print list of registered plugin handlers.
Mother of all ROOT objects.
const char * GetCtor() const
Global functions class (global functions are obtained from CINT).
Bool_t CanHandle(const char *base, const char *uri)
Check if regular expression appears in the URI, if so return kTRUE.
Int_t WritePluginMacros(const char *dir, const char *plugin=0) const
Write in the specified directory the plugin macros.
Int_t CheckPlugin() const
Check if the plugin library for this handler exits.
const char * GetBase() const
void Execute(const char *, const char *, int *=0)
Execute method on this object with the given parameter string, e.g.
void SetParams(const T &...params)
~TPluginHandler()
Cleanup plugin handler object.
const char * GetClass() const
TFunction * fMethod
ctor method call environment
std::atomic< Int_t > AtomicInt_t
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.