TMessageHandler


class description - source file - inheritance tree

class TMessageHandler : public TNamed


    public:
TMessageHandler TMessageHandler(const TClass* cl, Bool_t derived = kTRUE) TMessageHandler TMessageHandler(const char* cl, Bool_t derived = kTRUE) TMessageHandler TMessageHandler(TMessageHandler&) virtual void ~TMessageHandler() virtual void Add() static 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, const TObject* obj) virtual TClass* IsA() const virtual Bool_t Notify() virtual void Print(Option_t* option) const virtual void Remove() virtual void ShowMembers(TMemberInspector& insp, char* parent) virtual void Streamer(TBuffer& b) void StreamerNVirtual(TBuffer& b)

Data Members

protected:
const TClass* fClass class for which message has to be handled const 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(const 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, 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.



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)
                   void StreamerNVirtual(TBuffer& b)
        TMessageHandler TMessageHandler(TMessageHandler&)


Author: Rene Brun 11/11/99
Last update: root/base:$Name: $:$Id: TMessageHandler.cxx,v 1.2 2000/12/13 15:13:45 brun Exp $
Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *


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.