TMessageHandler


class description - source file - inheritance tree

class TMessageHandler : public TNamed


    public:
TMessageHandler TMessageHandler(TClass* cl, Bool_t derived = kTRUE) TMessageHandler TMessageHandler(const char* cl, Bool_t derived = kTRUE) TMessageHandler TMessageHandler(TMessageHandler&) virtual void ~TMessageHandler() virtual void Add() TClass* Class() virtual Int_t GetMessageCount(Int_t messId) const Int_t GetSize() const virtual Int_t GetTotalMessageCount() const Bool_t HandleDerived() const virtual void HandleMessage(Int_t id, TObject* obj) virtual TClass* IsA() const virtual Bool_t Notify() virtual void Print(Option_t* option) virtual void Remove() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b)

Data Members

protected:
TClass* fClass class for which message has to be handled TObject* fMessObj object generating message Int_t fMessId message id (often matching specific enum in fClass) Int_t fSize number of different messages handled Int_t* fCnts count per message Int_t* fMessIds message ids Bool_t fDerived if true handle messages also for derived classes

Class Description

                                                                      
 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                      
                                                                      


TMessageHandler(TClass *cl, Bool_t derived)
 Create a new message handler for class cl and add it to the list
 of message handlers.

TMessageHandler(const char *cl, Bool_t derived)
 Create a new message handler for class named cl and add it to the list
 of message handlers.

~TMessageHandler()
 Clean up the messagehandler.

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, 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)
 Print statistics for this message handler.

void Remove()
 Remove this message handler from the list of messages handlers.



Inline Functions


                  Int_t GetSize() const
                 Bool_t HandleDerived() const
                TClass* Class()
                TClass* IsA() const
                   void ShowMembers(TMemberInspector& insp, char* parent)
                   void Streamer(TBuffer& b)
        TMessageHandler TMessageHandler(TMessageHandler&)


Author: Rene Brun 11/11/99
Last update: 2.23/12 31/01/2000 18.39.10 by Fons Rademakers
Copyright (c) 1995-1999, The ROOT System, All rights reserved. *


ROOT page - Class index - Top of the page

This page has been automatically generated. If you have any comments or suggestions about the page layout send a mail to ROOT support, or contact the developers with any questions or problems regarding ROOT.