72#include "RConfigure.h"
73#include "RConfigOptions.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,
93FARPROC 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);
158#if defined(R__HAS_COCOA)
164#elif defined(R__WIN32)
178void **(*gThreadTsd)(
void*,
Int_t) =
nullptr;
186 Int_t maj, min, cycle;
188 return 10000*maj + 100*min + cycle;
197 Error(
"TSystem::IDATQQ",
"nullptr date string, expected e.g. 'Dec 21 2022'");
201 static const char *months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
202 "Jun",
"Jul",
"Aug",
"Sep",
"Oct",
206 if (sscanf(date,
"%s %d %d", sm, &dd, &yy) != 3) {
207 Error(
"TSystem::IDATQQ",
"Cannot parse date string '%s', expected e.g. 'Dec 21 2022'", date);
210 for (
int i = 0; i < 12; i++)
211 if (!strncmp(sm, months[i], 3)) {
215 return 10000*yy + 100*mm + dd;
225 sscanf(time,
"%d:%d:%d", &hh, &mm, &ss);
237 if (
gROOT->GetListOfFiles())
238 gROOT->GetListOfFiles()->Delete(
"slow");
239 if (
gROOT->GetListOfSockets())
240 gROOT->GetListOfSockets()->Delete();
241 if (
gROOT->GetListOfMappedFiles())
242 gROOT->GetListOfMappedFiles()->Delete(
"slow");
243 if (
gROOT->GetListOfClosedObjects())
244 gROOT->GetListOfClosedObjects()->Delete(
"slow");
255 struct ModuleHeaderInfo_t {
256 ModuleHeaderInfo_t(
const char* moduleName,
257 const char** headers,
258 const char** includePaths,
259 const char* payloadCode,
260 const char* fwdDeclCode,
261 void (*triggerFunc)(),
263 const char **classesHeaders,
265 fModuleName(moduleName),
267 fPayloadCode(payloadCode),
268 fFwdDeclCode(fwdDeclCode),
269 fIncludePaths(includePaths),
270 fTriggerFunc(triggerFunc),
271 fClassesHeaders(classesHeaders),
272 fFwdNargsToKeepColl(fwdDeclsArgToSkip),
273 fHasCxxModule(hasCxxModule) {}
275 const char* fModuleName;
276 const char** fHeaders;
277 const char* fPayloadCode;
278 const char* fFwdDeclCode;
279 const char** fIncludePaths;
280 void (*fTriggerFunc)();
281 const char** fClassesHeaders;
287 std::vector<ModuleHeaderInfo_t>& GetModuleHeaderInfoBuffer() {
288 static std::vector<ModuleHeaderInfo_t> moduleHeaderInfoBuffer;
289 return moduleHeaderInfoBuffer;
389 if (!initInterpreter) {
390 initInterpreter =
kTRUE;
403 const static bool loadSuccess = dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")? false : 0 <=
gSystem->
Load(
"libImt");
408 Error(
"GetSymInLibImt",
"Cannot get symbol %s.", funcname);
427 ::Warning(
"EnableParBranchProcessing",
"Cannot enable parallel branch processing, please build ROOT with -Dimt=ON");
441 ::Warning(
"DisableParBranchProcessing",
"Cannot disable parallel branch processing, please build ROOT with -Dimt=ON");
466 return isImplicitMTEnabled;
550 ::Warning(
"EnableImplicitMT",
"Cannot enable implicit multi-threading with %d threads, please build ROOT with -Dimt=ON", numthreads);
564 ::Warning(
"DisableImplicitMT",
"Cannot disable implicit multi-threading, please build ROOT with -Dimt=ON");
606 fLineIsProcessing(0), fVersion(0), fVersionInt(0), fVersionCode(0),
607 fVersionDate(0), fVersionTime(0), fBuiltDate(0), fBuiltTime(0),
608 fTimer(0), fApplication(nullptr), fInterpreter(nullptr), fBatch(
kTRUE),
612 fPrimitive(nullptr),fSelectPad(nullptr),fClasses(nullptr),fTypes(nullptr),fGlobals(nullptr),fGlobalFunctions(nullptr),
613 fClosedObjects(nullptr),fFiles(nullptr),fMappedFiles(nullptr),fSockets(nullptr),fCanvases(nullptr),fStyles(nullptr),fFunctions(nullptr),
614 fTasks(nullptr),fColors(nullptr),fGeometries(nullptr),fBrowsers(nullptr),fSpecials(nullptr),fCleanups(nullptr),
615 fMessageHandlers(nullptr),fStreamerInfo(nullptr),fClassGenerators(nullptr),fSecContexts(nullptr),
616 fProofs(nullptr),fClipboard(nullptr),fDataSets(nullptr),fUUIDs(nullptr),fRootFolder(nullptr),fBrowsables(nullptr),
617 fPluginManager(nullptr)
640 :
TDirectory(), fLineIsProcessing(0), fVersion(0), fVersionInt(0), fVersionCode(0),
641 fVersionDate(0), fVersionTime(0), fBuiltDate(0), fBuiltTime(0),
642 fTimer(0), fApplication(nullptr), fInterpreter(nullptr), fBatch(
kTRUE),
646 fPrimitive(nullptr),fSelectPad(nullptr),fClasses(nullptr),fTypes(nullptr),fGlobals(nullptr),fGlobalFunctions(nullptr),
647 fClosedObjects(nullptr),fFiles(nullptr),fMappedFiles(nullptr),fSockets(nullptr),fCanvases(nullptr),fStyles(nullptr),fFunctions(nullptr),
648 fTasks(nullptr),fColors(nullptr),fGeometries(nullptr),fBrowsers(nullptr),fSpecials(nullptr),fCleanups(nullptr),
649 fMessageHandlers(nullptr),fStreamerInfo(nullptr),fClassGenerators(nullptr),fSecContexts(nullptr),
650 fProofs(nullptr),fClipboard(nullptr),fDataSets(nullptr),fUUIDs(nullptr),fRootFolder(nullptr),fBrowsables(nullptr),
651 fPluginManager(nullptr)
718 if (!dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")) {
725 auto setNameLocked = [](
TSeqCollection *
l,
const char *collection_name) {
726 l->SetName(collection_name);
823 if (!webdisplay || !*webdisplay)
825 if (webdisplay && *webdisplay)
836#elif defined(R__HAS_COCOA)
846 while (initfunc && initfunc[i]) {
871 if (gROOTLocal ==
this) {
881 gGetROOT = &GetROOT1;
906#ifdef R__COMPLETE_MEM_TERMINATION
930#ifdef R__COMPLETE_MEM_TERMINATION
942#ifdef R__COMPLETE_MEM_TERMINATION
977#ifdef R__COMPLETE_MEM_TERMINATION
1004 if (dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")) {
1016 gROOTLocal =
nullptr;
1037 if (!generator)
return;
1061 while ((obj = (
TObject *) next())) {
1063 if (opt && strlen(opt))
1071 std::set<TClass *> &GetClassSavedSet()
1073 static thread_local std::set<TClass*> gClassSaved;
1088 auto result = GetClassSavedSet().insert(cl);
1098 GetClassSavedSet().clear();
1102 template <
typename Content>
1103 static void R__ListSlowClose(
TList *files)
1111 Content *dir =
static_cast<Content*
>(
cursor->GetObject() );
1121 cursor->SetObject(&harmless);
1123 dir->Close(
"nodelete");
1133 files->
Clear(
"nodelete");
1136 static void R__ListSlowDeleteContent(
TList *files)
1153 cursor->SetObject(&harmless);
1173 R__ListSlowClose<TDirectory>(
static_cast<TList*
>(
fFiles));
1183 CallFunc_t *socketCloser =
gInterpreter->CallFunc_Factory();
1201 cursor->SetObject(&harmless);
1203 if (
socket->IsA()->InheritsFrom(socketClass)) {
1211 CallFunc_t *otherCloser =
gInterpreter->CallFunc_Factory();
1212 gInterpreter->CallFunc_SetFuncProto(otherCloser,
socket->IsA()->GetClassInfo(),
"Close",
"", &other_offset);
1289 Error(
"FindObject",
"Not yet implemented");
1334 while ((obj=next())) {
1338 if (temp)
return temp;
1405 if (!temp &&
gPad) {
1410 if (!temp && canvas !=
gPad) {
1416 if (!temp)
return nullptr;
1429 if (obj)
return obj;
1445 if (obj)
return obj;
1461 if (
g)
return g->GetTypeName();
1475 Error(
"FindObjectPathName",
"Not yet implemented");
1501 std::string normalized;
1507 if (load && cl==
nullptr) {
1540 if (!lcolors)
return nullptr;
1541 if (color < 0 || color >= lcolors->
GetSize())
return nullptr;
1543 if (col && col->
GetNumber() == color)
return col;
1544 TIter next(lcolors);
1545 while ((col = (
TColor *) next()))
1546 if (col->
GetNumber() == color)
return col;
1556 return (
TCanvas*)
gROOT->ProcessLine(
"TCanvas::MakeDefCanvas();");
1592 static std::atomic<bool> isInited =
false;
1596 bool wasInited = isInited.load();
1599 if (
f1 || wasInited)
1608 [[maybe_unused]]
static const auto _res = []() {
1609 gROOT->ProcessLine(
"TF1::InitStandardFunctions();");
1641 if (addr ==
nullptr || ((
Longptr_t)addr) == -1)
return nullptr;
1693 Fatal(
"GetGlobalFunction",
"fInterpreter not initialized");
1700 if (!decl)
return nullptr;
1705 Error(
"GetGlobalFunction",
1706 "\nDid not find matching TFunction <%s> with \"%s\".",
1726 Fatal(
"GetGlobalFunctionWithPrototype",
"fInterpreter not initialized");
1732 if (!decl)
return nullptr;
1737 Error(
"GetGlobalFunctionWithPrototype",
1738 "\nDid not find matching TFunction <%s> with \"%s\".",
1811 Fatal(
"GetListOfGlobals",
"fInterpreter not initialized");
1835 Fatal(
"GetListOfGlobalFunctions",
"fInterpreter not initialized");
1868 Fatal(
"GetListOfTypes",
"fInterpreter not initialized");
1897 if (idleTimeInSec <= 0)
1898 (*fApplication).RemoveIdleTimer();
1900 (*fApplication).SetIdleTimer(idleTimeInSec, command);
1910 const char* libsToLoad =
gInterpreter->GetClassSharedLibs(className);
1915 }
else if (
gROOT->GetListOfClasses()
1930 if (fname ==
nullptr)
return 0;
1935 if (where !=
kNPOS) {
1982#if defined(R__HAS_COCOA)
1987#elif defined(R__WIN32)
1994 fprintf(stderr,
"Fatal in <TROOT::InitSystem>: can't init operating system layer\n");
1997 fprintf(stderr,
"Fatal in <TROOT::InitSystem>: HOME directory not set\n");
1998 fprintf(stderr,
"Fix this by defining the HOME shell variable\n");
2018 if (oldzipmode == 0) {
2019 fprintf(stderr,
"Warning in <TROOT::InitSystem>: ignoring old rootrc entry \"Root.ZipMode = 0\"!\n");
2021 if (oldzipmode == -1 || oldzipmode == 1) {
2036 if (
gDebug > 0 && isatty(2))
2037 fprintf(stderr,
"Info in <TROOT::InitSystem>: running with gDebug = %d\n",
gDebug);
2039#if defined(R__HAS_COCOA)
2044 {
TUrl dummy(
"/dummy"); }
2068 if (!dlsym(RTLD_DEFAULT,
"usedToIdentifyRootClingByDlSym")
2069 && !dlsym(RTLD_DEFAULT,
"usedToIdentifyStaticRoot")) {
2071 void *libRIOHandle = dlopen(libRIO, RTLD_NOW|RTLD_GLOBAL);
2073 if (!libRIOHandle) {
2075 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load library %s\n", err.
Data());
2085 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load library %s\n", err.
Data());
2095 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.
Data());
2104 fprintf(stderr,
"Fatal in <TROOT::InitInterpreter>: cannot load symbol %s\n", err.
Data());
2108 const char *interpArgs[] = {
2138 for (std::vector<ModuleHeaderInfo_t>::const_iterator
2139 li = GetModuleHeaderInfoBuffer().begin(),
2140 le = GetModuleHeaderInfoBuffer().end(); li != le; ++li) {
2148 li->fFwdNargsToKeepColl,
2149 li->fClassesHeaders,
2153 GetModuleHeaderInfoBuffer().clear();
2233 FILE *mayberootfile = fopen(
filename,
"rb");
2234 if (mayberootfile) {
2236 if (fgets(header,5,mayberootfile)) {
2237 result = strncmp(header,
"root",4)==0;
2239 fclose(mayberootfile);
2283 if (arguments.
Length()) {
2340 if (padUpdate &&
gPad)
2378 return (*fApplication).ProcessLine(sline,
kFALSE, error);
2398 return (*fApplication).ProcessLine(sline,
kTRUE, error);
2448 Error(
"ReadGitInfo()",
"Cannot determine git info: etc/gitinfo.txt not found!");
2453 TTHREAD_TLS(
Bool_t) fgReadingObject =
false;
2454 return fgReadingObject;
2477 Int_t iday,imonth,iyear, ihour, imin;
2478 static const char *months[] = {
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
2479 "Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec" };
2483 imonth = (idate/100)%100;
2484 iyear = idate/10000;
2487 fGitDate.
Form(
"%s %02d %4d, %02d:%02d:00", months[imonth-1], iday, iyear, ihour, imin);
2525 gROOT->CloseFiles();
2536 const char** headers,
2537 const char** includePaths,
2538 const char* payloadCode,
2539 const char* fwdDeclCode,
2540 void (*triggerFunc)(),
2542 const char** classesHeaders,
2605 gCling->
RegisterModule(modulename, headers, includePaths, payloadCode, fwdDeclCode, triggerFunc,
2606 fwdDeclsArgToSkip, classesHeaders,
false, hasCxxModule);
2608 GetModuleHeaderInfoBuffer().push_back(ModuleHeaderInfo_t(modulename, headers, includePaths, payloadCode,
2609 fwdDeclCode, triggerFunc, fwdDeclsArgToSkip,
2610 classesHeaders, hasCxxModule));
2655 if (!strncmp(
option,
"a", 1)) {
2686 Error(
"SetCutClassName",
"Invalid class name");
2691 Error(
"SetCutClassName",
"Unknown class:%s",
name);
2695 Error(
"SetCutClassName",
"Class:%s does not derive from TCutG",
name);
2707 if (!
mode[0])
return;
2732 TString style_name = stylename;
2736 else Error(
"SetStyle",
"Unknown style:%s",style_name.
Data());
2766 if (macroPath.
Length() == 0) {
2767 macroPath =
gEnv->
GetValue(
"Root.MacroPath", (
char*)
nullptr);
2768#if defined(R__WIN32)
2773 if (macroPath.
Length() == 0)
2774#if !defined(R__WIN32)
2792 if (!newpath || !*newpath)
2795 macroPath = newpath;
2833 const char *wd = webdisplay ? webdisplay :
"";
2841 if (!strcmp(wd,
"off")) {
2848 if (!strncmp(wd,
"server", 6)) {
2852 if ((wd[7] >=
'0') && (wd[7] <=
'9')) {
2857 Error(
"SetWebDisplay",
"Wrong port parameter %s for server", wd+7);
2893 for (
int i = 0; i <
fgDirLevel; i++) std::cout.put(
' ');
2924 return 10000*(code>>16) + 100*((code&65280)>>8) + (code&255);
2933 int b = (
v -
a*10000)/100;
2934 int c =
v -
a*10000 -
b*100;
2935 return (
a << 16) + (
b << 8) +
c;
2953 static std::vector<std::string> sArgs = {};
2954 sArgs.insert(sArgs.begin(), args.begin(), args.end());
2963 static const char** extraInterpArgs =
nullptr;
2964 return extraInterpArgs;
2970static Bool_t IgnorePrefix() {
2972 return ignorePrefix;
2991 if (IgnorePrefix()) {
2994 if (rootbindir.
IsNull()) {
3001 const static TString rootbindir = ROOTBINDIR;
3012 if (IgnorePrefix()) {
3015 if (rootlibdir.
IsNull()) {
3022 const static TString rootlibdir = ROOTLIBDIR;
3032#if defined(R__WIN32)
3064 if (IgnorePrefix()) {
3069 const static TString rootdatadir = ROOTDATADIR;
3080 if (IgnorePrefix()) {
3085 const static TString rootdocdir = ROOTDOCDIR;
3096 if (IgnorePrefix()) {
3099 if (rootmacrodir.
IsNull()) {
3100 rootmacrodir =
"macros";
3103 return rootmacrodir;
3106 const static TString rootmacrodir = ROOTMACRODIR;
3107 return rootmacrodir;
3117 if (IgnorePrefix()) {
3120 if (roottutdir.
IsNull()) {
3121 roottutdir =
"tutorials";
3127 const static TString roottutdir = ROOTTUTDIR;
3139 gROOT->EndOfProcessCleanups();
3149 if (IgnorePrefix()) {
3152 if (rootsrcdir.
IsNull()) {
3159 const static TString rootsrcdir = ROOTSRCDIR;
3170 if (IgnorePrefix()) {
3173 if (rooticonpath.
IsNull()) {
3174 rooticonpath =
"icons";
3177 return rooticonpath;
3180 const static TString rooticonpath = ROOTICONPATH;
3181 return rooticonpath;
3191 if (IgnorePrefix()) {
3194 if (ttffontdir.
IsNull()) {
3195 ttffontdir =
"fonts";
3201 const static TString ttffontdir = TTFFONTDIR;
The file contains utilities which are foundational and could be used across the core component of ROO...
#define ROOT_RELEASE_TIME
#define ROOT_VERSION_CODE
#define ROOT_RELEASE_DATE
R__EXTERN TClassTable * gClassTable
TInterpreter * CreateInterpreter(void *interpLibHandle, const char *argv[])
void DefaultErrorHandler(Int_t level, Bool_t abort_bool, const char *location, const char *msg)
The default error handler function.
void Error(const char *location, const char *msgfmt,...)
Use this function in case an error occurred.
void Warning(const char *location, const char *msgfmt,...)
Use this function in warning situations.
ErrorHandlerFunc_t SetErrorHandler(ErrorHandlerFunc_t newhandler)
Set an errorhandler function. Returns the old handler.
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t cursor
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char filename
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t Int_t Int_t Window_t TString Int_t GCValues_t GetPrimarySelectionOwner GetDisplay GetScreen GetColormap GetNativeEvent const char const char dpyName wid window const char font_name cursor keysym reg const char only_if_exist regb h Point_t winding char text const char depth char const char Int_t count const char ColorStruct_t color const char Pixmap_t Pixmap_t PictureAttributes_t attr const char char ret_data h unsigned char height h offset
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t WindowAttributes_t Float_t Float_t Float_t Int_t Int_t UInt_t UInt_t Rectangle_t result
Option_t Option_t TPoint TPoint const char mode
R__EXTERN TGuiFactory * gBatchGuiFactory
R__EXTERN TGuiFactory * gGuiFactory
R__EXTERN TVirtualMutex * gInterpreterMutex
TInterpreter * CreateInterpreter_t(void *shlibHandle, const char *argv[])
R__EXTERN TInterpreter * gCling
void * DestroyInterpreter_t(TInterpreter *)
R__EXTERN TPluginManager * gPluginMgr
Bool_t & GetReadingObject()
static Int_t IVERSQ()
Return version id as an integer, i.e. "2.22/04" -> 22204.
static Int_t IDATQQ(const char *date)
Return built date as integer, i.e. "Apr 28 2000" -> 20000428.
static TClass * R__GetClassIfKnown(const char *className)
Check whether className is a known class, and only autoload if we can.
static DestroyInterpreter_t * gDestroyInterpreter
static void * gInterpreterLib
static Int_t ITIMQQ(const char *time)
Return built time as integer (with min precision), i.e.
static void at_exit_of_TROOT()
TVirtualMutex * gROOTMutex
static void CleanUpROOTAtExit()
Clean up at program termination before global objects go out of scope.
static void CallCloseFiles()
Insure that the files, canvases and sockets are closed.
R__EXTERN TVirtualMutex * gROOTMutex
R__EXTERN TStyle * gStyle
R__EXTERN const char * gRootDir
Bool_t R_ISREG(Int_t mode)
R__EXTERN TSystem * gSystem
R__EXTERN TVirtualMutex * gGlobalMutex
#define R__LOCKGUARD(mutex)
#define R__READ_LOCKGUARD(mutex)
R__EXTERN TVirtualX * gGXBatch
char fHolder[sizeof(TROOT)]
static void CreateApplication()
Static function used to create a default application environment.
Using a TBrowser one can browse all ROOT objects.
void SetRefreshFlag(Bool_t flag)
Objects following this interface can be passed onto the TROOT object to implement a user customized w...
This class registers for all classes their name, id and dictionary function in a hash table.
TClass instances represent classes, structs and namespaces in the ROOT type system.
static void AddClass(TClass *cl)
static: Add a class to the list and map of classes.
static TClass * LoadClass(const char *requestedname, Bool_t silent)
Helper function used by TClass::GetClass().
Short_t GetDeclFileLine() const
static void RemoveClass(TClass *cl)
static: Remove a class from the list and map of classes
ClassInfo_t * GetClassInfo() const
Bool_t InheritsFrom(const char *cl) const override
Return kTRUE if this class inherits from a class with name "classname".
const char * GetDeclFileName() const
Return name of the file containing the declaration of this class.
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.
Collection abstract base class.
void RecursiveRemove(TObject *obj) override
Remove object from this collection and recursively remove the object from all other objects (and coll...
virtual bool UseRWLock(Bool_t enable=true)
Set this collection to use a RW lock upon access, making it thread safe.
virtual void AddAll(const TCollection *col)
Add all objects from collection col to this collection.
virtual void SetOwner(Bool_t enable=kTRUE)
Set whether this collection is the owner (enable==true) of its content.
virtual void Add(TObject *obj)=0
TObject * FindObject(const char *name) const override
Find an object in this collection using its name.
void Delete(Option_t *option="") override=0
Delete this object.
void Clear(Option_t *option="") override=0
virtual Int_t GetSize() const
Return the capacity of the collection, i.e.
The color creation and management class.
static void InitializeColors()
Initialize colors used by the TCanvas based graphics (via TColor objects).
Basic data type descriptor (datatype information is obtained from CINT).
Describe directory structure in memory.
virtual void Close(Option_t *option="")
Delete all objects from memory and directory structure itself.
virtual TList * GetList() const
void ls(Option_t *option="") const override
List Directory contents.
virtual void Append(TObject *obj, Bool_t replace=kFALSE)
Append object to this directory.
void SetName(const char *newname) override
Set the name for directory If the directory name is changed after the directory was written once,...
void BuildDirectory(TFile *motherFile, TDirectory *motherDir)
Initialise directory to defaults.
static std::atomic< TDirectory * > & CurrentDirectory()
Return the current directory for the current thread.
virtual TObject * Remove(TObject *)
Remove an object from the in-memory list.
The TEnv class reads config files, by default named .rootrc.
virtual Int_t GetValue(const char *name, Int_t dflt) const
Returns the integer value for a resource.
virtual void SetValue(const char *name, const char *value, EEnvLevel level=kEnvChange, const char *type=nullptr)
Set the value of a resource or create a new resource.
A ROOT file is an on-disk file, usually with extension .root, that stores objects in a file-system-li...
<div class="legacybox"><h2>Legacy Code</h2> TFolder is a legacy interface: there will be no bug fixes...
virtual TObject * FindObjectAny(const char *name) const
Return a pointer to the first object with name starting at this folder.
TFolder * AddFolder(const char *name, const char *title, TCollection *collection=nullptr)
Create a new folder and add it to the list of folders of this folder, return a pointer to the created...
Dictionary for function template This class describes one single function template.
Global functions class (global functions are obtained from CINT).
static void MakeFunctor(const char *name, const char *type, GlobFunc &func)
static TList & GetEarlyRegisteredGlobals()
Returns list collected globals Used to storeTGlobalMappedFunctions from other libs,...
Global variables class (global variables are obtained from CINT).
This ABC is a factory for GUI components.
THashList implements a hybrid collection class consisting of a hash table and a list to store TObject...
THashTable implements a hash table to store TObject's.
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, Bool_t hasCxxModule=false)=0
virtual void Initialize()=0
std::vector< std::pair< std::string, int > > FwdDeclArgsToKeepCollection_t
virtual void SaveContext()=0
TDictionary::DeclId_t DeclId_t
Option_t * GetOption() const
A collection of TDataMember objects designed for fast access given a DeclId_t and for keep track of T...
void Delete(Option_t *option="") override
Delete all TDataMember object files.
void Unload()
Mark 'all func' as being unloaded.
TDictionary * Get(DeclId_t id)
Return (after creating it if necessary) the TDataMember describing the data member corresponding to t...
void Load()
Load all the DataMembers known to the interpreter for the scope 'fClass' into this collection.
A collection of TEnum objects designed for fast access given a DeclId_t and for keep track of TEnum t...
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
TObject * FindObject(const char *name) const override
Specialize FindObject to do search for the a function just by name or create it if its not already in...
A collection of TFunction objects designed for fast access given a DeclId_t and for keep track of TFu...
TFunction * Get(DeclId_t id)
Return (after creating it if necessary) the TMethod or TFunction describing the function correspondin...
void Delete(Option_t *option="") override
Delete all TFunction object files.
void Load()
Load all the functions known to the interpreter for the scope 'fClass' into this collection.
void Unload()
Mark 'all func' as being unloaded.
A collection of TDataType designed to hold the typedef information and numerical type information.
void Clear(Option_t *option="") override
Remove all objects from the list.
void Add(TObject *obj) override
void AddLast(TObject *obj) override
Add object at the end of the list.
virtual TObjLink * FirstLink() const
void Delete(Option_t *option="") override
Remove all objects from the list AND delete all heap based objects.
Handle messages that might be generated by the system.
virtual void HandleMessage(Long_t id, const TObject *obj)
Store message origin, keep statistics and call Notify().
virtual void SetTitle(const char *title="")
Set the title of the TNamed.
virtual void SetName(const char *name)
Set the name of the TNamed.
TObject * At(Int_t idx) const override
Wrapper around a TObject so it can be stored in a TList.
Mother of all ROOT objects.
static void SetObjectStat(Bool_t stat)
Turn on/off tracking of objects in the TObjectTable.
virtual const char * GetName() const
Returns name of object.
virtual const char * ClassName() const
Returns name of class to which the object belongs.
virtual void Warning(const char *method, const char *msgfmt,...) const
Issue warning message.
virtual TObject * FindObject(const char *name) const
Must be redefined in derived classes.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
virtual void Fatal(const char *method, const char *msgfmt,...) const
Issue fatal error message.
@ kInvalidObject
if object ctor succeeded but object should not be used
@ kMustCleanup
if object destructor must call RecursiveRemove()
This class implements a plugin library manager.
void LoadHandlersFromEnv(TEnv *env)
Load plugin handlers specified in config file, like:
static void Cleanup()
static function (called by TROOT destructor) to delete all TProcessIDs
static TProcessID * AddProcessID()
Static function to add a new TProcessID to the list of PIDs.
This class is a specialized TProcessID managing the list of UUIDs.
static Bool_t BlockAllSignals(Bool_t b)
Block or unblock all signals. Returns the previous block status.
ROOT top level object description.
static Int_t IncreaseDirLevel()
Increase the indentation level for ls().
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,...
Int_t fVersionCode
ROOT version code as used in RVersion.h.
void Message(Int_t id, const TObject *obj)
Process message id called by obj.
void RemoveClass(TClass *)
Remove a class from the list and map of classes.
TSeqCollection * fProofs
List of proof sessions.
TCollection * fClassGenerators
List of user defined class generators;.
TROOT()
Only used by Dictionary.
void SetCutClassName(const char *name="TCutG")
Set the default graphical cut class name for the graphics editor By default the graphics editor creat...
TSeqCollection * fCanvases
List of canvases.
TObject * FindObjectAnyFile(const char *name) const override
Scan the memory lists of all files for an object with name.
const TObject * fPrimitive
Currently selected primitive.
void SetWebDisplay(const char *webdisplay="")
Specify where web graphics shall be rendered.
Bool_t fIsWebDisplay
True if session uses web widgets.
TFolder * fRootFolder
top level folder //root
void AddClassGenerator(TClassGenerator *gen)
Add a class generator.
TSeqCollection * fGeometries
List of geometries.
TString fCutClassName
Name of default CutG class in graphics editor.
TInterpreter * fInterpreter
Command interpreter.
std::vector< std::pair< std::string, int > > FwdDeclArgsToKeepCollection_t
Int_t fVersionTime
Time of ROOT version (ex 1152)
void EndOfProcessCleanups()
Execute the cleanups necessary at the end of the process, in particular those that must be executed b...
Bool_t fBatch
True if session without graphics.
TSeqCollection * GetListOfFiles() const
Bool_t fEscape
True if ESC has been pressed.
static const TString & GetBinDir()
Get the binary directory in the installation. Static utility function.
Int_t fVersionInt
ROOT version in integer format (501)
static const TString & GetIncludeDir()
Get the include directory in the installation. Static utility function.
Bool_t fFromPopUp
True if command executed from a popup menu.
void Idle(UInt_t idleTimeInSec, const char *command=nullptr)
Execute command when system has been idle for idleTimeInSec seconds.
TSeqCollection * fSockets
List of network sockets.
void ls(Option_t *option="") const override
To list all objects of the application.
static const char * GetMacroPath()
Get macro search path. Static utility function.
TCollection * fFunctions
List of analytic functions.
void SaveContext()
Save the current interpreter context.
Bool_t IsExecutingMacro() const
TDataType * GetType(const char *name, Bool_t load=kFALSE) const
Return pointer to type with name.
static void Initialize()
Initialize ROOT explicitly.
static void ShutDown()
Shut down ROOT.
TObject * GetFunction(const char *name) const
Return pointer to function with name.
static Int_t ConvertVersionCode2Int(Int_t code)
Convert version code to an integer, i.e. 331527 -> 51507.
TSeqCollection * fMessageHandlers
List of message handlers.
void SetStyle(const char *stylename="Default")
Change current style to style with name stylename.
AListOfEnums_t fEnums
List of enum types.
void ReadGitInfo()
Read Git commit SHA1 and branch name.
static Bool_t fgRootInit
Singleton initialization flag.
void RefreshBrowsers()
Refresh all browsers.
void CloseFiles()
Close any files and sockets that gROOT knows about.
std::atomic< TApplication * > fApplication
Pointer to current application.
const char * FindObjectPathName(const TObject *obj) const
Return path name of obj somewhere in the //root/... path.
static Int_t ConvertVersionInt2Code(Int_t v)
Convert version as an integer to version code as used in RVersion.h.
void ResetClassSaved()
Reset the ClassSaved status of all classes.
static const TString & GetTTFFontDir()
Get the fonts directory in the installation. Static utility function.
Bool_t fForceStyle
Force setting of current style when reading objects.
TCanvas * MakeDefCanvas() const
Return a default canvas.
TCollection * fTypes
List of data types definition.
TColor * GetColor(Int_t color) const
Return address of color with index color.
TGlobal * GetGlobal(const char *name, Bool_t load=kFALSE) const
Return pointer to global variable by name.
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.
TSeqCollection * fStreamerInfo
List of active StreamerInfo classes.
void Append(TObject *obj, Bool_t replace=kFALSE) override
Append object to this directory.
static const TString & GetIconPath()
Get the icon path in the installation. Static utility function.
TCollection * GetListOfGlobalFunctions(Bool_t load=kFALSE)
Return list containing the TFunctions currently defined.
TString fGitDate
Date and time when make was run.
TSeqCollection * fSpecials
List of special objects.
TCollection * GetListOfFunctionTemplates()
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, bool hasCxxModule=false)
Called by static dictionary initialization to register clang modules for headers.
TObject * FindObject(const char *name) const override
Returns address of a ROOT object if it exists.
TCollection * fClasses
List of classes definition.
Bool_t fEditHistograms
True if histograms can be edited with the mouse.
TListOfDataMembers * fGlobals
List of global variables.
TListOfFunctionTemplates * fFuncTemplate
List of global function templates.
TSeqCollection * fDataSets
List of data sets (TDSet or TChain)
TString fConfigOptions
ROOT ./configure set build options.
TStyle * GetStyle(const char *name) const
Return pointer to style with name.
TCollection * GetListOfEnums(Bool_t load=kFALSE)
Longptr_t ProcessLineSync(const char *line, Int_t *error=nullptr)
Process interpreter command via TApplication::ProcessLine().
void InitInterpreter()
Initialize interpreter (cling)
TCollection * GetListOfGlobals(Bool_t load=kFALSE)
Return list containing the TGlobals currently defined.
static void SetDirLevel(Int_t level=0)
Return Indentation level for ls().
TSeqCollection * fSecContexts
List of security contexts (TSecContext)
TString fWebDisplay
If not empty it defines where web graphics should be rendered (cef, qt5, browser.....
static const char * GetTutorialsDir()
Get the tutorials directory in the installation.
TCollection * GetListOfFunctionOverloads(const char *name) const
Return the collection of functions named "name".
TSeqCollection * fCleanups
List of recursiveRemove collections.
static Bool_t Initialized()
Return kTRUE if the TROOT object has been initialized.
void SetBatch(Bool_t batch=kTRUE)
Set batch mode for ROOT If the argument evaluates to true, the session does not use interactive graph...
Int_t fLineIsProcessing
To synchronize multi-threads.
static const TString & GetSourceDir()
Get the source directory in the installation. Static utility function.
static const TString & GetMacroDir()
Get the macro directory in the installation. Static utility function.
TString fGitCommit
Git commit SHA1 of built.
Longptr_t ProcessLine(const char *line, Int_t *error=nullptr)
Process interpreter command via TApplication::ProcessLine().
TSeqCollection * fClosedObjects
List of closed objects from the list of files and sockets, so we can delete them if neededCl.
TSeqCollection * fTasks
List of tasks.
TSeqCollection * fClipboard
List of clipboard objects.
const char * GetGitDate()
Return date/time make was run.
void SetEditorMode(const char *mode="")
Set editor mode.
static const TString & GetTutorialDir()
Get the tutorials directory in the installation. Static utility function.
virtual ~TROOT()
Clean up and free resources used by ROOT (files, network sockets, shared memory segments,...
TSeqCollection * fColors
List of colors.
TFunction * GetGlobalFunctionWithPrototype(const char *name, const char *proto=nullptr, Bool_t load=kFALSE)
Return pointer to global function by name.
TSeqCollection * GetListOfBrowsers() const
Bool_t ReadingObject() const
Deprecated (will be removed in next release).
TSeqCollection * fStyles
List of styles.
Int_t fVersionDate
Date of ROOT version (ex 951226)
TSeqCollection * GetListOfColors() const
Longptr_t Macro(const char *filename, Int_t *error=nullptr, Bool_t padUpdate=kTRUE)
Execute a macro in the interpreter.
Int_t fBuiltTime
Time of ROOT built.
static const std::vector< std::string > & AddExtraInterpreterArgs(const std::vector< std::string > &args)
Provide command line arguments to the interpreter construction.
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.
TVirtualPad * fSelectPad
Currently selected pad.
TSeqCollection * fFiles
List of files.
void Browse(TBrowser *b) override
Add browsable objects to TBrowser.
static const TString & GetRootSys()
Get the rootsys directory in the installation. Static utility function.
TListOfFunctions * GetGlobalFunctions()
Internal routine returning, and creating if necessary, the list of global function.
Bool_t fInterrupt
True if macro should be interrupted.
Bool_t fMustClean
True if object destructor scans canvases.
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,...
TFunction * GetGlobalFunction(const char *name, const char *params=nullptr, Bool_t load=kFALSE)
Return pointer to global function by name.
void AddClass(TClass *cl)
Add a class to the list and map of classes.
static Int_t RootVersionCode()
Return ROOT version code as defined in RVersion.h.
TObject * FindSpecialObject(const char *name, void *&where)
Returns address and folder of a ROOT object if it exists.
TObject * Remove(TObject *) override
Remove an object from the in-memory list.
void InitSystem()
Operating System interface.
Longptr_t ProcessLineFast(const char *line, Int_t *error=nullptr)
Process interpreter command directly via CINT interpreter.
Bool_t ClassSaved(TClass *cl)
return class status 'ClassSaved' for class cl This function is called by the SavePrimitive functions ...
TString fGitBranch
Git branch.
TCollection * GetListOfTypes(Bool_t load=kFALSE)
Return a dynamic list giving access to all TDataTypes (typedefs) currently defined.
static Int_t fgDirLevel
Indentation level for ls()
Bool_t IsRootFile(const char *filename) const
Return true if the file is local and is (likely) to be a ROOT file.
static void IndentLevel()
Functions used by ls() to indent an object hierarchy.
static const TString & GetDocDir()
Get the documentation directory in the installation. Static utility function.
static const TString & GetEtcDir()
Get the sysconfig directory in the installation. Static utility function.
Int_t GetNclasses() const
Get number of classes.
static const char **& GetExtraInterpreterArgs()
INTERNAL function! Used by rootcling to inject interpreter arguments through a C-interface layer.
static void SetMacroPath(const char *newpath)
Set or extend the macro search path.
void InitThreads()
Initialize threads library.
TProcessUUID * fUUIDs
Pointer to TProcessID managing TUUIDs.
TString fConfigFeatures
ROOT ./configure detected build features.
TFunctionTemplate * GetFunctionTemplate(const char *name)
TPluginManager * fPluginManager
Keeps track of plugin library handlers.
TObject * GetGeometry(const char *name) const
Return pointer to Geometry with name.
void RecursiveRemove(TObject *obj) override
Recursively remove this object from the list of Cleanups.
Bool_t fExecutingMacro
True while executing a TMacro.
Int_t fBuiltDate
Date of ROOT built.
Bool_t fIsWebDisplayBatch
True if web widgets are not displayed.
static const TString & GetSharedLibDir()
Get the shared libraries directory in the installation. Static utility function.
TSeqCollection * fMappedFiles
List of memory mapped files.
Int_t GetNtypes() const
Get number of types.
Int_t LoadMacro(const char *filename, Int_t *error=nullptr, Bool_t check=kFALSE)
Load a macro in the interpreter's memory.
TFile * GetFile() const override
static const TString & GetLibDir()
Get the library directory in the installation. Static utility function.
TSeqCollection * fBrowsers
List of browsers.
TString fDefCanvasName
Name of default canvas.
TListOfFunctions * fGlobalFunctions
List of global functions.
TList * fBrowsables
List of browsables.
TObject * FindObjectAny(const char *name) const override
Return a pointer to the first object with name starting at //root.
static Int_t DecreaseDirLevel()
Decrease the indentation level for ls().
void Reset(Option_t *option="")
Delete all global interpreter objects created since the last call to Reset.
Int_t fEditorMode
Current Editor mode.
const char * FindObjectClassName(const char *name) const
Returns class name of a ROOT object including CINT globals.
static const TString & GetDataDir()
Get the data directory in the installation. Static utility function.
TSeqCollection * GetListOfGeometries() const
TSeqCollection * GetListOfStyles() const
TString fVersion
ROOT version (from CMZ VERSQQ) ex 0.05/01.
static Int_t GetDirLevel()
return directory level
void SetReadingObject(Bool_t flag=kTRUE)
Sequenceable collection abstract base class.
virtual void AddLast(TObject *obj)=0
virtual TObject * Last() const =0
virtual TObject * First() const =0
void Add(TObject *obj) override
static void PrintStatistics()
Print memory usage statistics.
Int_t Atoi() const
Return integer value of string.
Bool_t Gets(FILE *fp, Bool_t chop=kTRUE)
Read one line from the stream, including the \n, or until EOF.
Bool_t EndsWith(const char *pat, ECaseCompare cmp=kExact) const
Return true if string ends with the specified string.
TSubString Strip(EStripType s=kTrailing, char c=' ') const
Return a substring of self stripped at beginning and/or end.
const char * Data() const
TString & ReplaceAll(const TString &s1, const TString &s2)
Ssiz_t Last(char c) const
Find last occurrence of a character c.
Bool_t BeginsWith(const char *s, ECaseCompare cmp=kExact) const
TString & Remove(Ssiz_t pos)
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
Bool_t Contains(const char *pat, ECaseCompare cmp=kExact) const
TStyle objects may be created to define special styles.
static void BuildStyles()
Create some standard styles.
Describes an Operating System directory for the browser.
Abstract base class defining a generic interface to the underlying Operating System.
virtual Func_t DynFindSymbol(const char *module, const char *entry)
Find specific entry point in specified library.
virtual const char * Getenv(const char *env)
Get environment variable.
virtual TString SplitAclicMode(const char *filename, TString &mode, TString &args, TString &io) const
This method split a filename of the form:
virtual void CleanCompiledMacros()
Remove the shared libs produced by the CompileMacro() function, together with their rootmaps,...
virtual int Load(const char *module, const char *entry="", Bool_t system=kFALSE)
Load a shared library.
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 const char * PrependPathName(const char *dir, TString &name)
Concatenate a directory and a file name.
virtual Bool_t AccessPathName(const char *path, EAccessMode mode=kFileExists)
Returns FALSE if one can access a file using the specified access mode.
virtual Bool_t Init()
Initialize the OS interface.
virtual const char * BaseName(const char *pathname)
Base name of a file name. Base name of /user/root is root.
virtual const char * WorkingDirectory()
Return working directory.
virtual char * Which(const char *search, const char *file, EAccessMode mode=kFileExists)
Find location of file in a search path.
virtual const char * HomeDirectory(const char *userName=nullptr)
Return the user's home directory.
virtual const char * GetError()
Return system error string.
virtual void ResetSignals()
Reset signals handlers to previous behaviour.
char * DynamicPathName(const char *lib, Bool_t quiet=kFALSE)
Find a dynamic library called lib using the system search paths.
This class represents a WWW compatible URL.
This class implements a mutex interface.
TVirtualPad is an abstract base class for the Pad and Canvas classes.
static TVirtualPad *& Pad()
Return the current pad for the current thread.
virtual TVirtualPad * GetVirtCanvas() const =0
Semi-Abstract base class defining a generic interface to the underlying, low level,...
static TVirtualX *& Instance()
Returns gVirtualX global.
R__ALWAYS_INLINE bool HasBeenDeleted(const TObject *obj)
Check if the TObject's memory has been deleted.
const std::string & GetIncludeDir()
\ returns the include directory in the installation.
const std::string & GetRootSys()
const std::string & GetEtcDir()
void(off) SmallVectorTemplateBase< T
static Func_t GetSymInLibImt(const char *funcname)
static GetROOTFun_t gGetROOT
R__EXTERN TROOT * gROOTLocal
void DisableParBranchProcessing()
Globally disables the IMT use case of parallel branch processing, deactivating the corresponding lock...
std::function< const char *()> ErrorSystemMsgHandlerFunc_t
Retrieves the error string associated with the last system error.
static Bool_t & IsImplicitMTEnabledImpl()
Keeps track of the status of ImplicitMT w/o resorting to the load of libImt.
void MinimalErrorHandler(int level, Bool_t abort, const char *location, const char *msg)
A very simple error handler that is usually replaced by the TROOT default error handler.
TROOT *(* GetROOTFun_t)()
ErrorSystemMsgHandlerFunc_t SetErrorSystemMsgHandler(ErrorSystemMsgHandlerFunc_t h)
Returns the previous system error message handler.
void EnableParBranchProcessing()
Globally enables the parallel branch processing, which is a case of implicit multi-threading (IMT) in...
Bool_t IsParBranchProcessingEnabled()
Returns true if parallel branch processing is enabled.
void ReleaseDefaultErrorHandler()
Destructs resources that are taken by using the default error handler.
tbb::task_arena is an alias of tbb::interface7::task_arena, which doesn't allow to forward declare tb...
void EnableImplicitMT(UInt_t numthreads=0)
Enable ROOT's implicit multi-threading for all objects and methods that provide an internal paralleli...
Bool_t IsImplicitMTEnabled()
Returns true if the implicit multi-threading in ROOT is enabled.
UInt_t GetThreadPoolSize()
Returns the size of ROOT's thread pool.
R__EXTERN TVirtualRWMutex * gCoreMutex
void EnableThreadSafety()
Enable support for multi-threading within the ROOT code in particular, enables the global mutex to ma...
void DisableImplicitMT()
Disables the implicit multi-threading in ROOT (see EnableImplicitMT).
void GetNormalizedName(std::string &norm_name, std::string_view name)
Return the normalized name.