FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
TCLIdleProcess.h
Go to the documentation of this file.
1 /*
2  This software is Copyright by the Board of Trustees of Michigan
3  State University (c) Copyright 2017.
4 
5  You may use this software under the terms of the GNU public license
6  (GPL). The terms of this license are described at:
7 
8  http://www.gnu.org/licenses/gpl.txt
9 
10  Authors:
11  Ron Fox
12  Giordano Cerriza
13  NSCL
14  Michigan State University
15  East Lansing, MI 48824-1321
16 */
17 
21 // TCLIdleProcess.h
22 //
23 // This file describes the CTCLIdleProcess class.
24 // Idle processes are used in the TCL/TK environment
25 // to describe operations which should be executed when
26 // the TCL/TK Event dispatch loop has nothing to do.
27 // NOTE:
28 // Since TCL/TK is unable to handle rescheduled Idle handlers,
29 // this is actually implemented as a timer with schedule time of 0ms.
30 //
31 //
32 // Author:
33 // Ron Fox
34 // NSCL
35 // Michigan State University
36 // East Lansing, MI 48824-1321
37 // mailto:fox@nscl.msu.edu
38 //
39 // Copyright 1999 NSCL, All Rights Reserved.
40 //
42 
43 #ifndef TCLIDLEPROCESS_H
44 #define TCLIDLEPROCESS_H
45 
46 #ifndef TCLTIMER_H // Required for derivation of current class.
47 #include "TCLTimer.h"
48 #endif
49 
50 #ifndef TCLPLUSTYPES_H
51 #include <libtclplusdatatypes.h>
52 #endif
53 
54 class CTCLIntpreter;
55 
56 // The class definition:
57 
58 
59 class CTCLIdleProcess : protected CTCLTimer
60 {
61 public:
62 
63  // Constructors:
64  //
66  CTCLTimer(pInterp->getInterpreter()) {}
67 
69  CTCLTimer(pInterp) {}
70 
71  virtual ~CTCLIdleProcess() {
72  // Timer destructor clears.
73  }
74 
75  // Copy Constructor [illegal]
76 private:
77  CTCLIdleProcess(const CTCLIdleProcess& rRhs);
78 public:
79 
80  // Assignment operator: [illegal]
81 private:
82  CTCLIdleProcess& operator=(const CTCLIdleProcess& rRhs);
83 public:
84 
85  // Equality operator:
86 
87  int operator==(const CTCLIdleProcess& rRhs) {
88  return CTCLInterpreterObject::operator==(rRhs);
89  }
90 
91  // Operations and overrides:
92 public:
93  void Set() { // Delegate set/clear to timer,
94  CTCLTimer::Set(); // Protected derivation makes
95  } // Set(time) invisible.
96  void Clear() {
97  CTCLTimer::Clear();
98  }
99  virtual void operator()() = 0; // Derive and supply for idle callback.
100 };
101 
102 
103 #endif
Definition: TCLTimer.h:48
Definition: TCLInterpreterObject.h:46
Definition: TCLInterpreter.h:59
Definition: TCLIdleProcess.h:59