ROOT logo
ROOT » CORE » BASE » TApplication

class TApplication: public TObject, public TQObject


TApplication

This class creates the ROOT Application Environment that interfaces
to the windowing system eventloop and eventhandlers.
This class must be instantiated exactly once in any given
application. Normally the specific application class inherits from
TApplication (see TRint).


Function Members (Methods)

public:
TApplication(const char* appClassName, Int_t* argc, char** argv, void* options = 0, Int_t numOptions = 0)
virtual~TApplication()
voidTObject::AbstractMethod(const char* method) const
virtual voidTObject::AppendPad(Option_t* option = "")
virtual const char*ApplicationName() const
static Bool_tTQObject::AreAllSignalsBlocked()
Bool_tTQObject::AreSignalsBlocked() const
Int_tArgc() const
char**Argv() const
char*Argv(Int_t index) const
static Bool_tTQObject::BlockAllSignals(Bool_t b)
Bool_tTQObject::BlockSignals(Bool_t b)
virtual voidTObject::Browse(TBrowser* b)
virtual voidTQObject::ChangedBy(const char* method)SIGNAL
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
voidClearInputFiles()
virtual TObject*TObject::Clone(const char* newname = "") const
voidTQObject::CollectClassSignalLists(TList& list, TClass* cls)
virtual Int_tTObject::Compare(const TObject* obj) const
Bool_tTQObject::Connect(const char* signal, const char* receiver_class, void* receiver, const char* slot)
static Bool_tTQObject::Connect(TQObject* sender, const char* signal, const char* receiver_class, void* receiver, const char* slot)
static Bool_tTQObject::Connect(const char* sender_class, const char* signal, const char* receiver_class, void* receiver, const char* slot)
virtual voidTQObject::Connected(const char*)
virtual voidTObject::Copy(TObject& object) const
static voidCreateApplication()
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual voidTQObject::Destroyed()SIGNAL
Bool_tTQObject::Disconnect(const char* signal = 0, void* receiver = 0, const char* slot = 0)
static Bool_tTQObject::Disconnect(TQObject* sender, const char* signal = 0, void* receiver = 0, const char* slot = 0)
static Bool_tTQObject::Disconnect(const char* class_name, const char* signal, void* receiver = 0, const char* slot = 0)
virtual voidTQObject::Disconnected(const char*)
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
voidTQObject::Emit(const char* signal)
voidTQObject::Emit(const char* signal, Long_t* paramArr)
voidTQObject::Emit(const char* signal, const char* params)
voidTQObject::Emit(const char* signal, Double_t param)
voidTQObject::Emit(const char* signal, Long_t param)
voidTQObject::Emit(const char* signal, Long64_t param)
voidTQObject::Emit(const char* signal, Bool_t param)
voidTQObject::Emit(const char* signal, Char_t param)
voidTQObject::Emit(const char* signal, UChar_t param)
voidTQObject::Emit(const char* signal, Short_t param)
voidTQObject::Emit(const char* signal, UShort_t param)
voidTQObject::Emit(const char* signal, Int_t param)
voidTQObject::Emit(const char* signal, UInt_t param)
voidTQObject::Emit(const char* signal, ULong_t param)
voidTQObject::Emit(const char* signal, ULong64_t param)
voidTQObject::Emit(const char* signal, Float_t param)
voidTQObject::EmitVA(const char* signal, Int_t nargs)
voidTQObject::EmitVA(const char* signal, Int_t nargs, va_list va)
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
static Long_tExecuteFile(const char* file, Int_t* error = 0, Bool_t keep = kFALSE)
TApplication::EExitOnExceptionExitOnException(TApplication::EExitOnException opt = kExit)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual TApplicationImp*GetApplicationImp()
static TList*GetApplications()
TApplication*GetAppRemote() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
const char*GetIdleCommand() const
TList*TQObject::GetListOfClassSignals() const
TList*TQObject::GetListOfConnections() const
TList*TQObject::GetListOfSignals() const
virtual const char*TObject::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
virtual voidGetOptions(Int_t* argc, char** argv)
TSignalHandler*GetSignalHandler() const
virtual const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual voidHandleException(Int_t sig)
virtual voidHandleIdleTimer()SIGNAL
virtual Bool_tHandleTermInput()
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual Bool_tTQObject::HasConnection(const char* signal_name) const
virtual ULong_tTObject::Hash() const
virtual voidHide()
virtual voidTQObject::HighPriority(const char* signal_name, const char* slot_name = 0)
virtual voidIconify()
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidInit()
voidInitializeGraphics()
TObjArray*InputFiles() const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tIsCmdThread()
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
Bool_tIsRunning() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidKeyPressed(Int_t key)SIGNAL
virtual voidLineProcessed(const char* line)SIGNAL
static voidTQObject::LoadRQ_OBJECT()
virtual voidLower()
virtual voidTQObject::LowPriority(const char* signal_name, const char* slot_name = 0)
virtual voidls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTQObject::Message(const char* msg)SIGNAL
static voidNeedGraphicsLibs()
Bool_tNoLogoOpt() const
Bool_tNoLogOpt() const
virtual Bool_tTObject::Notify()
virtual Int_tTQObject::NumberOfConnections() const
virtual Int_tTQObject::NumberOfSignals() const
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
virtual voidOpen()
static voidTObject::operator delete(void* ptr)
static voidTObject::operator delete(void* ptr, void* vp)
static voidTObject::operator delete[](void* ptr)
static voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Long_tProcessFile(const char* file, Int_t* error = 0, Bool_t keep = kFALSE)
virtual Long_tProcessLine(const char* line, Bool_t sync = kFALSE, Int_t* error = 0)
Bool_tQuitOpt() const
virtual voidRaise()
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidRemoveIdleTimer()
voidTObject::ResetBit(UInt_t f)
Bool_tReturnFromRun() const
virtual voidReturnPressed(char* text)SIGNAL
virtual voidRun(Bool_t retrn = kFALSE)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
virtual voidSetEchoMode(Bool_t mode)
virtual voidSetIdleTimer(UInt_t idleTimeInSec, const char* command)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetReturnFromRun(Bool_t ret)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShow()
virtual voidShowMembers(TMemberInspector&)
virtual voidStartIdleing()
virtual voidStopIdleing()
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
virtual Int_tTabCompletionHook(char* buf, int* pLoc, ostream& out)
virtual voidTerminate(Int_t status = 0)SIGNAL
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
const char*WorkingDirectory() const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
protected:
TApplication()
static Int_tTQObject::CheckConnectArgs(TQObject* sender, TClass* sender_class, const char* signal, TClass* receiver_class, const char* slot)
static voidClose(TApplication* app)
static Bool_tTQObject::ConnectToClass(TQObject* sender, const char* signal, TClass* receiver_class, void* receiver, const char* slot)
static Bool_tTQObject::ConnectToClass(const char* sender_class, const char* signal, TClass* receiver_class, void* receiver, const char* slot)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
virtual void*TQObject::GetSender()
virtual const char*TQObject::GetSenderClassName() const
virtual voidHelp(const char* line)
virtual voidLoadGraphicsLibs()
virtual voidMakeBatch()
voidTObject::MakeZombie()
static TApplication*Open(const char* url, Int_t debug, const char* script)
static Int_tParseRemoteLine(const char* ln, TString& hostdir, TString& user, Int_t& dbg, TString& script)
virtual Long_tProcessRemote(const char* line, Int_t* error = 0)
voidSetSignalHandler(TSignalHandler* sh)

Data Members

public:
enum EStatusBits { kProcessRemotely
kDefaultApplication
};
enum EExitOnException { kDontExit
kExit
kAbort
};
enum TObject::EStatusBits { kCanDelete
kMustCleanup
kObjInCanvas
kIsReferenced
kHasUUID
kCannotPick
kNoContextMenu
kInvalidObject
};
enum TObject::[unnamed] { kIsOnHeap
kNotDeleted
kZombie
kBitMask
kSingleKey
kOverwrite
kWriteDelete
};
protected:
TApplication*fAppRemoteCurrent remote application, if defined
TList*TQObject::fListOfConnections! list of connections to this object
TList*TQObject::fListOfSignals! list of signals from this object
Bool_tTQObject::fSignalsBlocked! flag used for suppression of signals
static Bool_tTQObject::fgAllSignalsBlockedflag used for suppression of all signals
static TList*fgApplicationsList of available applications
private:
TApplicationImp*fAppImp!Window system specific application implementation
Int_tfArgcNumber of com mand line arguments
char**fArgvCommand line arguments
TApplication::EExitOnExceptionfExitOnExceptionExit on exception option
TObjArray*fFilesArray of input files (TObjString's) specified via argv
TStringfIdleCommandCommand to execute while application is idle
TTimer*fIdleTimerIdle timer
Bool_tfIsRunningTrue when in event loop (Run() has been called)
Bool_tfNoLogDo not process logon and logoff macros
Bool_tfNoLogoDo not show splash screen and welcome message
Bool_tfQuitExit after having processed input files
Bool_tfReturnFromRunWhen true return from Run()
TSignalHandler*fSigHandlerInterrupt handler
Bool_tfUseMemstatRun with TMemStat enabled
TStringfWorkDirWorking directory specified via argv
static Bool_tfgGraphInitTrue if graphics libs initialized
static Bool_tfgGraphNeededTrue if graphics libs need to be initialized

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TApplication()
 Default ctor. Can be used by classes deriving from TApplication.
TApplication(const char* appClassName, Int_t* argc, char** argv, void* options = 0, Int_t numOptions = 0)
 Create an application environment. The application environment
 provides an interface to the graphics system and eventloop
 (be it X, Windoze, MacOS or BeOS). After creating the application
 object start the eventloop by calling its Run() method. The command
 line options recogized by TApplication are described in the GetOptions()
 method. The recognized options are removed from the argument array.
 The original list of argument options can be retrieved via the Argc()
 and Argv() methods. The appClassName "proofserv" is reserved for the
 PROOF system. The "options" and "numOptions" arguments are not used,
 except if you want to by-pass the argv processing by GetOptions()
 in which case you should specify numOptions<0. All options will
 still be available via the Argv() method for later use.
~TApplication()
 TApplication dtor.
void NeedGraphicsLibs()
 Static method. This method should be called from static library
 initializers if the library needs the low level graphics system.
void InitializeGraphics()
 Initialize the graphics environment.
void ClearInputFiles()
 Clear list containing macro files passed as program arguments.
 This method is called from TRint::Run() to ensure that the macro
 files are only executed the first time Run() is called.
char * Argv(Int_t index) const
 Return specified argument.
void GetOptions(Int_t* argc, char** argv)
 Get and handle command line options. Arguments handled are removed
 from the argument array. The following arguments are handled:
    -b : run in batch mode without graphics
    -x : exit on exception
    -n : do not execute logon and logoff macros as specified in .rootrc
    -q : exit after processing command line macro files
    -l : do not show splash screen
 The last three options are only relevant in conjunction with TRint.
 The following help and info arguments are supported:
    -?       : print usage
    -h       : print usage
    --help   : print usage
    -config  : print ./configure options
    -memstat : run with memory usage monitoring
 In addition to the above options the arguments that are not options,
 i.e. they don't start with - or + are treated as follows (and also removed
 from the argument array):
   <dir>       is considered the desired working directory and available
               via WorkingDirectory(), if more than one dir is specified the
               first one will prevail
   <file>      if the file exists its added to the InputFiles() list
   <file>.root are considered ROOT files and added to the InputFiles() list,
               the file may be a remote file url
   <macro>.C   are considered ROOT macros and also added to the InputFiles() list
 In TRint we set the working directory to the <dir>, the ROOT files are
 connected, and the macros are executed. If your main TApplication is not
 TRint you have to decide yourself what to do whith these options.
 All specified arguments (also the ones removed) can always be retrieved
 via the TApplication::Argv() method.
void HandleIdleTimer()
 Handle idle timeout. When this timer expires the registered idle command
 will be executed by this routine and a signal will be emitted.
void HandleException(Int_t sig)
 Handle exceptions (kSigBus, kSigSegmentationViolation,
 kSigIllegalInstruction and kSigFloatingException) trapped in TSystem.
 Specific TApplication implementations may want something different here.
void Help(const char* line)
 Print help on interpreter.
void LoadGraphicsLibs()
 Load shared libs neccesary for graphics. These libraries are only
 loaded when gROOT->IsBatch() is kFALSE.
void MakeBatch()
 Switch to batch mode.
Int_t ParseRemoteLine(const char* ln, TString& hostdir, TString& user, Int_t& dbg, TString& script)
 Parse the content of a line starting with ".R" (already stripped-off)
 The format is
      [user@]host[:dir] [-l user] [-d dbg] [script]
 The variable 'dir' is the remote directory to be used as working dir.
 The username can be specified in two ways, "-l" having the priority
 (as in ssh).
 A 'dbg' value > 0 gives increasing verbosity.
 The last argument 'script' allows to specify an alternative script to
 be executed remotely to startup the session.
Long_t ProcessRemote(const char* line, Int_t* error = 0)
 Process the content of a line starting with ".R" (already stripped-off)
 The format is
      [user@]host[:dir] [-l user] [-d dbg] [script] | [host] -close
 The variable 'dir' is the remote directory to be used as working dir.
 The username can be specified in two ways, "-l" having the priority
 (as in ssh).
 A 'dbg' value > 0 gives increasing verbosity.
 The last argument 'script' allows to specify an alternative script to
 be executed remotely to startup the session.
Long_t ProcessLine(const char* line, Bool_t sync = kFALSE, Int_t* error = 0)
 Process a single command line, either a C++ statement or an interpreter
 command starting with a ".".
 Return the return value of the command casted to a long.
Long_t ProcessFile(const char* file, Int_t* error = 0, Bool_t keep = kFALSE)
 Process a file containing a C++ macro.
Long_t ExecuteFile(const char* file, Int_t* error = 0, Bool_t keep = kFALSE)
 Execute a file containing a C++ macro (static method). Can be used
 while TApplication is not yet created.
void Run(Bool_t retrn = kFALSE)
 Main application eventloop. Calls system dependent eventloop via gSystem.
void SetIdleTimer(UInt_t idleTimeInSec, const char* command)
 Set the command to be executed after the system has been idle for
 idleTimeInSec seconds. Normally called via TROOT::Idle(...).
void RemoveIdleTimer()
 Remove idle timer. Normally called via TROOT::Idle(0).
void StartIdleing()
 Called when system starts idleing.
void StopIdleing()
 Called when system stops idleing.
Int_t TabCompletionHook(char* buf, int* pLoc, ostream& out)
 What to do when tab is pressed. Re-implemented by TRint.
 See TTabCom::Hook() for meaning of return values.
void Terminate(Int_t status = 0)
 Terminate the application by call TSystem::Exit() unless application has
 been told to return from Run(), by a call to SetReturnFromRun().
void LineProcessed(const char* line)
 Emit signal when a line has been processed.
void KeyPressed(Int_t key)
 Emit signal when console keyboard key was pressed.
void ReturnPressed(char* text)
 Emit signal when return key was pressed.
void SetEchoMode(Bool_t mode)
 Set console echo mode:

  mode = kTRUE  - echo input symbols
  mode = kFALSE - noecho input symbols
void CreateApplication()
 Static function used to create a default application environment.
TApplication * Open(const char* url, Int_t debug, const char* script)
 Static function used to attach to an existing remote application
 or to start one.
void Close(TApplication* app)
 Static function used to close a remote application
void ls(Option_t* option = "") const
 Show available sessions
TList * GetApplications()
 Static method returning the list of available applications
TApplication(const TApplication& )
TApplication& operator=(const TApplication& )
void SetSignalHandler(TSignalHandler* sh)
{ fSigHandler = sh; }
TApplication * Open(const char* url, Int_t debug, const char* script)
TSignalHandler * GetSignalHandler() const
{ return fSigHandler; }
Bool_t HandleTermInput()
{ return kFALSE; }
void Init()
{ fAppImp->Init(); }
const char * GetIdleCommand() const
{ return fIdleCommand; }
const char * ApplicationName() const
{ return fAppImp->ApplicationName(); }
void Show()
{ fAppImp->Show(); }
void Hide()
{ fAppImp->Hide(); }
void Iconify()
void Raise()
{ fAppImp->Raise(); }
void Lower()
{ fAppImp->Lower(); }
Bool_t IsCmdThread()
{ return fAppImp ? fAppImp->IsCmdThread() : kTRUE; }
TApplicationImp * GetApplicationImp()
{ return fAppImp;}
Int_t Argc() const
{ return fArgc; }
char ** Argv() const
{ return fArgv; }
Bool_t NoLogOpt() const
{ return fNoLog; }
Bool_t NoLogoOpt() const
{ return fNoLogo; }
Bool_t QuitOpt() const
{ return fQuit; }
TObjArray * InputFiles() const
{ return fFiles; }
const char * WorkingDirectory() const
{ return fWorkDir; }
TApplication * GetAppRemote() const
{ return fAppRemote; }
Bool_t IsRunning() const
{ return fIsRunning; }
Bool_t ReturnFromRun() const
{ return fReturnFromRun; }
void SetReturnFromRun(Bool_t ret)
{ fReturnFromRun = ret; }