Warning, file /include/root/TMonitor.h was not indexed
or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef ROOT_TMonitor
0013 #define ROOT_TMonitor
0014
0015
0016
0017
0018
0019
0020
0021
0022
0023
0024
0025
0026
0027
0028
0029 #include "TObject.h"
0030 #include "TQObject.h"
0031
0032 class TList;
0033 class TSocket;
0034
0035
0036 class TMonitor : public TObject, public TQObject {
0037
0038 friend class TSocketHandler;
0039 friend class TTimeOutTimer;
0040 friend class TXSlave;
0041 friend class TXSocket;
0042
0043 private:
0044 TList *fActive;
0045 TList *fDeActive;
0046 TSocket *fReady;
0047 Bool_t fMainLoop;
0048 Bool_t fInterrupt;
0049
0050 void SetReady(TSocket *sock);
0051 void *GetSender() override { return this; }
0052
0053 public:
0054 enum EInterest { kRead = 1, kWrite = 2 };
0055
0056 TMonitor(Bool_t mainloop = kTRUE);
0057 TMonitor(const TMonitor &m);
0058 virtual ~TMonitor();
0059
0060 virtual void Add(TSocket *sock, Int_t interest = kRead);
0061 virtual void SetInterest(TSocket *sock, Int_t interest = kRead);
0062 virtual void Remove(TSocket *sock);
0063 virtual void RemoveAll();
0064
0065 virtual void Activate(TSocket *sock);
0066 virtual void ActivateAll();
0067 virtual void DeActivate(TSocket *sock);
0068 virtual void DeActivateAll();
0069 virtual void Ready(TSocket *sock);
0070
0071 void Interrupt() { fInterrupt = kTRUE; }
0072 void ResetInterrupt() { fInterrupt = kFALSE; }
0073
0074 TSocket *Select();
0075 TSocket *Select(Long_t timeout);
0076 Int_t Select(TList *rdready, TList *wrready, Long_t timeout);
0077
0078 Int_t GetActive(Long_t timeout = -1) const;
0079 Int_t GetDeActive() const;
0080 TList *GetListOfActives() const;
0081 TList *GetListOfDeActives() const;
0082
0083 Bool_t IsActive(TSocket *s) const;
0084
0085 ClassDefOverride(TMonitor,0)
0086 };
0087
0088 #endif