ROOT_Application  2.0
C++ Core modules and GUIStock
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RealTime2.h
Go to the documentation of this file.
1 
32 #ifndef _REALTIME2_H_
33 #define _REALTIME2_H_
34 
35 #include <iostream>
36 #include <string>
37 #include <list>
38 
39 #include <TTimer.h>
40 #include <TSystem.h>
41 
42 // Dictionary CINT do not like it, move to *cxx file
43 #ifndef __CINT__
44 #include <boost/thread.hpp>
45 #endif
46 
47 class RealTime2 : public TTimer {
48  private:
50  static bool status_rt;
52  static RealTime2 * frealtime;
56 #ifdef DEBUG_CONT_FRAME
57  std::cout << "Destructor RealTime" << std::endl;
58 #endif
59  }
62  std::list< std::vector<std::string> > ListMessages;
63 
64  // for synchronization of the list, a queue would be better
65 #ifndef __CINT__
66  boost::mutex mutex;
67 #endif
68 
69  public:
71  static RealTime2* getInstance();
73  static void killInstance();
75  bool GetStatus() { return status_rt;}
76 
78  void SetMessage( std::vector<std::string> & message );
79  std::vector<std::string> GetMessage();
80 
81  // not so good, used ??
82  //void ConnectToGUI();
83 
84  // need to notify the main loop
85  // necessary ?? no with TTimer
86  //void GetUpdate();
87 
89 };
90 
91 #endif /* _REALTIME2_H */
boost::mutex mutex
Definition: RealTime2.h:66
void SetMessage(std::vector< std::string > &message)
deal with the list, fill and remove, protected by lock_guard
Definition: RealTime2.cxx:41
static RealTime2 * getInstance()
public access
Definition: RealTime2.cxx:14
~RealTime2()
Definition: RealTime2.h:55
static RealTime2 * frealtime
private pointer to the real object
Definition: RealTime2.h:52
static bool status_rt
static variable for switching on/off the real time
Definition: RealTime2.h:50
static void killInstance()
public destructor
Definition: RealTime2.cxx:28
bool GetStatus()
get the status
Definition: RealTime2.h:75
RealTime2()
Constructor private, called by getInstance.
Definition: RealTime2.h:54
ClassDef(RealTime2, 0)
std::vector< std::string > GetMessage()
Definition: RealTime2.cxx:56
std::list< std::vector< std::string > > ListMessages
vector to conserve the messages, producer/consumer between SM and Main-Loop maybe to protect when wri...
Definition: RealTime2.h:62