FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
TCLLiveEventLoop.h
1 #ifndef TCLLIVEEVENTLOOP_H
2 #define TCLLIVEEVENTLOOP_H
3 /*
4  This software is Copyright by the Board of Trustees of Michigan
5  State University (c) Copyright 2005.
6 
7  You may use this software under the terms of the GNU public license
8  (GPL). The terms of this license are described at:
9 
10  http://www.gnu.org/licenses/gpl.txt
11 
12  Author:
13  Ron Fox
14  NSCL
15  Michigan State University
16  East Lansing, MI 48824-1321
17 */
18 // Includes
19 
20 
21 #include <string>
22 
23 
24 
25 // Forward definitions:
26 
27 class CTCLInterpreter;
28 class CTCLVariable;
29 class CTCLStdioCommander;
30 
31 
56  // private data:
57 private:
58 
59  static CTCLLiveEventLoop* m_pTheInstance;
60  CTCLInterpreter* m_pStdinTarget;
61  bool m_isRunning;
62  long m_stopLatency;
63  CTCLStdioCommander* m_pEventCommander;
64 
65  // constructors are private to support singleton enforcement:
66 
67 private:
70 
71  // Cut off other attempts to create copies of the event loop object:
72 
74  CTCLLiveEventLoop& operator=(const CTCLLiveEventLoop&);
75  int operator==(const CTCLLiveEventLoop&) const;
76  int operator!=(const CTCLLiveEventLoop&) const;
77 
78  // Obtaining the singleton:
79 
80 public:
82 
83  // Operators on the object:
84 
85  void start(); // Event loop targeting gpApplication's interpreter.
86  void start(CTCLInterpreter* pInterp); // Event loop targeting some other interp.
87  void stop();
88 
89  long setStopLatency(long ms);
90  long getStopLatency() const;
91 
92  // Utilities:
93 
94 private:
95 
96  void eventLoop(); // The event loop itself.
97  void stopEvents();
98 
99 };
100 
101 
102 #endif
Definition: CTCLStdioCommander.h:40
static CTCLLiveEventLoop * getInstance()
Definition: TCLLiveEventLoop.cpp:56
Definition: TCLInterpreter.h:59
void stop()
Definition: TCLLiveEventLoop.cpp:155
long setStopLatency(long ms)
Definition: TCLLiveEventLoop.cpp:185
long getStopLatency() const
Definition: TCLLiveEventLoop.cpp:200
void start()
Definition: TCLLiveEventLoop.cpp:92
Definition: TCLLiveEventLoop.h:55
Definition: TCLVariable.h:50