// @(#)root/net:$Id$
// Author: Fons Rademakers   09/01/97

/*************************************************************************
 * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
 * All rights reserved.                                                  *
 *                                                                       *
 * For the licensing terms see $ROOTSYS/LICENSE.                         *
 * For the list of contributors see $ROOTSYS/README/CREDITS.             *
 *************************************************************************/

//////////////////////////////////////////////////////////////////////////
//                                                                      //
// 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.                            //
//                                                                      //
//////////////////////////////////////////////////////////////////////////

#include "TMonitor.h"
#include "TSocket.h"
#include "TList.h"
#include "TSystem.h"
#include "TSysEvtHandler.h"
#include "TTimer.h"
#include "TError.h"


//---- Socket event handler ----------------------------------------------------
//
// This utility class is only used by TMonitor.
//

class TSocketHandler : public TFileHandler {
private:
   TMonitor  *fMonitor;   //monitor to which this handler belongs
   TSocket   *fSocket;    //socket being handled

public:
   TSocketHandler(TMonitor *m, TSocket *s, Int_t interest, Bool_t mainloop = kTRUE);
   Bool_t   Notify();
   Bool_t   ReadNotify() { return Notify(); }
   Bool_t   WriteNotify() { return Notify(); }
   TSocket *GetSocket() const { return fSocket; }
};

TSocketHandler::TSocketHandler(TMonitor *m, TSocket *s,
                               Int_t interest, Bool_t mainloop)
               : TFileHandler(s->GetDescriptor(), interest)
{
   //constructor
   fMonitor = m;
   fSocket  = s;

   if (mainloop)
      Add();
}

Bool_t TSocketHandler::Notify()
{
   //notifier
   fMonitor->SetReady(fSocket);
   return kTRUE;
}

//---- Timeout timer -----------------------------------------------------------
//
// This utility class is only used via TMonitor::Select(Int_t timeout)
//

class TTimeOutTimer : public TTimer {
private:
   TMonitor   *fMonitor;   //monitor to which this timer belongs

public:
   TTimeOutTimer(TMonitor *m, Long_t ms);
   Bool_t  Notify();
};

TTimeOutTimer::TTimeOutTimer(TMonitor *m, Long_t ms)
              : TTimer(ms, kTRUE)
{
   //constructor
   fMonitor = m;
   gSystem->AddTimer(this);
}

Bool_t TTimeOutTimer::Notify()
{
   //notifier
   fMonitor->SetReady((TSocket *)-1);
   Remove();       // one shot only
   return kTRUE;
}
//------------------------------------------------------------------------------


ClassImp(TMonitor)

//______________________________________________________________________________
TMonitor::TMonitor(Bool_t mainloop) : TObject() , TQObject()
{
   // Create a monitor object. If mainloop is true the monitoring will be
   // done in the main event loop.

   R__ASSERT(gSystem);

   fActive    = new TList;
   fDeActive  = new TList;
   fMainLoop  = mainloop;
   fInterrupt = kFALSE;
   fReady     = 0;
}

//______________________________________________________________________________
TMonitor::TMonitor(const TMonitor &m) : TObject() , TQObject()
{
   // Copy constructor

   TSocketHandler *sh = 0;
   // Active list
   fActive   = new TList;
   TIter nxa(m.fActive);
   while ((sh = (TSocketHandler *)nxa())) {
      Int_t mask = 0;
      if (sh->HasReadInterest()) mask |= 0x1;
      if (sh->HasWriteInterest()) mask |= 0x2;
      fActive->Add(new TSocketHandler(this, sh->GetSocket(), mask, m.fMainLoop));
   }
   // Deactive list
   fDeActive = new TList;
   TIter nxd(m.fDeActive);
   while ((sh = (TSocketHandler *)nxd())) {
      Int_t mask = 0;
      if (sh->HasReadInterest()) mask |= 0x1;
      if (sh->HasWriteInterest()) mask |= 0x2;
      fDeActive->Add(new TSocketHandler(this, sh->GetSocket(), mask, m.fMainLoop));
   }
   // Other members
   fMainLoop = m.fMainLoop;
   fInterrupt = m.fInterrupt;
   fReady = 0;
}

//______________________________________________________________________________
TMonitor::~TMonitor()
{
   // Cleanup the monitor object. Does not delete sockets being monitored.

   fActive->Delete();
   SafeDelete(fActive);

   fDeActive->Delete();
   SafeDelete(fDeActive);
}

//______________________________________________________________________________
void TMonitor::Add(TSocket *sock, Int_t interest)
{
   // 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.

   fActive->Add(new TSocketHandler(this, sock, interest, fMainLoop));
}

//______________________________________________________________________________
void TMonitor::SetInterest(TSocket *sock, Int_t interest)
{
   // 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.

   TSocketHandler *s = 0;

   if (!interest)
      interest = kRead;

   // Check first the activated list ...
   TIter next(fActive);
   while ((s = (TSocketHandler *) next())) {
      if (sock == s->GetSocket()) {
         s->SetInterest(interest);
         return;
      }
   }

   // Check now the deactivated list ...
   TIter next1(fDeActive);
   while ((s = (TSocketHandler *) next1())) {
      if (sock == s->GetSocket()) {
         fDeActive->Remove(s);
         fActive->Add(s);
         s->SetInterest(interest);
         return;
      }
   }

   // The socket is not in our lists: just add it
   fActive->Add(new TSocketHandler(this, sock, interest, fMainLoop));
}

//______________________________________________________________________________
void TMonitor::Remove(TSocket *sock)
{
   // Remove a socket from the monitor.

   TIter next(fActive);
   TSocketHandler *s;

   while ((s = (TSocketHandler *) next())) {
      if (sock == s->GetSocket()) {
         fActive->Remove(s);
         delete s;
         return;
      }
   }

   TIter next1(fDeActive);

   while ((s = (TSocketHandler *) next1())) {
      if (sock == s->GetSocket()) {
         fDeActive->Remove(s);
         delete s;
         return;
      }
   }
}

//______________________________________________________________________________
void TMonitor::RemoveAll()
{
   // Remove all sockets from the monitor.

   fActive->Delete();
   fDeActive->Delete();
}

//______________________________________________________________________________
void TMonitor::Activate(TSocket *sock)
{
   // Activate a de-activated socket.

   TIter next(fDeActive);
   TSocketHandler *s;

   while ((s = (TSocketHandler *) next())) {
      if (sock == s->GetSocket()) {
         fDeActive->Remove(s);
         fActive->Add(s);
         s->Add();
         return;
      }
   }
}

//______________________________________________________________________________
void TMonitor::ActivateAll()
{
   // Activate all de-activated sockets.

   TIter next(fDeActive);
   TSocketHandler *s;

   while ((s = (TSocketHandler *) next())) {
      fActive->Add(s);
      s->Add();
   }
   fDeActive->Clear();
   fInterrupt = kFALSE;
}

//______________________________________________________________________________
void TMonitor::DeActivate(TSocket *sock)
{
   // De-activate a socket.

   TIter next(fActive);
   TSocketHandler *s;

   while ((s = (TSocketHandler *) next())) {
      if (sock == s->GetSocket()) {
         fActive->Remove(s);
         fDeActive->Add(s);
         s->Remove();
         return;
      }
   }
}

//______________________________________________________________________________
void TMonitor::DeActivateAll()
{
   // De-activate all activated sockets.

   TIter next(fActive);
   TSocketHandler *s;

   while ((s = (TSocketHandler *) next())) {
      fDeActive->Add(s);
      s->Remove();
   }
   fActive->Clear();
   fInterrupt = kFALSE;
}

//______________________________________________________________________________
TSocket *TMonitor::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.

   fReady = 0;

   while (!fReady && !fInterrupt)
      gSystem->InnerLoop();

   // Notify interrupts
   if (fInterrupt) {
      fInterrupt = kFALSE;
      fReady = 0;
      Info("Select","*** interrupt occured ***");
   }

   return fReady;
}

//______________________________________________________________________________
TSocket *TMonitor::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.

   if (timeout < 0)
      return TMonitor::Select();

   fReady = 0;

   TTimeOutTimer t(this, timeout);

   while (!fReady && !fInterrupt)
      gSystem->InnerLoop();

   // Notify interrupts
   if (fInterrupt) {
      fInterrupt = kFALSE;
      fReady = 0;
      Info("Select","*** interrupt occured ***");
   }

   return fReady;
}

//______________________________________________________________________________
Int_t TMonitor::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.

   Int_t nr = -2;

   TSocketHandler *h = 0;
   Int_t ns = fActive->GetSize();
   if (ns == 1) {
      // Avoid additional loops inside
      h = (TSocketHandler *)fActive->First();
      nr = gSystem->Select((TFileHandler *)h, timeout);
   } else if (ns > 1) {
      nr = gSystem->Select(fActive, timeout);
   }

   if (nr > 0 && (rdready || wrready)) {
      // Clear the lists
      if (rdready)
         rdready->Clear();
      if (wrready)
         wrready->Clear();
      // Got a file descriptor
      if (!h) {
         TIter next(fActive);
         while ((h = (TSocketHandler *)next())) {
            if (rdready && h->IsReadReady())
               rdready->Add(h->GetSocket());
            if (wrready && h->IsWriteReady())
               wrready->Add(h->GetSocket());
         }
      } else {
         if (rdready && h->IsReadReady())
            rdready->Add(h->GetSocket());
         if (wrready && h->IsWriteReady())
            wrready->Add(h->GetSocket());
      }
   }

   return nr;
}

//______________________________________________________________________________
void TMonitor::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.

   fReady = sock;
   Ready(fReady);
}

//______________________________________________________________________________
Int_t TMonitor::GetActive(Long_t timeout) 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.

   if (timeout >= 0) {
      TIter next(fActive);
      TSocketHandler *s;
      if (timeout > 0) {
         TTimeStamp now;
         while ((s = (TSocketHandler *) next())) {
            TSocket *xs = s->GetSocket();
            TTimeStamp ts = xs->GetLastUsage();
            Long_t dt = (Long_t)(now.GetSec() - ts.GetSec()) * 1000 +
                        (Long_t)(now.GetNanoSec() - ts.GetNanoSec()) / 1000000 ;
            if (dt > timeout) {
               Info("GetActive", "socket: %p: %s:%d did not show any activity"
                                 " during the last %ld millisecs: deactivating",
                                 xs, xs->GetInetAddress().GetHostName(),
                                 xs->GetInetAddress().GetPort(), timeout);
               fActive->Remove(s);
               fDeActive->Add(s);
               s->Remove();
            }
         }
      } else if (timeout == 0) {
         // Reset time stamps
         while ((s = (TSocketHandler *) next())) {
            s->GetSocket()->Touch();
         }
      }
   }
   return fActive->GetSize();
}

//______________________________________________________________________________
Int_t TMonitor::GetDeActive() const
{
   // Return number of sockets in the de-active list.

   return fDeActive->GetSize();
}

//______________________________________________________________________________
Bool_t TMonitor::IsActive(TSocket *sock) const
{
   // Check if socket 's' is in the active list. Avoids the duplication
   // of active list via TMonitor::GetListOfActives().

   TIter next(fActive);
   while (TSocketHandler *h = (TSocketHandler*) next())
      if (sock == h->GetSocket())
         return kTRUE;

   // Not found
   return kFALSE;
}

//______________________________________________________________________________
TList *TMonitor::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 *list = new TList;

   TIter next(fActive);

   while (TSocketHandler *h = (TSocketHandler*) next())
      list->Add(h->GetSocket());

   return list;
}

//______________________________________________________________________________
TList *TMonitor::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.

   TList *list = new TList;

   TIter next(fDeActive);

   while (TSocketHandler *h = (TSocketHandler*) next())
      list->Add(h->GetSocket());

   return list;
}

//______________________________________________________________________________
void TMonitor::Ready(TSocket *sock)
{
   // Emit signal when some socket is ready

   Emit("Ready(TSocket*)", (Long_t)sock);
}
 TMonitor.cxx:1
 TMonitor.cxx:2
 TMonitor.cxx:3
 TMonitor.cxx:4
 TMonitor.cxx:5
 TMonitor.cxx:6
 TMonitor.cxx:7
 TMonitor.cxx:8
 TMonitor.cxx:9
 TMonitor.cxx:10
 TMonitor.cxx:11
 TMonitor.cxx:12
 TMonitor.cxx:13
 TMonitor.cxx:14
 TMonitor.cxx:15
 TMonitor.cxx:16
 TMonitor.cxx:17
 TMonitor.cxx:18
 TMonitor.cxx:19
 TMonitor.cxx:20
 TMonitor.cxx:21
 TMonitor.cxx:22
 TMonitor.cxx:23
 TMonitor.cxx:24
 TMonitor.cxx:25
 TMonitor.cxx:26
 TMonitor.cxx:27
 TMonitor.cxx:28
 TMonitor.cxx:29
 TMonitor.cxx:30
 TMonitor.cxx:31
 TMonitor.cxx:32
 TMonitor.cxx:33
 TMonitor.cxx:34
 TMonitor.cxx:35
 TMonitor.cxx:36
 TMonitor.cxx:37
 TMonitor.cxx:38
 TMonitor.cxx:39
 TMonitor.cxx:40
 TMonitor.cxx:41
 TMonitor.cxx:42
 TMonitor.cxx:43
 TMonitor.cxx:44
 TMonitor.cxx:45
 TMonitor.cxx:46
 TMonitor.cxx:47
 TMonitor.cxx:48
 TMonitor.cxx:49
 TMonitor.cxx:50
 TMonitor.cxx:51
 TMonitor.cxx:52
 TMonitor.cxx:53
 TMonitor.cxx:54
 TMonitor.cxx:55
 TMonitor.cxx:56
 TMonitor.cxx:57
 TMonitor.cxx:58
 TMonitor.cxx:59
 TMonitor.cxx:60
 TMonitor.cxx:61
 TMonitor.cxx:62
 TMonitor.cxx:63
 TMonitor.cxx:64
 TMonitor.cxx:65
 TMonitor.cxx:66
 TMonitor.cxx:67
 TMonitor.cxx:68
 TMonitor.cxx:69
 TMonitor.cxx:70
 TMonitor.cxx:71
 TMonitor.cxx:72
 TMonitor.cxx:73
 TMonitor.cxx:74
 TMonitor.cxx:75
 TMonitor.cxx:76
 TMonitor.cxx:77
 TMonitor.cxx:78
 TMonitor.cxx:79
 TMonitor.cxx:80
 TMonitor.cxx:81
 TMonitor.cxx:82
 TMonitor.cxx:83
 TMonitor.cxx:84
 TMonitor.cxx:85
 TMonitor.cxx:86
 TMonitor.cxx:87
 TMonitor.cxx:88
 TMonitor.cxx:89
 TMonitor.cxx:90
 TMonitor.cxx:91
 TMonitor.cxx:92
 TMonitor.cxx:93
 TMonitor.cxx:94
 TMonitor.cxx:95
 TMonitor.cxx:96
 TMonitor.cxx:97
 TMonitor.cxx:98
 TMonitor.cxx:99
 TMonitor.cxx:100
 TMonitor.cxx:101
 TMonitor.cxx:102
 TMonitor.cxx:103
 TMonitor.cxx:104
 TMonitor.cxx:105
 TMonitor.cxx:106
 TMonitor.cxx:107
 TMonitor.cxx:108
 TMonitor.cxx:109
 TMonitor.cxx:110
 TMonitor.cxx:111
 TMonitor.cxx:112
 TMonitor.cxx:113
 TMonitor.cxx:114
 TMonitor.cxx:115
 TMonitor.cxx:116
 TMonitor.cxx:117
 TMonitor.cxx:118
 TMonitor.cxx:119
 TMonitor.cxx:120
 TMonitor.cxx:121
 TMonitor.cxx:122
 TMonitor.cxx:123
 TMonitor.cxx:124
 TMonitor.cxx:125
 TMonitor.cxx:126
 TMonitor.cxx:127
 TMonitor.cxx:128
 TMonitor.cxx:129
 TMonitor.cxx:130
 TMonitor.cxx:131
 TMonitor.cxx:132
 TMonitor.cxx:133
 TMonitor.cxx:134
 TMonitor.cxx:135
 TMonitor.cxx:136
 TMonitor.cxx:137
 TMonitor.cxx:138
 TMonitor.cxx:139
 TMonitor.cxx:140
 TMonitor.cxx:141
 TMonitor.cxx:142
 TMonitor.cxx:143
 TMonitor.cxx:144
 TMonitor.cxx:145
 TMonitor.cxx:146
 TMonitor.cxx:147
 TMonitor.cxx:148
 TMonitor.cxx:149
 TMonitor.cxx:150
 TMonitor.cxx:151
 TMonitor.cxx:152
 TMonitor.cxx:153
 TMonitor.cxx:154
 TMonitor.cxx:155
 TMonitor.cxx:156
 TMonitor.cxx:157
 TMonitor.cxx:158
 TMonitor.cxx:159
 TMonitor.cxx:160
 TMonitor.cxx:161
 TMonitor.cxx:162
 TMonitor.cxx:163
 TMonitor.cxx:164
 TMonitor.cxx:165
 TMonitor.cxx:166
 TMonitor.cxx:167
 TMonitor.cxx:168
 TMonitor.cxx:169
 TMonitor.cxx:170
 TMonitor.cxx:171
 TMonitor.cxx:172
 TMonitor.cxx:173
 TMonitor.cxx:174
 TMonitor.cxx:175
 TMonitor.cxx:176
 TMonitor.cxx:177
 TMonitor.cxx:178
 TMonitor.cxx:179
 TMonitor.cxx:180
 TMonitor.cxx:181
 TMonitor.cxx:182
 TMonitor.cxx:183
 TMonitor.cxx:184
 TMonitor.cxx:185
 TMonitor.cxx:186
 TMonitor.cxx:187
 TMonitor.cxx:188
 TMonitor.cxx:189
 TMonitor.cxx:190
 TMonitor.cxx:191
 TMonitor.cxx:192
 TMonitor.cxx:193
 TMonitor.cxx:194
 TMonitor.cxx:195
 TMonitor.cxx:196
 TMonitor.cxx:197
 TMonitor.cxx:198
 TMonitor.cxx:199
 TMonitor.cxx:200
 TMonitor.cxx:201
 TMonitor.cxx:202
 TMonitor.cxx:203
 TMonitor.cxx:204
 TMonitor.cxx:205
 TMonitor.cxx:206
 TMonitor.cxx:207
 TMonitor.cxx:208
 TMonitor.cxx:209
 TMonitor.cxx:210
 TMonitor.cxx:211
 TMonitor.cxx:212
 TMonitor.cxx:213
 TMonitor.cxx:214
 TMonitor.cxx:215
 TMonitor.cxx:216
 TMonitor.cxx:217
 TMonitor.cxx:218
 TMonitor.cxx:219
 TMonitor.cxx:220
 TMonitor.cxx:221
 TMonitor.cxx:222
 TMonitor.cxx:223
 TMonitor.cxx:224
 TMonitor.cxx:225
 TMonitor.cxx:226
 TMonitor.cxx:227
 TMonitor.cxx:228
 TMonitor.cxx:229
 TMonitor.cxx:230
 TMonitor.cxx:231
 TMonitor.cxx:232
 TMonitor.cxx:233
 TMonitor.cxx:234
 TMonitor.cxx:235
 TMonitor.cxx:236
 TMonitor.cxx:237
 TMonitor.cxx:238
 TMonitor.cxx:239
 TMonitor.cxx:240
 TMonitor.cxx:241
 TMonitor.cxx:242
 TMonitor.cxx:243
 TMonitor.cxx:244
 TMonitor.cxx:245
 TMonitor.cxx:246
 TMonitor.cxx:247
 TMonitor.cxx:248
 TMonitor.cxx:249
 TMonitor.cxx:250
 TMonitor.cxx:251
 TMonitor.cxx:252
 TMonitor.cxx:253
 TMonitor.cxx:254
 TMonitor.cxx:255
 TMonitor.cxx:256
 TMonitor.cxx:257
 TMonitor.cxx:258
 TMonitor.cxx:259
 TMonitor.cxx:260
 TMonitor.cxx:261
 TMonitor.cxx:262
 TMonitor.cxx:263
 TMonitor.cxx:264
 TMonitor.cxx:265
 TMonitor.cxx:266
 TMonitor.cxx:267
 TMonitor.cxx:268
 TMonitor.cxx:269
 TMonitor.cxx:270
 TMonitor.cxx:271
 TMonitor.cxx:272
 TMonitor.cxx:273
 TMonitor.cxx:274
 TMonitor.cxx:275
 TMonitor.cxx:276
 TMonitor.cxx:277
 TMonitor.cxx:278
 TMonitor.cxx:279
 TMonitor.cxx:280
 TMonitor.cxx:281
 TMonitor.cxx:282
 TMonitor.cxx:283
 TMonitor.cxx:284
 TMonitor.cxx:285
 TMonitor.cxx:286
 TMonitor.cxx:287
 TMonitor.cxx:288
 TMonitor.cxx:289
 TMonitor.cxx:290
 TMonitor.cxx:291
 TMonitor.cxx:292
 TMonitor.cxx:293
 TMonitor.cxx:294
 TMonitor.cxx:295
 TMonitor.cxx:296
 TMonitor.cxx:297
 TMonitor.cxx:298
 TMonitor.cxx:299
 TMonitor.cxx:300
 TMonitor.cxx:301
 TMonitor.cxx:302
 TMonitor.cxx:303
 TMonitor.cxx:304
 TMonitor.cxx:305
 TMonitor.cxx:306
 TMonitor.cxx:307
 TMonitor.cxx:308
 TMonitor.cxx:309
 TMonitor.cxx:310
 TMonitor.cxx:311
 TMonitor.cxx:312
 TMonitor.cxx:313
 TMonitor.cxx:314
 TMonitor.cxx:315
 TMonitor.cxx:316
 TMonitor.cxx:317
 TMonitor.cxx:318
 TMonitor.cxx:319
 TMonitor.cxx:320
 TMonitor.cxx:321
 TMonitor.cxx:322
 TMonitor.cxx:323
 TMonitor.cxx:324
 TMonitor.cxx:325
 TMonitor.cxx:326
 TMonitor.cxx:327
 TMonitor.cxx:328
 TMonitor.cxx:329
 TMonitor.cxx:330
 TMonitor.cxx:331
 TMonitor.cxx:332
 TMonitor.cxx:333
 TMonitor.cxx:334
 TMonitor.cxx:335
 TMonitor.cxx:336
 TMonitor.cxx:337
 TMonitor.cxx:338
 TMonitor.cxx:339
 TMonitor.cxx:340
 TMonitor.cxx:341
 TMonitor.cxx:342
 TMonitor.cxx:343
 TMonitor.cxx:344
 TMonitor.cxx:345
 TMonitor.cxx:346
 TMonitor.cxx:347
 TMonitor.cxx:348
 TMonitor.cxx:349
 TMonitor.cxx:350
 TMonitor.cxx:351
 TMonitor.cxx:352
 TMonitor.cxx:353
 TMonitor.cxx:354
 TMonitor.cxx:355
 TMonitor.cxx:356
 TMonitor.cxx:357
 TMonitor.cxx:358
 TMonitor.cxx:359
 TMonitor.cxx:360
 TMonitor.cxx:361
 TMonitor.cxx:362
 TMonitor.cxx:363
 TMonitor.cxx:364
 TMonitor.cxx:365
 TMonitor.cxx:366
 TMonitor.cxx:367
 TMonitor.cxx:368
 TMonitor.cxx:369
 TMonitor.cxx:370
 TMonitor.cxx:371
 TMonitor.cxx:372
 TMonitor.cxx:373
 TMonitor.cxx:374
 TMonitor.cxx:375
 TMonitor.cxx:376
 TMonitor.cxx:377
 TMonitor.cxx:378
 TMonitor.cxx:379
 TMonitor.cxx:380
 TMonitor.cxx:381
 TMonitor.cxx:382
 TMonitor.cxx:383
 TMonitor.cxx:384
 TMonitor.cxx:385
 TMonitor.cxx:386
 TMonitor.cxx:387
 TMonitor.cxx:388
 TMonitor.cxx:389
 TMonitor.cxx:390
 TMonitor.cxx:391
 TMonitor.cxx:392
 TMonitor.cxx:393
 TMonitor.cxx:394
 TMonitor.cxx:395
 TMonitor.cxx:396
 TMonitor.cxx:397
 TMonitor.cxx:398
 TMonitor.cxx:399
 TMonitor.cxx:400
 TMonitor.cxx:401
 TMonitor.cxx:402
 TMonitor.cxx:403
 TMonitor.cxx:404
 TMonitor.cxx:405
 TMonitor.cxx:406
 TMonitor.cxx:407
 TMonitor.cxx:408
 TMonitor.cxx:409
 TMonitor.cxx:410
 TMonitor.cxx:411
 TMonitor.cxx:412
 TMonitor.cxx:413
 TMonitor.cxx:414
 TMonitor.cxx:415
 TMonitor.cxx:416
 TMonitor.cxx:417
 TMonitor.cxx:418
 TMonitor.cxx:419
 TMonitor.cxx:420
 TMonitor.cxx:421
 TMonitor.cxx:422
 TMonitor.cxx:423
 TMonitor.cxx:424
 TMonitor.cxx:425
 TMonitor.cxx:426
 TMonitor.cxx:427
 TMonitor.cxx:428
 TMonitor.cxx:429
 TMonitor.cxx:430
 TMonitor.cxx:431
 TMonitor.cxx:432
 TMonitor.cxx:433
 TMonitor.cxx:434
 TMonitor.cxx:435
 TMonitor.cxx:436
 TMonitor.cxx:437
 TMonitor.cxx:438
 TMonitor.cxx:439
 TMonitor.cxx:440
 TMonitor.cxx:441
 TMonitor.cxx:442
 TMonitor.cxx:443
 TMonitor.cxx:444
 TMonitor.cxx:445
 TMonitor.cxx:446
 TMonitor.cxx:447
 TMonitor.cxx:448
 TMonitor.cxx:449
 TMonitor.cxx:450
 TMonitor.cxx:451
 TMonitor.cxx:452
 TMonitor.cxx:453
 TMonitor.cxx:454
 TMonitor.cxx:455
 TMonitor.cxx:456
 TMonitor.cxx:457
 TMonitor.cxx:458
 TMonitor.cxx:459
 TMonitor.cxx:460
 TMonitor.cxx:461
 TMonitor.cxx:462
 TMonitor.cxx:463
 TMonitor.cxx:464
 TMonitor.cxx:465
 TMonitor.cxx:466
 TMonitor.cxx:467
 TMonitor.cxx:468
 TMonitor.cxx:469
 TMonitor.cxx:470
 TMonitor.cxx:471
 TMonitor.cxx:472
 TMonitor.cxx:473
 TMonitor.cxx:474
 TMonitor.cxx:475
 TMonitor.cxx:476
 TMonitor.cxx:477
 TMonitor.cxx:478
 TMonitor.cxx:479
 TMonitor.cxx:480
 TMonitor.cxx:481
 TMonitor.cxx:482
 TMonitor.cxx:483
 TMonitor.cxx:484
 TMonitor.cxx:485
 TMonitor.cxx:486
 TMonitor.cxx:487
 TMonitor.cxx:488
 TMonitor.cxx:489
 TMonitor.cxx:490
 TMonitor.cxx:491
 TMonitor.cxx:492
 TMonitor.cxx:493
 TMonitor.cxx:494
 TMonitor.cxx:495
 TMonitor.cxx:496
 TMonitor.cxx:497
 TMonitor.cxx:498
 TMonitor.cxx:499
 TMonitor.cxx:500
 TMonitor.cxx:501
 TMonitor.cxx:502
 TMonitor.cxx:503
 TMonitor.cxx:504
 TMonitor.cxx:505
 TMonitor.cxx:506
 TMonitor.cxx:507
 TMonitor.cxx:508
 TMonitor.cxx:509
 TMonitor.cxx:510
 TMonitor.cxx:511
 TMonitor.cxx:512
 TMonitor.cxx:513
 TMonitor.cxx:514
 TMonitor.cxx:515
 TMonitor.cxx:516
 TMonitor.cxx:517
 TMonitor.cxx:518
 TMonitor.cxx:519
 TMonitor.cxx:520
 TMonitor.cxx:521
 TMonitor.cxx:522
 TMonitor.cxx:523
 TMonitor.cxx:524
 TMonitor.cxx:525
 TMonitor.cxx:526
 TMonitor.cxx:527
 TMonitor.cxx:528
 TMonitor.cxx:529
 TMonitor.cxx:530
 TMonitor.cxx:531
 TMonitor.cxx:532
 TMonitor.cxx:533