68 #include "RConfigure.h" 69 #include "RConfigOptions.h" 71 #include "RGitCommit.h" 80 #define RTLD_DEFAULT ((void *)::GetModuleHandle(NULL)) 81 #define dlsym(library, function_name) ::GetProcAddress((HMODULE)library, function_name) 82 #define dlopen(library_name, flags) ::LoadLibrary(library_name) 83 #define dlclose(library) ::FreeLibrary((HMODULE)library) 85 static char Msg[1000];
86 FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM,
NULL, GetLastError(),
87 MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), Msg,
138 namespace std {}
using namespace std;
141 #if defined(R__HAS_COCOA) 147 #elif defined(R__WIN32) 154 static void *gInterpreterLib = 0;
160 void **(*gThreadTsd)(
void*,
Int_t) = 0;
170 return 10000*maj + 100*min + cycle;
178 static const char *months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
179 "Jun",
"Jul",
"Aug",
"Sep",
"Oct",
184 sscanf(date,
"%s %d %d", sm, &dd, &yy);
185 for (
int i = 0; i < 12; i++)
186 if (!strncmp(sm, months[i], 3)) {
190 return 10000*yy + 100*mm + dd;
200 sscanf(time,
"%d:%d:%d", &hh, &mm, &ss);
212 if (
gROOT->GetListOfFiles())
213 gROOT->GetListOfFiles()->Delete(
"slow");
214 if (
gROOT->GetListOfSockets())
215 gROOT->GetListOfSockets()->Delete();
216 if (
gROOT->GetListOfMappedFiles())
217 gROOT->GetListOfMappedFiles()->Delete(
"slow");
218 if (
gROOT->GetListOfClosedObjects())
219 gROOT->GetListOfClosedObjects()->Delete(
"slow");
230 struct ModuleHeaderInfo_t {
231 ModuleHeaderInfo_t(
const char* moduleName,
232 const char** headers,
233 const char** includePaths,
234 const char* payloadCode,
235 const char* fwdDeclCode,
236 void (*triggerFunc)(),
238 const char** classesHeaders):
239 fModuleName(moduleName),
241 fPayloadCode(payloadCode),
242 fFwdDeclCode(fwdDeclCode),
243 fIncludePaths(includePaths),
244 fTriggerFunc(triggerFunc),
245 fClassesHeaders(classesHeaders),
246 fFwdNargsToKeepColl(fwdDeclsArgToSkip){}
248 const char* fModuleName;
249 const char** fHeaders;
250 const char* fPayloadCode;
251 const char* fFwdDeclCode;
252 const char** fIncludePaths;
253 void (*fTriggerFunc)();
254 const char** fClassesHeaders;
259 std::vector<ModuleHeaderInfo_t>& GetModuleHeaderInfoBuffer() {
260 static std::vector<ModuleHeaderInfo_t> moduleHeaderInfoBuffer;
261 return moduleHeaderInfoBuffer;
265 Int_t TROOT::fgDirLevel = 0;
270 if (ROOT::Internal::gROOTLocal)
271 ROOT::Internal::gROOTLocal->
~TROOT();
277 class TROOTAllocator {
309 char fHolder[
sizeof(
TROOT)];
312 new(&(fHolder[0]))
TROOT(
"root",
"The ROOT of EVERYTHING");
354 static TROOTAllocator alloc;
360 if (!initInterpreter) {
361 initInterpreter =
kTRUE;
388 static void (*tthreadInitialize)() =
nullptr;
390 if (!tthreadInitialize) {
391 const static auto loadSuccess = -1 !=
gSystem->
Load(
"libThread");
393 if (
auto sym = dlsym(RTLD_DEFAULT,
"ROOT_TThread_Initialize")) {
394 tthreadInitialize = (
void(*)())
sym;
397 Error(
"EnableThreadSafety",
"Cannot initialize multithreading support.");
400 Error(
"EnableThreadSafety",
"Cannot load Thread library.");
422 fLineIsProcessing(0), fVersion(0), fVersionInt(0), fVersionCode(0),
423 fVersionDate(0), fVersionTime(0), fBuiltDate(0), fBuiltTime(0),
424 fTimer(0), fApplication(0), fInterpreter(0), fBatch(
kTRUE), fEditHistograms(kTRUE),
425 fFromPopUp(kTRUE),fMustClean(kTRUE),fReadingObject(
kFALSE),fForceStyle(kFALSE),
426 fInterrupt(kFALSE),fEscape(kFALSE),fExecutingMacro(kFALSE),fEditorMode(0),
427 fPrimitive(0),fSelectPad(0),fClasses(0),fTypes(0),fGlobals(0),fGlobalFunctions(0),
428 fClosedObjects(0),fFiles(0),fMappedFiles(0),fSockets(0),fCanvases(0),fStyles(0),fFunctions(0),
429 fTasks(0),fColors(0),fGeometries(0),fBrowsers(0),fSpecials(0),fCleanups(0),
430 fMessageHandlers(0),fStreamerInfo(0),fClassGenerators(0),fSecContexts(0),
431 fProofs(0),fClipboard(0),fDataSets(0),fUUIDs(0),fRootFolder(0),fBrowsables(0),
455 :
TDirectory(), fLineIsProcessing(0), fVersion(0), fVersionInt(0), fVersionCode(0),
456 fVersionDate(0), fVersionTime(0), fBuiltDate(0), fBuiltTime(0),
457 fTimer(0), fApplication(0), fInterpreter(0), fBatch(
kTRUE), fEditHistograms(
kTRUE),
460 fPrimitive(0),fSelectPad(0),fClasses(0),fTypes(0),fGlobals(0),fGlobalFunctions(0),
461 fClosedObjects(0),fFiles(0),fMappedFiles(0),fSockets(0),fCanvases(0),fStyles(0),fFunctions(0),
462 fTasks(0),fColors(0),fGeometries(0),fBrowsers(0),fSpecials(0),fCleanups(0),
463 fMessageHandlers(0),fStreamerInfo(0),fClassGenerators(0),fSecContexts(0),
464 fProofs(0),fClipboard(0),fDataSets(0),fUUIDs(0),fRootFolder(0),fBrowsables(0),
467 if (
fgRootInit || ROOT::Internal::gROOTLocal) {
474 ROOT::Internal::gROOTLocal =
this;
535 if (!dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")) {
538 #if defined(R__MACOSX) && (TARGET_OS_IPHONE || TARGET_IPHONE_SIMULATOR) 539 if (TARGET_OS_IPHONE | TARGET_IPHONE_SIMULATOR) {
540 TEnv plugins(
".plugins-ios");
644 #if defined(R__WIN32) 646 #elif defined(R__HAS_COCOA) 656 while (initfunc && initfunc[i]) {
700 #ifdef R__COMPLETE_MEM_TERMINATION 720 #ifdef R__COMPLETE_MEM_TERMINATION 726 #ifdef R__COMPLETE_MEM_TERMINATION 738 #ifdef R__COMPLETE_MEM_TERMINATION 768 #ifdef R__COMPLETE_MEM_TERMINATION 786 #ifdef R__COMPLETE_MEM_TERMINATION 814 if (!generator)
return;
826 while ((obj = (
TObject *) next())) {
828 if (opt && strlen(opt))
842 if (cl == 0)
return kFALSE;
849 static void R__ListSlowClose(
TList *files)
872 cursor = cursor->
Next();
878 files->
Clear(
"nodelete");
889 R__ListSlowClose(static_cast<TList*>(
fFiles));
899 CallFunc_t *socketCloser =
gInterpreter->CallFunc_Factory();
920 gInterpreter->CallFunc_Exec(socketCloser, ((
char*)socket)+offset);
927 CallFunc_t *otherCloser =
gInterpreter->CallFunc_Factory();
928 gInterpreter->CallFunc_SetFuncProto(otherCloser, socket->IsA()->GetClassInfo(),
"Close",
"", &other_offset);
930 gInterpreter->CallFunc_Exec(otherCloser, ((
char*)socket)+other_offset);
941 cursor = cursor->
Next();
949 cursor = cursor->
Next();
988 Error(
"FindObject",
"Not yet implemented");
1030 while ((obj=next())) {
1031 temp = obj->
FindObject(name);
if (temp)
return temp;
1038 if (!temp && canvas !=
gPad) temp =
gPad->FindObject(name);
1094 if (glast) {where = glast; temp = glast->
FindObject(name);}
1100 if (!temp &&
gPad) {
1105 if (!temp && canvas !=
gPad) {
1106 temp =
gPad->FindObject(name);
1111 if (!temp)
return 0;
1124 if (obj)
return obj;
1139 TObject *obj = d->TDirectory::FindObject(name);
1140 if (obj)
return obj;
1170 Error(
"FindObjectPathName",
"Not yet implemented");
1196 std::string normalized;
1200 if (normalized != name) cl =
TClass::GetClass(normalized.c_str(),load,silent);
1202 if (load && cl==0) {
1235 if (!lcolors)
return 0;
1236 if (color < 0 || color >= lcolors->
GetSize())
return 0;
1238 if (col && col->
GetNumber() == color)
return col;
1239 TIter next(lcolors);
1240 while ((col = (
TColor *) next()))
1241 if (col->
GetNumber() == color)
return col;
1251 return (
TCanvas*)
gROOT->ProcessLine(
"TCanvas::MakeDefCanvas();");
1284 if (name == 0 || name[0] == 0) {
1294 gROOT->ProcessLine(
"TF1::InitStandardFunctions();");
1317 return (
TGlobal *)
gROOT->GetListOfGlobals(load)->FindObject(name);
1325 if (addr == 0 || ((
Long_t)addr) == -1)
return 0;
1377 Fatal(
"GetGlobalFunction",
"fInterpreter not initialized");
1384 if (!decl)
return 0;
1389 Error(
"GetGlobalFunction",
1390 "\nDid not find matching TFunction <%s> with \"%s\".",
1403 const char *proto,
Bool_t load)
1410 Fatal(
"GetGlobalFunctionWithPrototype",
"fInterpreter not initialized");
1416 if (!decl)
return 0;
1421 Error(
"GetGlobalFunctionWithPrototype",
1422 "\nDid not find matching TFunction <%s> with \"%s\".",
1492 Fatal(
"GetListOfGlobals",
"fInterpreter not initialized");
1516 Fatal(
"GetListOfGlobalFunctions",
"fInterpreter not initialized");
1549 Fatal(
"GetListOfTypes",
"fInterpreter not initialized");
1563 if (idleTimeInSec <= 0)
1564 (*fApplication).RemoveIdleTimer();
1566 (*fApplication).SetIdleTimer(idleTimeInSec, command);
1576 const char* libsToLoad =
gInterpreter->GetClassSharedLibs(className);
1581 }
else if (
gROOT->GetListOfClasses()
1582 && (cla = (
TClass*)
gROOT->GetListOfClasses()->FindObject(className))) {
1596 if (fname == 0)
return 0;
1601 if (where !=
kNPOS) {
1647 #if defined(R__UNIX) 1648 #if defined(R__HAS_COCOA) 1653 #elif defined(R__WIN32) 1660 fprintf(stderr,
"Fatal in <TROOT::InitSystem>: can't init operating system layer\n");
1663 fprintf(stderr,
"Fatal in <TROOT::InitSystem>: HOME directory not set\n");
1664 fprintf(stderr,
"Fix this by defining the HOME shell variable\n");
1681 gDebug = atoi(sdeb);
1683 if (gDebug > 0 && isatty(2))
1684 fprintf(stderr,
"Info in <TROOT::InitSystem>: running with gDebug = %d\n", gDebug);
1690 if (msize != -1 || mcnt != -1)
1695 #if defined(R__HAS_COCOA) 1724 if (!dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")
1725 && !dlsym(RTLD_DEFAULT,
"usedToIdentifyStaticRoot")) {
1731 void *LLVMEnablePrettyStackTraceAddr = 0;
1734 LLVMEnablePrettyStackTraceAddr = dlsym(RTLD_DEFAULT,
"LLVMEnablePrettyStackTrace");
1735 if (LLVMEnablePrettyStackTraceAddr) {
1736 Error(
"InitInterpreter()",
"LLVM SYMBOLS ARE EXPOSED TO CLING! " 1737 "This will cause problems; please hide them or dlopen() them " 1738 "after the call to TROOT::InitInterpreter()!");
1742 gInterpreterLib = dlopen(libcling, RTLD_LAZY|RTLD_LOCAL);
1745 if (!gInterpreterLib) {
1747 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load library %s\n", err.
Data());
1752 gInterpreterLib = RTLD_DEFAULT;
1755 if (!CreateInterpreter) {
1757 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.
Data());
1764 if (!gDestroyInterpreter) {
1766 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.
Data());
1778 for (std::vector<ModuleHeaderInfo_t>::const_iterator
1779 li = GetModuleHeaderInfoBuffer().begin(),
1780 le = GetModuleHeaderInfoBuffer().end(); li != le; ++li) {
1788 li->fFwdNargsToKeepColl,
1789 li->fClassesHeaders);
1791 GetModuleHeaderInfoBuffer().clear();
1883 FILE *mayberootfile = fopen(filename,
"rb");
1884 if (mayberootfile) {
1886 if (fgets(header,5,mayberootfile)) {
1887 result = strncmp(header,
"root",4)==0;
1889 fclose(mayberootfile);
1933 if (arguments.
Length()) {
1990 if (padUpdate &&
gPad)
2028 return (*fApplication).ProcessLine(sline,
kFALSE, error);
2048 return (*fApplication).ProcessLine(sline,
kTRUE, error);
2081 #ifdef ROOT_GIT_COMMIT 2084 #ifdef ROOT_GIT_BRANCH 2088 TString gitinfo =
"gitinfo.txt";
2091 FILE *fp = fopen(filename,
"r");
2109 TTHREAD_TLS(
Bool_t) fgReadingObject =
false;
2110 return fgReadingObject;
2133 Int_t iday,imonth,iyear, ihour, imin;
2134 static const char *months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
2135 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" };
2139 imonth = (idate/100)%100;
2140 iyear = idate/10000;
2143 fGitDate.
Form(
"%s %02d %4d, %02d:%02d:00", months[imonth-1], iday, iyear, ihour, imin);
2168 gROOT->CloseFiles();
2179 const char** headers,
2180 const char** includePaths,
2181 const char* payloadCode,
2182 const char* fwdDeclCode,
2183 void (*triggerFunc)(),
2185 const char** classesHeaders)
2248 triggerFunc, fwdDeclsArgToSkip, classesHeaders);
2250 GetModuleHeaderInfoBuffer()
2251 .push_back(ModuleHeaderInfo_t (modulename, headers, includePaths, payloadCode, fwdDeclCode,
2252 triggerFunc, fwdDeclsArgToSkip,classesHeaders));
2287 if (!strncmp(option,
"a", 1)) {
2318 Error(
"SetCutClassName",
"Invalid class name");
2323 Error(
"SetCutClassName",
"Unknown class:%s",name);
2327 Error(
"SetCutClassName",
"Class:%s does not derive from TCutG",name);
2339 if (!mode[0])
return;
2364 TString style_name = stylename;
2367 if (style) style->
cd();
2368 else Error(
"SetStyle",
"Unknown style:%s",style_name.
Data());
2398 if (macroPath.
Length() == 0) {
2399 macroPath =
gEnv->
GetValue(
"Root.MacroPath", (
char*)0);
2400 #if defined(R__WIN32) 2405 if (macroPath.
Length() == 0)
2406 #
if !defined(R__WIN32)
2424 if (!newpath || !*newpath)
2427 macroPath = newpath;
2443 for (
int i = 0; i <
fgDirLevel; i++) std::cout.put(
' ');
2475 return 10000*(code>>16) + 100*((code&65280)>>8) + (code&255);
2484 int b = (v - a*10000)/100;
2485 int c = v - a*10000 - b*100;
2486 return (a << 16) + (b << 8) + c;
2500 static const char** extraInterpArgs = 0;
2501 return extraInterpArgs;
2507 static Bool_t IgnorePrefix() {
2509 return ignorePrefix;
2518 if (IgnorePrefix()) {
2528 const static TString rootsys = ROOTPREFIX;
2539 if (IgnorePrefix()) {
2542 if (rootbindir.
IsNull()) {
2549 const static TString rootbindir = ROOTBINDIR;
2560 if (IgnorePrefix()) {
2563 if (rootlibdir.
IsNull()) {
2570 const static TString rootlibdir = ROOTLIBDIR;
2581 if (IgnorePrefix()) {
2584 if (rootincdir.
IsNull()) {
2585 rootincdir =
"include";
2591 const static TString rootincdir = ROOTINCDIR;
2602 if (IgnorePrefix()) {
2605 if (rootetcdir.
IsNull()) {
2612 const static TString rootetcdir = ROOTETCDIR;
2623 if (IgnorePrefix()) {
2628 const static TString rootdatadir = ROOTDATADIR;
2639 if (IgnorePrefix()) {
2644 const static TString rootdocdir = ROOTDOCDIR;
2655 if (IgnorePrefix()) {
2658 if (rootmacrodir.
IsNull()) {
2659 rootmacrodir =
"macros";
2662 return rootmacrodir;
2665 const static TString rootmacrodir = ROOTMACRODIR;
2666 return rootmacrodir;
2676 if (IgnorePrefix()) {
2679 if (roottutdir.
IsNull()) {
2680 roottutdir =
"tutorials";
2686 const static TString roottutdir = ROOTTUTDIR;
2697 if (IgnorePrefix()) {
2700 if (rootsrcdir.
IsNull()) {
2707 const static TString rootsrcdir = ROOTSRCDIR;
2718 if (IgnorePrefix()) {
2721 if (rooticonpath.
IsNull()) {
2722 rooticonpath =
"icons";
2725 return rooticonpath;
2728 const static TString rooticonpath = ROOTICONPATH;
2729 return rooticonpath;
2739 if (IgnorePrefix()) {
2742 if (ttffontdir.
IsNull()) {
2743 ttffontdir =
"fonts";
2749 const static TString ttffontdir = TTFFONTDIR;
TSeqCollection * fStreamerInfo
virtual const char * GetTypeName() const
Get type of global variable, e,g.
void Add(TObject *obj, const char *name=0, Int_t check=-1)
Add object with name to browser.
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 Add(TObject *obj)
TListOfFunctionTemplates * fFuncTemplate
Ssiz_t Last(char c) const
Find last occurrence of a character c.
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.
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 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)]...
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.
static Vc_ALWAYS_INLINE int_v min(const int_v &x, const int_v &y)
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.
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.
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.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
virtual TObject * FindObject(const char *name) const
Find an object in this collection using its name.
static const char **& GetExtraInterpreterArgs()
TSeqCollection * fGeometries
R__EXTERN TClassTable * gClassTable
Handle messages that might be generated by the system.
TStyle * GetStyle(const char *name) const
Return pointer to style with name.
TDictionary::DeclId_t DeclId_t
virtual TObject * FindObject(const char *name) const
Returns address of a ROOT object if it exists.
Dictionary for function template This class describes one single function template.
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...
#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.
TString & ReplaceAll(const TString &s1, const TString &s2)
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().
virtual void SetName(const char *name)
Change (i.e.
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
static Bool_t MemCheck()
Return kTRUE if the memory leak checker is on.
A ROOT file is a suite of consecutive data records (TKey instances) with a well defined format...
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.
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...
#define sym(otri1, otri2)
static const char * filename()
void InitInterpreter()
Initialize the interpreter.
void LoadHandlersFromEnv(TEnv *env)
Load plugin handlers specified in config file, like: Plugin.TFile: ^rfio: TRFIOFile RFI...
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.
TSeqCollection * GetListOfStyles() const
void RefreshBrowsers()
Refresh all browsers.
void ls(Option_t *option="") const
To list all objects of the application.
TSeqCollection * GetListOfColors() const
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.
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...
TCollection * GetListOfFunctionOverloads(const char *name) const
Return the collection of functions named "name".
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
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.
TCollection * GetListOfGlobals(Bool_t load=kFALSE)
Return list containing the TGlobals currently defined.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
static const TString & GetIncludeDir()
Get the include directory in the installation. Static utility function.
TObject * GetGeometry(const char *name) const
Return pointer to Geometry with name.
TSeqCollection * GetListOfBrowsers() const
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()
TListOfFunctions * GetGlobalFunctions()
Internal routine returning, and creating if necessary, the list of global function.
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.
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.
virtual void ls(Option_t *option="") const
List Directory contents.
const char * Data() const
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
TSeqCollection * fMappedFiles
virtual void Delete(Option_t *option="")=0
Delete this object.
Sequenceable collection abstract base class.
THashTable implements a hash table to store TObject's.
static TVirtualPad *& Pad()
Return the current pad for the current thread.
virtual TObject * Last() const =0
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
void SetEditorMode(const char *mode="")
Set editor mode.
const char * FindObjectClassName(const char *name) const
Returns class name of a ROOT object including CINT globals.
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...
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.
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.
virtual void Delete(Option_t *option="")
Delete all TFunction object files.
static void at_exit_of_TROOT()
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
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
Describes an Operating System directory for the browser.
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
TSeqCollection * GetListOfGeometries() const
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...
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
TSeqCollection * fDataSets
TSeqCollection * fMessageHandlers
Bool_t ReadingObject() const
Deprecated (will be removed in next release).
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
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...
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.
Basic data type descriptor (datatype information is obtained from CINT).
virtual Int_t GetValue(const char *name, Int_t dflt)
Returns the integer value for a resource.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
TPluginManager * fPluginManager
ClassInfo_t * GetClassInfo() const
Bool_t Gets(FILE *fp, Bool_t chop=kTRUE)
Read one line from the stream, including the , or until EOF.
TSeqCollection * fSecContexts
Collection abstract base class.
TObject * GetObject() const
void SetRefreshFlag(Bool_t flag)
static Int_t ConvertVersionCode2Int(Int_t code)
Convert version code to an integer, i.e. 331527 -> 51507.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t TestBit(UInt_t f) const
void ReadGitInfo()
Read Git commit information and branch name from the etc/gitinfo.txt file.
Short_t GetDeclFileLine() const
virtual void RegisterModule(const char *, const char **, const char **, const char *, const char *, void(*)(), const FwdDeclArgsToKeepCollection_t &fwdDeclArgsToKeep, const char **classesHeaders)=0
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.
TSubString Strip(EStripType s=kTrailing, char c= ' ') const
Return a substring of self stripped at beginning and/or end.
The ROOT global object gROOT contains a list of all defined classes.
virtual void SaveContext()=0
Global variables class (global variables are obtained from CINT).
TSeqCollection * GetListOfFiles() const
virtual TObjLink * FirstLink() const
A collection of TDataType designed to hold the typedef information and numerical type information...
void SetName(const char *name)
static TInterpreter * Instance()
returns gInterpreter global
void InitSystem()
Initialize operating system interface.
TSeqCollection * fSpecials
TGlobal * GetGlobal(const char *name, Bool_t load=kFALSE) const
Return pointer to global variable by name.
#define R__LOCKGUARD2(mutex)
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
Bool_t IsExecutingMacro() const
static void SetDirLevel(Int_t level=0)
Return Indentation level for ls().
TString & Remove(Ssiz_t pos)
Option_t * GetOption() 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...
virtual Int_t GetSize() const
TSeqCollection * fCanvases
virtual TObject * FindObjectAnyFile(const char *name) const
Scan the memory lists of all files for an object with name.
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...
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.
void SetReadingObject(Bool_t flag=kTRUE)
virtual const char * GetName() const
Returns name of object.
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 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.
virtual TObject * First() const =0
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
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.
TCanvas * MakeDefCanvas() const
Return a default canvas.
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.
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.
const char * FindObjectPathName(const TObject *obj) const
Return path name of obj somewhere in the //root/...
static Int_t GetDirLevel()
return directory level
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at //root.
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.
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.
const char * GetDeclFileName() const
TFunctionTemplate * GetFunctionTemplate(const char *name)
TDataType * GetType(const char *name, Bool_t load=kFALSE) const
Return pointer to type with name.
void Load()
Load all the functions known to the interpreter for the scope 'fClass' into this collection.
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at this folder.
TColor * GetColor(Int_t color) const
Return address of color with index color.
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.
R__EXTERN const char * gRootDir
TSeqCollection * fClosedObjects
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TObject * GetFunction(const char *name) const
Return pointer to function with name.
static Int_t IVERSQ()
Return version id as an integer, i.e. "2.22/04" -> 22204.
static void CleanUpROOTAtExit()
Clean up at program termination before global objects go out of scope.
TSeqCollection * fBrowsers
Bool_t IsRootFile(const char *filename) const
Return true if the file is local and is (likely) to be a ROOT file.
static GetROOTFun_t gGetROOT
static const TString & GetTutorialsDir()
Get the tutorials directory in the installation. Static utility function.
static void InitializeColors()
Initialize colors used by the TCanvas based graphics (via TColor objects).
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Bool_t InheritsFrom(const char *cl) const
Return kTRUE if this class inherits from a class with name "classname".
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
TObject * At(Int_t idx) const
TSeqCollection * fSockets
TObject * FindSpecialObject(const char *name, void *&where)
Returns address and folder of a ROOT object if it exists.
R__EXTERN TInterpreter * gCling
R__DLLEXPORT TInterpreter * CreateInterpreter(void *interpLibHandle)
Abstract base class defining a generic interface to the underlying Operating System.
virtual void SetTitle(const char *title="")
Change (i.e. 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 TObject * FindObject(const char *name) const
Must be redefined in derived classes.
virtual char * ConcatFileName(const char *dir, const char *name)
Concatenate a directory and a file name. User must delete returned string.
static TClass * R__GetClassIfKnown(const char *className)
Check whether className is a known class, and only autoload if we can.
static void PrintStatistics()
Print memory usage statistics.
const TObject * fPrimitive
void SetObject(TObject *obj)
TDictionary * Get(DeclId_t id)
Return (after creating it if necessary) the TDataMember describing the data member corresponding to t...
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.