ROOT » NET » NET » TMonitor

class TMonitor: public TObject, public TQObject


TMonitor

This class monitors activity on a number of network sockets.
The actual monitoring is done by TSystem::DispatchOneEvent().
Typical usage: create a TMonitor object. Register a number of
TSocket objects and call TMonitor::Select(). Select() returns the
socket object which has data waiting. TSocket objects can be added,
removed, (temporary) enabled or disabled.


Function Members (Methods)

public:
virtual~TMonitor()
voidTObject::AbstractMethod(const char* method) const
virtual voidActivate(TSocket* sock)
virtual voidActivateAll()
virtual voidAdd(TSocket* sock, Int_t interest = kRead)
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 voidTObject::Clear(Option_t* = "")
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
virtual voidDeActivate(TSocket* sock)
virtual voidDeActivateAll()
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 TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tGetActive(Long_t timeout = -1) const
Int_tGetDeActive() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
virtual const char*TObject::GetIconName() const
TList*GetListOfActives() const
TList*TQObject::GetListOfClassSignals() const
TList*TQObject::GetListOfConnections() const
TList*GetListOfDeActives() 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 const char*TObject::GetTitle() const
virtual UInt_tTObject::GetUniqueID() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual Bool_tTQObject::HasConnection(const char* signal_name) const
virtual ULong_tTObject::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
voidInterrupt()
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
Bool_tIsActive(TSocket* s) const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
virtual voidTQObject::LowPriority(const char* signal_name, const char* slot_name = 0)
virtual voidTObject::ls(Option_t* option = "") const
voidTObject::MayNotUse(const char* method) const
virtual voidTQObject::Message(const char* msg)SIGNAL
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
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)
TMonitor&operator=(const TMonitor&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidTObject::Print(Option_t* option = "") const
virtual Int_tTObject::Read(const char* name)
virtual voidReady(TSocket* sock)SIGNAL
virtual voidTObject::RecursiveRemove(TObject* obj)
virtual voidRemove(TSocket* sock)
virtual voidRemoveAll()
voidTObject::ResetBit(UInt_t f)
voidResetInterrupt()
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
TSocket*Select()
TSocket*Select(Long_t timeout)
Int_tSelect(TList* rdready, TList* wrready, Long_t timeout)
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 voidSetInterest(TSocket* sock, Int_t interest = kRead)
static voidTObject::SetObjectStat(Bool_t stat)
virtual voidTObject::SetUniqueID(UInt_t uid)
virtual voidShowMembers(TMemberInspector& insp) 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
TMonitor(Bool_t mainloop = kTRUE)
TMonitor(const TMonitor& m)
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 const char*TQObject::GetSenderClassName() const
voidTObject::MakeZombie()
private:
virtual void*GetSender()
voidSetReady(TSocket* sock)

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 TMonitor::EInterestkRead
static TObject::(anonymous)TObject::kSingleKey
static TMonitor::EInterestkWrite
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
protected:
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
private:
TList*fActivelist of sockets to monitor
TList*fDeActivelist of (temporary) disabled sockets
Bool_tfInterruptflags an interrupt to Select
Bool_tfMainLooptrue if monitoring sockets within the main event loop
TSocket*fReadysocket which is ready to be read or written

Class Charts

Inheritance Inherited Members Includes Libraries
Class Charts

Function documentation

TMonitor(Bool_t mainloop = kTRUE)
 Create a monitor object. If mainloop is true the monitoring will be
 done in the main event loop.
TMonitor(const TMonitor& m)
 Copy constructor
~TMonitor()
 Cleanup the monitor object. Does not delete sockets being monitored.
void Add(TSocket* sock, Int_t interest = kRead)
 Add socket to the monitor's active list. If interest=kRead then we
 want to monitor the socket for read readiness, if interest=kWrite
 then we monitor the socket for write readiness, if interest=kRead|kWrite
 then we monitor both read and write readiness.
void SetInterest(TSocket* sock, Int_t interest = kRead)
 Set interest mask for socket sock to interest. If the socket is not
 in the active list move it or add it there.
 If interest=kRead then we want to monitor the socket for read readiness,
 if interest=kWrite then we monitor the socket for write readiness,
 if interest=kRead|kWrite then we monitor both read and write readiness.
void Remove(TSocket* sock)
 Remove a socket from the monitor.
void RemoveAll()
 Remove all sockets from the monitor.
void Activate(TSocket* sock)
 Activate a de-activated socket.
void ActivateAll()
 Activate all de-activated sockets.
void DeActivate(TSocket* sock)
 De-activate a socket.
void DeActivateAll()
 De-activate all activated sockets.
TSocket * Select()
 Return pointer to socket for which an event is waiting.
 Select can be interrupt by a call to Interrupt() (e.g. connected with a
 Ctrl-C handler); a call to ResetInterrupt() before Select() is advisable
 in such a case.
 Return 0 in case of error.
TSocket * Select(Long_t timeout)
 Return pointer to socket for which an event is waiting.
 Wait a maximum of timeout milliseconds.
 If return is due to timeout it returns (TSocket *)-1.
 Select() can be interrupt by a call to Interrupt() (e.g. connected with a
 Ctrl-C handler); a call to ResetInterrupt() before Select() is advisable
 in such a case.
 Return 0 in case of any other error situation.
Int_t Select(TList* rdready, TList* wrready, Long_t timeout)
 Return numbers of sockets that are ready for reading or writing.
 Wait a maximum of timeout milliseconds.
 Return 0 if timed-out. Return < 0 in case of error.
 If rdready and/or wrready are not 0, the lists of sockets with
 something to read and/or write are also returned.
void SetReady(TSocket* sock)
 Called by TSocketHandler::Notify() to signal which socket is ready
 to be read or written. User should not call this routine. The ready
 socket will be returned via the Select() user function.
 The Ready(TSocket *sock) signal is emitted.
Int_t GetActive(Long_t timeout = -1) const
 Return number of sockets in the active list. If timeout > 0, remove from
 the list those sockets which did not have any activity since timeout
 millisecs. If timeout = 0, then reset activity timestamp on all active
 sockets. This time out is typically used if GetActive() is used to see
 how many remotes still need to send something. If they pass the timeout
 they will be skipped and GetActive() will return 0 and the loop can be
 exited.
Int_t GetDeActive() const
 Return number of sockets in the de-active list.
Bool_t IsActive(TSocket* s) const
 Check if socket 's' is in the active list. Avoids the duplication
 of active list via TMonitor::GetListOfActives().
TList * GetListOfActives() const
 Returns a list with all active sockets. This list must be deleted
 by the user. DO NOT call Delete() on this list as it will delete
 the sockets that are still being used by the monitor.
TList * GetListOfDeActives() const
 Returns a list with all de-active sockets. This list must be deleted
 by the user. DO NOT call Delete() on this list as it will delete
 the sockets that are still being used by the monitor.
void Ready(TSocket* sock)
 Emit signal when some socket is ready
void * GetSender()
{ return this; }
void Interrupt()
void ResetInterrupt()