ROOT » CORE » BASE » TMessageHandler

class TMessageHandler: public TNamed, public TQObject


TMessageHandler

Handle messages that might be generated by the system.
By default a handler only keeps track of the different messages
generated for a specific class. By deriving from this class and
overriding Notify() one can implement custom message handling.
In Notify() one has access to the message id and the object
generating the message. One can install more than one message
handler per class. A message handler can be removed or again
added when needed.
All Root "Warnings"  are logged as message 1001
All Root "Errors"    are logged as message 1002
All Root "SysErrors" are logged as message 1003
All Root "Fatals"    are logged as message 1004


Function Members (Methods)

public:
virtual~TMessageHandler()
voidTObject::AbstractMethod(const char* method) const
virtual voidAdd()
virtual voidAdded()SIGNAL
virtual voidTObject::AppendPad(Option_t* option = "")
static Bool_tTQObject::AreAllSignalsBlocked()
Bool_tTQObject::AreSignalsBlocked() 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 voidTNamed::Clear(Option_t* option = "")
virtual TObject*TNamed::Clone(const char* newname = "") const
voidTQObject::CollectClassSignalLists(TList& list, TClass* cls)
virtual Int_tTNamed::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 voidTNamed::Copy(TObject& named) const
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, va_list va)
voidTQObject::EmitVA<>(const char* signal_name, Int_t)
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)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual voidTNamed::FillBuffer(char*& buffer)
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TList*TQObject::GetListOfClassSignals() const
TList*TQObject::GetListOfConnections() const
TList*TQObject::GetListOfSignals() const
virtual Int_tGetMessageCount(Int_t messId) const
virtual const char*TNamed::GetName() const
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
Int_tGetSize() const
virtual const char*TNamed::GetTitle() const
virtual Int_tGetTotalMessageCount() const
virtual UInt_tTObject::GetUniqueID() const
Bool_tHandleDerived() const
virtual voidHandleMessage(Int_t id, const TObject* obj)
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual Bool_tTQObject::HasConnection(const char* signal_name) const
virtual ULong_tTNamed::Hash() const
virtual voidTQObject::HighPriority(const char* signal_name, const char* slot_name = 0)
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 voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTNamed::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTQObject::LowPriority(const char* signal_name, const char* slot_name = 0)
virtual voidTNamed::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTQObject::Message(const char* msg)SIGNAL
virtual voidNotified()SIGNAL
virtual Bool_tNotify()
virtual Int_tTQObject::NumberOfConnections() const
virtual Int_tTQObject::NumberOfSignals() const
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
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)
TMessageHandler&operator=(const TMessageHandler&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidRemove()
virtual voidRemoved()SIGNAL
voidTObject::ResetBit(UInt_t f)
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 voidTNamed::SetName(const char* name)MENU
virtual voidTNamed::SetNameTitle(const char* name, const char* title)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTNamed::SetTitle(const char* title = "")MENU
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) const
virtual Int_tTNamed::Sizeof() const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TMessageHandler(const TMessageHandler&)
TMessageHandler(const TClass* cl, Bool_t derived = kTRUE)
TMessageHandler(const char* cl, Bool_t derived = kTRUE)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) 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:
static Int_tTQObject::CheckConnectArgs(TQObject* sender, TClass* sender_class, const char* signal, TClass* receiver_class, const char* slot)
static TStringTQObject::CompressName(const char* method_name)
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*GetSender()
virtual const char*TQObject::GetSenderClassName() const
voidTObject::MakeZombie()

Data Members

public:
static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TObject::EStatusBitsTObject::kHasUUID
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
const TClass*fClassclass for which message has to be handled
Int_t*fCntscount per message
Bool_tfDerivedif true handle messages also for derived classes
TList*TQObject::fListOfConnections! list of connections to this object
TList*TQObject::fListOfSignals! list of signals from this object
Int_tfMessIdmessage id (often matching specific enum in fClass)
Int_t*fMessIdsmessage ids
const TObject*fMessObjobject generating message
TStringTNamed::fNameobject identifier
Bool_tTQObject::fSignalsBlocked! flag used for suppression of signals
Int_tfSizenumber of different messages handled
TStringTNamed::fTitleobject title
static Bool_tTQObject::fgAllSignalsBlockedflag used for suppression of all signals

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TMessageHandler(const TClass* cl, Bool_t derived = kTRUE)
 Create a new message handler for class cl and add it to the list
 of message handlers.
TMessageHandler(const char* cl, Bool_t derived = kTRUE)
 Create a new message handler for class named cl and add it to the list
 of message handlers.
void Add()
 Add this message handler to the list of messages handlers.
Int_t GetMessageCount(Int_t messId) const
 Return counter for message with ID=messid.
Int_t GetTotalMessageCount() const
 Return total number of messages.
void HandleMessage(Int_t id, const TObject* obj)
 Store message origin, keep statistics and call Notify().
Bool_t Notify()
 This method must be overridden to handle object notifcation.
void Print(Option_t* option = "") const
 Print statistics for this message handler.
void Remove()
 Remove this message handler from the list of messages handlers.
void * GetSender()
{ return this; }
TMessageHandler(const TClass* cl, Bool_t derived = kTRUE)
virtual ~TMessageHandler()
Int_t GetSize() const
{ return fSize; }
Bool_t HandleDerived() const
{ return fDerived; }
void Added()
{ Emit("Added()"); }
void Removed()
{ Emit("Removed()"); }
void Notified()
{ Emit("Notified()"); }