70 #include "RConfigure.h" 71 #include "RConfigOptions.h" 73 #include "RGitCommit.h" 82 #define RTLD_DEFAULT ((void *)::GetModuleHandle(NULL)) 84 #define dlopen(library_name, flags) ::LoadLibrary(library_name) 85 #define dlclose(library) ::FreeLibrary((HMODULE)library) 87 static char Msg[1000];
88 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(),
89 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), Msg,
93 FARPROC dlsym(
void *library,
const char *function_name)
97 FARPROC address = NULL;
99 if (library == RTLD_DEFAULT) {
100 if (EnumProcessModules(::GetCurrentProcess(), hMods,
sizeof(hMods), &cbNeeded)) {
101 for (i = 0; i < (cbNeeded /
sizeof(HMODULE)); i++) {
102 address = ::GetProcAddress((HMODULE)hMods[i], function_name);
109 return ::GetProcAddress((HMODULE)library, function_name);
160 namespace std {}
using namespace std;
163 #if defined(R__HAS_COCOA) 169 #elif defined(R__WIN32) 183 void **(*gThreadTsd)(
void*,
Int_t) = 0;
191 Int_t maj, min, cycle;
193 return 10000*maj + 100*min + cycle;
201 static const char *months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
202 "Jun",
"Jul",
"Aug",
"Sep",
"Oct",
207 sscanf(date,
"%s %d %d", sm, &dd, &yy);
208 for (
int i = 0; i < 12; i++)
209 if (!strncmp(sm, months[i], 3)) {
213 return 10000*yy + 100*mm + dd;
223 sscanf(time,
"%d:%d:%d", &hh, &mm, &ss);
235 if (
gROOT->GetListOfFiles())
236 gROOT->GetListOfFiles()->Delete(
"slow");
237 if (
gROOT->GetListOfSockets())
238 gROOT->GetListOfSockets()->Delete();
239 if (
gROOT->GetListOfMappedFiles())
240 gROOT->GetListOfMappedFiles()->Delete(
"slow");
241 if (
gROOT->GetListOfClosedObjects())
242 gROOT->GetListOfClosedObjects()->Delete(
"slow");
253 struct ModuleHeaderInfo_t {
254 ModuleHeaderInfo_t(
const char* moduleName,
255 const char** headers,
256 const char** includePaths,
257 const char* payloadCode,
258 const char* fwdDeclCode,
259 void (*triggerFunc)(),
261 const char** classesHeaders):
262 fModuleName(moduleName),
264 fPayloadCode(payloadCode),
265 fFwdDeclCode(fwdDeclCode),
266 fIncludePaths(includePaths),
267 fTriggerFunc(triggerFunc),
268 fClassesHeaders(classesHeaders),
269 fFwdNargsToKeepColl(fwdDeclsArgToSkip){}
271 const char* fModuleName;
272 const char** fHeaders;
273 const char* fPayloadCode;
274 const char* fFwdDeclCode;
275 const char** fIncludePaths;
276 void (*fTriggerFunc)();
277 const char** fClassesHeaders;
282 std::vector<ModuleHeaderInfo_t>& GetModuleHeaderInfoBuffer() {
283 static std::vector<ModuleHeaderInfo_t> moduleHeaderInfoBuffer;
284 return moduleHeaderInfoBuffer;
300 class TROOTAllocator {
332 char fHolder[
sizeof(
TROOT)];
335 new(&(fHolder[0]))
TROOT(
"root",
"The ROOT of EVERYTHING");
377 static TROOTAllocator alloc;
383 if (!initInterpreter) {
384 initInterpreter =
kTRUE;
397 const static bool loadSuccess = dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")? false : 0 <=
gSystem->
Load(
"libImt");
402 Error(
"GetSymInLibImt",
"Cannot get symbol %s.", funcname);
423 ::Warning(
"EnableParBranchProcessing",
"Cannot enable parallel branch processing, please build ROOT with -Dimt=ON");
437 ::Warning(
"DisableParBranchProcessing",
"Cannot disable parallel branch processing, please build ROOT with -Dimt=ON");
472 ::Warning(
"EnableParTreeProcessing",
"Cannot enable parallel tree processing, please build ROOT with -Dimt=ON");
486 ::Warning(
"DisableParTreeProcessing",
"Cannot disable parallel tree processing, please build ROOT with -Dimt=ON");
511 return isImplicitMTEnabled;
522 static TString macroPath;
564 ::Warning(
"EnableImplicitMT",
"Cannot enable implicit multi-threading with %d threads, please build ROOT with -Dimt=ON", numthreads);
578 ::Warning(
"DisableImplicitMT",
"Cannot disable implicit multi-threading, please build ROOT with -Dimt=ON");
621 fLineIsProcessing(0), fVersion(0), fVersionInt(0), fVersionCode(0),
622 fVersionDate(0), fVersionTime(0), fBuiltDate(0), fBuiltTime(0),
623 fTimer(0), fApplication(0), fInterpreter(0), fBatch(
kTRUE), fEditHistograms(
kTRUE),
626 fPrimitive(0),fSelectPad(0),fClasses(0),fTypes(0),fGlobals(0),fGlobalFunctions(0),
627 fClosedObjects(0),fFiles(0),fMappedFiles(0),fSockets(0),fCanvases(0),fStyles(0),fFunctions(0),
628 fTasks(0),fColors(0),fGeometries(0),fBrowsers(0),fSpecials(0),fCleanups(0),
629 fMessageHandlers(0),fStreamerInfo(0),fClassGenerators(0),fSecContexts(0),
630 fProofs(0),fClipboard(0),fDataSets(0),fUUIDs(0),fRootFolder(0),fBrowsables(0),
666 if (
fgRootInit || ROOT::Internal::gROOTLocal) {
673 ROOT::Internal::gROOTLocal =
this;
731 if (!dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")) {
734 #if defined(R__MACOSX) && (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) 735 if (TARGET_OS_IPHONE | TARGET_IPHONE_SIMULATOR) {
736 TEnv plugins(
".plugins-ios");
744 auto setNameLocked = [](
TSeqCollection *
l,
const char *collection_name) {
848 #if defined(R__WIN32) 850 #elif defined(R__HAS_COCOA) 860 while (initfunc && initfunc[i]) {
904 #ifdef R__COMPLETE_MEM_TERMINATION 928 #ifdef R__COMPLETE_MEM_TERMINATION 934 #ifdef R__COMPLETE_MEM_TERMINATION 946 #ifdef R__COMPLETE_MEM_TERMINATION 978 #ifdef R__COMPLETE_MEM_TERMINATION 999 #ifdef R__COMPLETE_MEM_TERMINATION 1027 if (!generator)
return;
1051 while ((obj = (
TObject *) next())) {
1053 if (opt && strlen(opt))
1067 if (cl == 0)
return kFALSE;
1074 static void R__ListSlowClose(
TList *files)
1094 dir->
Close(
"nodelete");
1098 cursor = cursor->
Next();
1104 files->
Clear(
"nodelete");
1107 static void R__ListSlowDeleteContent(
TList *files)
1130 cursor = cursor->
Next();
1142 R__ListSlowClose(static_cast<TList*>(
fFiles));
1152 CallFunc_t *socketCloser =
gInterpreter->CallFunc_Factory();
1173 gInterpreter->CallFunc_Exec(socketCloser, ((
char*)socket)+offset);
1180 CallFunc_t *otherCloser =
gInterpreter->CallFunc_Factory();
1181 gInterpreter->CallFunc_SetFuncProto(otherCloser, socket->IsA()->GetClassInfo(),
"Close",
"", &other_offset);
1183 gInterpreter->CallFunc_Exec(otherCloser, ((
char*)socket)+other_offset);
1194 cursor = cursor->
Next();
1202 cursor = cursor->
Next();
1249 Error(
"FindObject",
"Not yet implemented");
1294 while ((obj=next())) {
1295 temp = obj->
FindObject(name);
if (temp)
return temp;
1298 if (temp)
return temp;
1303 if (!temp && canvas !=
gPad) temp =
gPad->FindObject(name);
1359 if (glast) {where = glast; temp = glast->
FindObject(name);}
1365 if (!temp &&
gPad) {
1370 if (!temp && canvas !=
gPad) {
1371 temp =
gPad->FindObject(name);
1376 if (!temp)
return 0;
1389 if (obj)
return obj;
1404 TObject *obj = d->TDirectory::FindObject(name);
1405 if (obj)
return obj;
1435 Error(
"FindObjectPathName",
"Not yet implemented");
1461 std::string normalized;
1465 if (normalized != name) cl =
TClass::GetClass(normalized.c_str(),load,silent);
1467 if (load && cl==0) {
1500 if (!lcolors)
return 0;
1501 if (color < 0 || color >= lcolors->
GetSize())
return 0;
1503 if (col && col->
GetNumber() == color)
return col;
1504 TIter next(lcolors);
1505 while ((col = (
TColor *) next()))
1506 if (col->
GetNumber() == color)
return col;
1516 return (
TCanvas*)
gROOT->ProcessLine(
"TCanvas::MakeDefCanvas();");
1549 if (name == 0 || name[0] == 0) {
1559 gROOT->ProcessLine(
"TF1::InitStandardFunctions();");
1582 return (
TGlobal *)
gROOT->GetListOfGlobals(load)->FindObject(name);
1590 if (addr == 0 || ((
Long_t)addr) == -1)
return 0;
1642 Fatal(
"GetGlobalFunction",
"fInterpreter not initialized");
1649 if (!decl)
return 0;
1654 Error(
"GetGlobalFunction",
1655 "\nDid not find matching TFunction <%s> with \"%s\".",
1675 Fatal(
"GetGlobalFunctionWithPrototype",
"fInterpreter not initialized");
1681 if (!decl)
return 0;
1686 Error(
"GetGlobalFunctionWithPrototype",
1687 "\nDid not find matching TFunction <%s> with \"%s\".",
1759 Fatal(
"GetListOfGlobals",
"fInterpreter not initialized");
1783 Fatal(
"GetListOfGlobalFunctions",
"fInterpreter not initialized");
1816 Fatal(
"GetListOfTypes",
"fInterpreter not initialized");
1830 if (idleTimeInSec <= 0)
1831 (*fApplication).RemoveIdleTimer();
1833 (*fApplication).SetIdleTimer(idleTimeInSec, command);
1843 const char* libsToLoad =
gInterpreter->GetClassSharedLibs(className);
1848 }
else if (
gROOT->GetListOfClasses()
1849 && (cla = (
TClass*)
gROOT->GetListOfClasses()->FindObject(className))) {
1863 if (fname == 0)
return 0;
1865 TString stem(fname);
1867 Int_t where = stem.Last(
'.');
1868 if (where !=
kNPOS) {
1869 if (stem.EndsWith(
".so") || stem.EndsWith(
".sl") ||
1870 stem.EndsWith(
".dl") || stem.EndsWith(
".a") ||
1881 className.ReplaceAll(
"/",
"::");
1882 className.ReplaceAll(
"\\",
"::");
1883 if (className.Contains(
":::")) {
1914 #if defined(R__UNIX) 1915 #if defined(R__HAS_COCOA) 1920 #elif defined(R__WIN32) 1927 fprintf(stderr,
"Fatal in <TROOT::InitSystem>: can't init operating system layer\n");
1930 fprintf(stderr,
"Fatal in <TROOT::InitSystem>: HOME directory not set\n");
1931 fprintf(stderr,
"Fix this by defining the HOME shell variable\n");
1948 gDebug = atoi(sdeb);
1950 if (gDebug > 0 && isatty(2))
1951 fprintf(stderr,
"Info in <TROOT::InitSystem>: running with gDebug = %d\n", gDebug);
1957 if (msize != -1 || mcnt != -1)
1962 #if defined(R__HAS_COCOA) 1991 if (!dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")
1992 && !dlsym(RTLD_DEFAULT,
"usedToIdentifyStaticRoot")) {
1998 void *LLVMEnablePrettyStackTraceAddr = 0;
2001 LLVMEnablePrettyStackTraceAddr = dlsym(RTLD_DEFAULT,
"LLVMEnablePrettyStackTrace");
2003 if (LLVMEnablePrettyStackTraceAddr) {
2004 Error(
"InitInterpreter()",
"LLVM SYMBOLS ARE EXPOSED TO CLING! " 2005 "This will cause problems; please hide them or dlopen() them " 2006 "after the call to TROOT::InitInterpreter()!");
2010 void *libRIOHandle = dlopen(libRIO, RTLD_NOW|RTLD_GLOBAL);
2012 if (!libRIOHandle) {
2013 TString err = dlerror();
2014 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load library %s\n", err.Data());
2019 gInterpreterLib = dlopen(libcling, RTLD_LAZY|RTLD_LOCAL);
2022 if (!gInterpreterLib) {
2023 TString err = dlerror();
2024 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load library %s\n", err.Data());
2029 gInterpreterLib = RTLD_DEFAULT;
2032 if (!CreateInterpreter) {
2033 TString err = dlerror();
2034 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.Data());
2041 if (!gDestroyInterpreter) {
2042 TString err = dlerror();
2043 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.Data());
2059 for (std::vector<ModuleHeaderInfo_t>::const_iterator
2060 li = GetModuleHeaderInfoBuffer().begin(),
2061 le = GetModuleHeaderInfoBuffer().end(); li != le; ++li) {
2069 li->fFwdNargsToKeepColl,
2070 li->fClassesHeaders,
2073 GetModuleHeaderInfoBuffer().clear();
2120 TString lib = libname;
2121 if (!lib.BeginsWith(
"lib"))
2165 FILE *mayberootfile = fopen(filename,
"rb");
2166 if (mayberootfile) {
2168 if (fgets(header,5,mayberootfile)) {
2169 result = strncmp(header,
"root",4)==0;
2171 fclose(mayberootfile);
2215 if (arguments.Length()) {
2221 Error(
"LoadMacro",
"macro %s not found in path %s", fname.Data(),
GetMacroPath());
2272 if (padUpdate &&
gPad)
2304 TString sline =
line;
2310 return (*fApplication).ProcessLine(sline,
kFALSE, error);
2324 TString sline =
line;
2330 return (*fApplication).ProcessLine(sline,
kTRUE, error);
2341 TString sline =
line;
2363 #ifdef ROOT_GIT_COMMIT 2366 #ifdef ROOT_GIT_BRANCH 2370 TString gitinfo =
"gitinfo.txt";
2373 FILE *fp = fopen(filename,
"r");
2391 TTHREAD_TLS(
Bool_t) fgReadingObject =
false;
2392 return fgReadingObject;
2415 Int_t iday,imonth,iyear, ihour, imin;
2416 static const char *months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
2417 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" };
2421 imonth = (idate/100)%100;
2422 iyear = idate/10000;
2425 fGitDate.Form(
"%s %02d %4d, %02d:%02d:00", months[imonth-1], iday, iyear, ihour, imin);
2463 gROOT->CloseFiles();
2474 const char** headers,
2475 const char** includePaths,
2476 const char* payloadCode,
2477 const char* fwdDeclCode,
2478 void (*triggerFunc)(),
2480 const char** classesHeaders)
2543 triggerFunc, fwdDeclsArgToSkip, classesHeaders);
2545 GetModuleHeaderInfoBuffer()
2546 .push_back(ModuleHeaderInfo_t (modulename, headers, includePaths, payloadCode, fwdDeclCode,
2547 triggerFunc, fwdDeclsArgToSkip,classesHeaders));
2592 if (!strncmp(option,
"a", 1)) {
2623 Error(
"SetCutClassName",
"Invalid class name");
2628 Error(
"SetCutClassName",
"Unknown class:%s",name);
2632 Error(
"SetCutClassName",
"Class:%s does not derive from TCutG",name);
2644 if (!mode[0])
return;
2669 TString style_name = stylename;
2672 if (style) style->
cd();
2673 else Error(
"SetStyle",
"Unknown style:%s",style_name.Data());
2703 if (macroPath.Length() == 0) {
2704 macroPath =
gEnv->
GetValue(
"Root.MacroPath", (
char*)0);
2705 #if defined(R__WIN32) 2706 macroPath.ReplaceAll(
"; ",
";");
2708 macroPath.ReplaceAll(
": ",
":");
2710 if (macroPath.Length() == 0)
2711 #
if !defined(R__WIN32)
2729 if (!newpath || !*newpath)
2732 macroPath = newpath;
2748 for (
int i = 0; i <
fgDirLevel; i++) std::cout.put(
' ');
2780 return 10000*(code>>16) + 100*((code&65280)>>8) + (code&255);
2789 int b = (v - a*10000)/100;
2790 int c = v - a*10000 - b*100;
2791 return (a << 16) + (b << 8) + c;
2805 static const char** extraInterpArgs = 0;
2806 return extraInterpArgs;
2812 static Bool_t IgnorePrefix() {
2814 return ignorePrefix;
2823 if (IgnorePrefix()) {
2825 static TString rootsys;
2826 if (rootsys.IsNull())
2828 if (rootsys.IsNull())
2833 const static TString rootsys = ROOTPREFIX;
2844 if (IgnorePrefix()) {
2846 static TString rootbindir;
2847 if (rootbindir.IsNull()) {
2854 const static TString rootbindir = ROOTBINDIR;
2865 if (IgnorePrefix()) {
2867 static TString rootlibdir;
2868 if (rootlibdir.IsNull()) {
2875 const static TString rootlibdir = ROOTLIBDIR;
2886 if (IgnorePrefix()) {
2888 static TString rootincdir;
2889 if (rootincdir.IsNull()) {
2890 rootincdir =
"include";
2896 const static TString rootincdir = ROOTINCDIR;
2907 if (IgnorePrefix()) {
2909 static TString rootetcdir;
2910 if (rootetcdir.IsNull()) {
2917 const static TString rootetcdir = ROOTETCDIR;
2928 if (IgnorePrefix()) {
2933 const static TString rootdatadir = ROOTDATADIR;
2944 if (IgnorePrefix()) {
2949 const static TString rootdocdir = ROOTDOCDIR;
2960 if (IgnorePrefix()) {
2962 static TString rootmacrodir;
2963 if (rootmacrodir.IsNull()) {
2964 rootmacrodir =
"macros";
2967 return rootmacrodir;
2970 const static TString rootmacrodir = ROOTMACRODIR;
2971 return rootmacrodir;
2981 if (IgnorePrefix()) {
2983 static TString roottutdir;
2984 if (roottutdir.IsNull()) {
2985 roottutdir =
"tutorials";
2991 const static TString roottutdir = ROOTTUTDIR;
3002 if (IgnorePrefix()) {
3004 static TString rootsrcdir;
3005 if (rootsrcdir.IsNull()) {
3012 const static TString rootsrcdir = ROOTSRCDIR;
3023 if (IgnorePrefix()) {
3025 static TString rooticonpath;
3026 if (rooticonpath.IsNull()) {
3027 rooticonpath =
"icons";
3030 return rooticonpath;
3033 const static TString rooticonpath = ROOTICONPATH;
3034 return rooticonpath;
3044 if (IgnorePrefix()) {
3046 static TString ttffontdir;
3047 if (ttffontdir.IsNull()) {
3048 ttffontdir =
"fonts";
3054 const static TString ttffontdir = TTFFONTDIR;
TSeqCollection * fStreamerInfo
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
const char * FindObjectPathName(const TObject *obj) const
Return path name of obj somewhere in the //root/...
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
void AddClass(TClass *cl)
Add a class to the list and map of classes.
virtual void RegisterModule(const char *, const char **, const char **, const char *, const char *, void(*)(), const FwdDeclArgsToKeepCollection_t &fwdDeclArgsToKeep, const char **classesHeaders, Bool_t lateRegistration=false)=0
virtual void Add(TObject *obj)
TListOfFunctionTemplates * fFuncTemplate
UInt_t GetImplicitMTPoolSize()
Returns the size of the pool used for implicit multi-threading.
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
TInterpreter * CreateInterpreter_t(void *shlibHandle)
A TFolder object is a collection of objects and folders.
TCanvas * MakeDefCanvas() const
Return a default canvas.
R__EXTERN TGuiFactory * gBatchGuiFactory
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
Semi-Abstract base class defining a generic interface to the underlying, low level, native graphics backend (X11, Win32, MacOS, OpenGL...).
virtual void Clear(Option_t *option="")=0
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
static Bool_t BlockAllSignals(Bool_t b)
Block or unblock all signals. Returns the previous block status.
virtual void Delete(Option_t *option="")
Remove all objects from the list AND delete all heap based objects.
TCollection * GetListOfEnums(Bool_t load=kFALSE)
ROOT top level object description.
static const TString & GetMacroDir()
Get the macro directory in the installation. Static utility function.
void * DestroyInterpreter_t(TInterpreter *)
This class is a specialized TProcessID managing the list of UUIDs.
static const TString & GetTutorialDir()
Get the tutorials directory in the installation. Static utility function.
const char * GetDeclFileName() const
void RemoveClass(TClass *)
Remove a class from the list and map of classes.
TCollection * GetListOfGlobalFunctions(Bool_t load=kFALSE)
Return list containing the TFunctions currently defined.
virtual const char * WorkingDirectory()
Return working directory.
Int_t LoadMacro(const char *filename, Int_t *error=0, Bool_t check=kFALSE)
Load a macro in the interpreter's memory.
virtual void Build(TFile *motherFile=0, TDirectory *motherDir=0)
Initialise directory to defaults.
Namespace for new ROOT classes and functions.
static const char **& GetExtraInterpreterArgs()
TSeqCollection * fGeometries
R__EXTERN TClassTable * gClassTable
Handle messages that might be generated by the system.
TDictionary::DeclId_t DeclId_t
Dictionary for function template This class describes one single function template.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form: ~~~ {.cpp} [path/]macro.C[+|++[k|f|g|O|c|s|d|v|-]][(args)]...
void DisableImplicitMT()
Disables the implicit multi-threading in ROOT (see EnableImplicitMT).
static TVirtualX *& Instance()
Returns gVirtualX global.
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
Short_t GetDeclFileLine() const
#define ROOT_RELEASE_TIME
static const TString & GetIconPath()
Get the icon path in the installation. Static utility function.
R__EXTERN TVirtualMutex * gInterpreterMutex
This class represents a WWW compatible URL.
R__EXTERN TStyle * gStyle
int GetPathInfo(const char *path, Long_t *id, Long_t *size, Long_t *flags, Long_t *modtime)
Get info about a file: id, size, flags, modification time.
virtual void HandleMessage(Int_t id, const TObject *obj)
Store message origin, keep statistics and call Notify().
Bool_t ReadingObject() const
Deprecated (will be removed in next release).
virtual void SetName(const char *name)
Set the name of the TNamed.
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
static Bool_t MemCheck()
Return kTRUE if the memory leak checker is on.
virtual const char * HomeDirectory(const char *userName=0)
Return the user's home directory.
#define ROOT_RELEASE_DATE
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
static void SetObjectStat(Bool_t stat)
Turn on/off tracking of objects in the TObjectTable.
This class implements a mutex interface.
void DisableParTreeProcessing()
Globally disables the IMT use case of parallel branch processing, deactivating the corresponding lock...
void InitInterpreter()
Initialize the interpreter.
void LoadHandlersFromEnv(TEnv *env)
Load plugin handlers specified in config file, like: Plugin.TFile: ^rfio: TRFIOFile RFI...
R__ALWAYS_INLINE Bool_t TestBit(UInt_t f) const
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
The TEnv class reads config files, by default named .rootrc.
void RefreshBrowsers()
Refresh all browsers.
static Func_t GetSymInLibImt(const char *funcname)
std::vector< std::pair< std::string, int > > FwdDeclArgsToKeepCollection_t
static const TString & GetRootSys()
Get the rootsys directory in the installation. Static utility function.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
Option_t * GetOption() const
void Reset(Option_t *option="")
Delete all global interpreter objects created since the last call to Reset.
void Load()
Load all the DataMembers known to the interpreter for the scope 'fClass' into this collection...
TFunction * Get(DeclId_t id)
Return (after creating it if necessary) the TMethod or TFunction describing the function correspondin...
This class registers for all classes their name, id and dictionary function in a hash table...
#define ROOT_VERSION_CODE
static constexpr double mm
static Bool_t & IsImplicitMTEnabledImpl()
Keeps track of the status of ImplicitMT w/o resorting to the load of libImt.
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at this folder.
TObject * At(Int_t idx) const
virtual void ResetSignals()
Reset signals handlers to previous behaviour.
std::atomic< TApplication * > fApplication
void SetStyle(const char *stylename="Default")
Change current style to style with name stylename.
TDataType * GetType(const char *name, Bool_t load=kFALSE) const
Return pointer to type with name.
TCollection * GetListOfGlobals(Bool_t load=kFALSE)
Return list containing the TGlobals currently defined.
TStyle * GetStyle(const char *name) const
Return pointer to style with name.
void ls(Option_t *option="") const
To list all objects of the application.
static const TString & GetIncludeDir()
Get the include directory in the installation. Static utility function.
TObject * Remove(TObject *)
Remove an object from the in-memory list.
Bool_t R_ISREG(Int_t mode)
virtual void AddLast(TObject *obj)
Add object at the end of the list.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
Bool_t & GetReadingObject()
static const char * GetTutorialsDir()
Get the tutorials directory in the installation.
TListOfFunctions * GetGlobalFunctions()
Internal routine returning, and creating if necessary, the list of global function.
static const char * GetMacroPath()
Get macro search path. Static utility function.
TInterpreter * fInterpreter
static TList & GetEarlyRegisteredGlobals()
const char * GetGitDate()
Return date/time make was run.
virtual void cd()
Change current style.
TObject * GetFunction(const char *name) const
Return pointer to function with name.
TSeqCollection * fMappedFiles
virtual void Delete(Option_t *option="")=0
Delete this object.
Sequenceable collection abstract base class.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
static void * gInterpreterLib
TVirtualMutex * gROOTMutex
THashTable implements a hash table to store TObject's.
static TVirtualPad *& Pad()
Return the current pad for the current thread.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
Bool_t IsParTreeProcessingEnabled()
Returns true if parallel tree processing is enabled.
void SetEditorMode(const char *mode="")
Set editor mode.
static Int_t ReadRules()
Read the class.rules files from the default location:.
TSeqCollection * fCleanups
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
void EndOfProcessCleanups()
Execute the cleanups necessary at the end of the process, in particular those that must be executed b...
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at //root.
Long_t ProcessLineSync(const char *line, Int_t *error=0)
Process interpreter command via TApplication::ProcessLine().
void Message(Int_t id, const TObject *obj)
Process message id called by obj.
void EnableParTreeProcessing()
Globally enables the parallel tree processing, which is a case of implicit multi-threading in ROOT...
virtual const char * Getenv(const char *env)
Get environment variable.
static const TString & GetDocDir()
Get the documentation directory in the installation. Static utility function.
TCollection * GetListOfFunctionTemplates()
virtual const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
static Int_t ITIMQQ(const char *time)
Return built time as integer (with min precision), i.e.
virtual void EnableAutoLoading()=0
void SaveContext()
Save the current interpreter context.
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
ClassInfo_t * GetClassInfo() const
virtual void Delete(Option_t *option="")
Delete all TFunction object files.
R__EXTERN TVirtualRWMutex * gCoreMutex
virtual bool UseRWLock()
Set this collection to use a RW lock upon access, making it thread safe.
virtual TList * GetList() const
TCollection * GetListOfFunctionOverloads(const char *name) const
Return the collection of functions named "name".
static void at_exit_of_TROOT()
TSeqCollection * fClipboard
virtual void Initialize()=0
TFolder * AddFolder(const char *name, const char *title, TCollection *collection=0)
Create a new folder and add it to the list of folders of this folder, return a pointer to the created...
TVirtualPad is an abstract base class for the Pad and Canvas classes.
R__EXTERN TGuiFactory * gGuiFactory
static void Cleanup()
static function (called by TROOT destructor) to delete all TProcessIDs
void Error(const char *location, const char *msgfmt,...)
R__EXTERN TPluginManager * gPluginMgr
object has not been deleted
TSeqCollection * GetListOfGeometries() const
Describes an Operating System directory for the browser.
virtual TObject * FindObject(const char *name) const
Specialize FindObject to do search for the a function just by name or create it if its not already in...
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
Long_t Macro(const char *filename, Int_t *error=0, Bool_t padUpdate=kTRUE)
Execute a macro in the interpreter.
R__EXTERN TVirtualMutex * gGlobalMutex
TStyle objects may be created to define special styles.
R__EXTERN TROOT * gROOTLocal
#define R__READ_LOCKGUARD(mutex)
Using a TBrowser one can browse all ROOT objects.
virtual void AddLast(TObject *obj)=0
Bool_t ClassSaved(TClass *cl)
return class status bit kClassSaved for class cl This function is called by the SavePrimitive functio...
virtual void RecursiveRemove(TObject *obj)
Remove object from this collection and recursively remove the object from all other objects (and coll...
static void RegisterModule(const char *modulename, const char **headers, const char **includePaths, const char *payLoadCode, const char *fwdDeclCode, void(*triggerFunc)(), const FwdDeclArgsToKeepCollection_t &fwdDeclsArgToSkip, const char **classesHeaders)
Called by static dictionary initialization to register clang modules for headers. ...
R__EXTERN TVirtualX * gGXBatch
TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE) const
Return pointer to class with name. Obsolete, use TClass::GetClass directly.
Bool_t IsParBranchProcessingEnabled()
Returns true if parallel branch processing is enabled.
TSeqCollection * fDataSets
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
TSeqCollection * fMessageHandlers
void Browse(TBrowser *b)
Add browsable objects to TBrowser.
virtual Bool_t Init()
Initialize the OS interface.
void AddClassGenerator(TClassGenerator *gen)
Add a class generator.
R__EXTERN TSystem * gSystem
void SetCutClassName(const char *name="TCutG")
Set the default graphical cut class name for the graphics editor By default the graphics editor creat...
TGlobal * GetGlobal(const char *name, Bool_t load=kFALSE) const
Return pointer to global variable by name.
if object ctor succeeded but object should not be used
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.
Basic data type descriptor (datatype information is obtained from CINT).
TPluginManager * fPluginManager
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
TSeqCollection * fSecContexts
Collection abstract base class.
void SetRefreshFlag(Bool_t flag)
static Int_t ConvertVersionCode2Int(Int_t code)
Convert version code to an integer, i.e. 331527 -> 51507.
void ReadGitInfo()
Read Git commit information and branch name from the etc/gitinfo.txt file.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual TObject * FindObject(const char *name) const
Returns address of a ROOT object if it exists.
TObject * GetGeometry(const char *name) const
Return pointer to Geometry with name.
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
static void EnableStatistics(int size=-1, int ix=-1)
Enable memory usage statistics gathering.
This class implements a plugin library manager.
static const TString & GetSourceDir()
Get the source directory in the installation. Static utility function.
Int_t LoadClass(const char *classname, const char *libname, Bool_t check=kFALSE)
Check if class "classname" is known to the interpreter (in fact, this check is not needed anymore...
Objects following this interface can be passed onto the TROOT object to implement a user customized w...
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static TProcessID * AddProcessID()
Static function to add a new TProcessID to the list of PIDs.
The ROOT global object gROOT contains a list of all defined classes.
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
virtual void SaveContext()=0
Global variables class (global variables are obtained from CINT).
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
A collection of TDataType designed to hold the typedef information and numerical type information...
void SetName(const char *name)
void Warning(const char *location, const char *msgfmt,...)
Bool_t IsRootFile(const char *filename) const
Return true if the file is local and is (likely) to be a ROOT file.
static TInterpreter * Instance()
returns gInterpreter global
void InitSystem()
Initialize operating system interface.
if object destructor must call RecursiveRemove()
TSeqCollection * fSpecials
virtual TObjLink * FirstLink() const
static void CreateApplication()
Static function used to create a default application environment.
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
static void SetDirLevel(Int_t level=0)
Return Indentation level for ls().
Bool_t IsExecutingMacro() const
TSeqCollection * GetListOfColors() const
TListOfFunctions * fGlobalFunctions
Long_t ProcessLine(const char *line, Int_t *error=0)
Process interpreter command via TApplication::ProcessLine().
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
TSeqCollection * fCanvases
static void BuildStyles()
Create some standard styles.
virtual void SetName(const char *newname)
Set the name for directory If the directory name is changed after the directory was written once...
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
virtual const char * GetTypeName() const
Get type of global variable, e,g.
void EnableThreadSafety()
Enables the global mutex to make ROOT thread safe/aware.
TFunction * GetGlobalFunctionWithPrototype(const char *name, const char *proto=0, Bool_t load=kFALSE)
Return pointer to global function by name.
static DestroyInterpreter_t * gDestroyInterpreter
void SetReadingObject(Bool_t flag=kTRUE)
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
void InitThreads()
Load and initialize thread library.
void RecursiveRemove(TObject *obj)
Recursively remove this object from the list of Cleanups.
void Unload()
Mark 'all func' as being unloaded.
Describe directory structure in memory.
static TDirectory *& CurrentDirectory()
Return the current directory for the current thread.
Wrapper around a TObject so it can be stored in a TList.
TSeqCollection * GetListOfStyles() const
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
TSeqCollection * GetListOfFiles() const
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
static RooMathCoreReg dummy
static void CallCloseFiles()
Insure that the files, canvases and sockets are closed.
void EnableParBranchProcessing()
Globally enables the parallel branch processing, which is a case of implicit multi-threading (IMT) in...
Long_t ProcessLineFast(const char *line, Int_t *error=0)
Process interpreter command directly via CINT interpreter.
void CloseFiles()
Close any files and sockets that gROOT knows about.
static constexpr double s
virtual ~TROOT()
Clean up and free resources used by ROOT (files, network sockets, shared memory segments, etc.).
#define R__LOCKGUARD(mutex)
The color creation and management class.
virtual void Add(TObject *obj)=0
virtual void CleanCompiledMacros()
Remove the shared libs produced by the CompileMacro() function.
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void Clear(Option_t *option="")
Remove all objects from the list.
TCollection * fClassGenerators
Int_t IgnoreInclude(const char *fname, const char *expandedfname)
Return 1 if the name of the given include file corresponds to a class that is known to ROOT...
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
virtual void Delete(Option_t *option="")
Delete all TDataMember object files.
static Int_t GetDirLevel()
return directory level
Mother of all ROOT objects.
Global functions class (global functions are obtained from CINT).
This ABC is a factory for GUI components.
TFunction * GetGlobalFunction(const char *name, const char *params=0, Bool_t load=kFALSE)
Return pointer to global function by name.
std::vector< std::pair< std::string, int > > FwdDeclArgsToKeepCollection_t
static Int_t ConvertVersionInt2Code(Int_t v)
Convert version as an integer to version code as used in RVersion.h.
TObject * GetObject() const
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
typedef void((*Func_t)())
TCollection * GetListOfTypes(Bool_t load=kFALSE)
Return a dynamic list giving access to all TDataTypes (typedefs) currently defined.
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
void Unload()
Mark 'all func' as being unloaded.
TFunctionTemplate * GetFunctionTemplate(const char *name)
TColor * GetColor(Int_t color) const
Return address of color with index color.
void Load()
Load all the functions known to the interpreter for the scope 'fClass' into this collection.
const char * FindObjectClassName(const char *name) const
Returns class name of a ROOT object including CINT globals.
static void SetMacroPath(const char *newpath)
Set or extend the macro search path.
TROOT *(* GetROOTFun_t)()
static Int_t IDATQQ(const char *date)
Return built date as integer, i.e. "Apr 28 2000" -> 20000428.
virtual void Add(TObject *obj)
TListOfDataMembers * fGlobals
static const TString & GetLibDir()
Get the library directory in the installation. Static utility function.
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
R__EXTERN const char * gRootDir
virtual void ls(Option_t *option="") const
List Directory contents.
TSeqCollection * fClosedObjects
TClass * FindSTLClass(const char *name, Bool_t load, Bool_t silent=kFALSE) const
return a TClass object corresponding to 'name' assuming it is an STL container.
static Int_t IVERSQ()
Return version id as an integer, i.e. "2.22/04" -> 22204.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
static void CleanUpROOTAtExit()
Clean up at program termination before global objects go out of scope.
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
TSeqCollection * fBrowsers
static GetROOTFun_t gGetROOT
static void InitializeColors()
Initialize colors used by the TCanvas based graphics (via TColor objects).
virtual TObject * FindObjectAnyFile(const char *name) const
Scan the memory lists of all files for an object with name.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
TSeqCollection * fSockets
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TObject * FindSpecialObject(const char *name, void *&where)
Returns address and folder of a ROOT object if it exists.
R__EXTERN TInterpreter * gCling
virtual const char * GetName() const
Returns name of object.
virtual Int_t GetSize() const
Abstract base class defining a generic interface to the underlying Operating System.
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
void Idle(UInt_t idleTimeInSec, const char *command=0)
Execute command when system has been idle for idleTimeInSec seconds.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
TSeqCollection * GetListOfBrowsers() const
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
#define sym(otri1, otri2)
static TClass * R__GetClassIfKnown(const char *className)
Check whether className is a known class, and only autoload if we can.
void DisableParBranchProcessing()
Globally disables the IMT use case of parallel branch processing, deactivating the corresponding lock...
static void PrintStatistics()
Print memory usage statistics.
const TObject * fPrimitive
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
void SetObject(TObject *obj)
virtual TObject * First() const =0
virtual TObject * Last() const =0
TDictionary * Get(DeclId_t id)
Return (after creating it if necessary) the TDataMember describing the data member corresponding to t...
static constexpr double g