This is Unofficial EPICS BASE Doxygen Site
monitorEventThread.h
Go to the documentation of this file.
1 
10 #ifndef MonitorEventThread_H
11 #define MonitorEventThread_H
12 #include <queue>
13 #include <cadef.h>
14 #include <shareLib.h>
15 #include <epicsThread.h>
16 #include <pv/event.h>
17 #include <pv/lock.h>
18 
19 namespace epics {
20 namespace pvAccess {
21 namespace ca {
22 
23 class NotifyMonitorRequester;
24 typedef std::tr1::shared_ptr<NotifyMonitorRequester> NotifyMonitorRequesterPtr;
25 typedef std::tr1::weak_ptr<NotifyMonitorRequester> NotifyMonitorRequesterWPtr;
26 
27 
28 class MonitorEventThread;
29 typedef std::tr1::shared_ptr<MonitorEventThread> MonitorEventThreadPtr;
30 
31 class CAChannelMonitor;
32 typedef std::tr1::shared_ptr<CAChannelMonitor> CAChannelMonitorPtr;
33 typedef std::tr1::weak_ptr<CAChannelMonitor> CAChannelMonitorWPtr;
34 
36 {
37 public:
38  MonitorRequester::weak_pointer monitorRequester;
39  CAChannelMonitorWPtr channelMonitor;
40  bool isOnQueue;
41  NotifyMonitorRequester() : isOnQueue(false) {}
42  void setChannelMonitor(CAChannelMonitorPtr const &channelMonitor)
43  { this->channelMonitor = channelMonitor;}
44 };
45 
46 
48  public epicsThreadRunable
49 {
50 public:
51  static MonitorEventThreadPtr get();
53  virtual void run();
54  void start();
55  void stop();
56  void event(NotifyMonitorRequesterPtr const &notifyMonitorRequester);
57 private:
59 
60  bool isStop;
61  std::tr1::shared_ptr<epicsThread> thread;
63  epics::pvData::Event waitForCommand;
64  epics::pvData::Event waitForStop;
65  std::queue<NotifyMonitorRequesterWPtr> notifyMonitorQueue;
66 };
67 
68 
69 }}}
70 
71 #endif /* MonitorEventThread_H */
C++ wrapper for epicsEvent from EPICS base.
Definition: event.h:31
std::tr1::shared_ptr< MonitorEventThread > MonitorEventThreadPtr
Definition: caChannel.h:42
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
Mark external symbols and entry points for shared libraries.
void setChannelMonitor(CAChannelMonitorPtr const &channelMonitor)
epicsMutex mutex
Definition: pvAccess.cpp:71
std::tr1::shared_ptr< NotifyMonitorRequester > NotifyMonitorRequesterPtr
Definition: caChannel.h:40
std::tr1::weak_ptr< CAChannelMonitor > CAChannelMonitorWPtr
Definition: caChannel.h:68
std::tr1::shared_ptr< CAChannelMonitor > CAChannelMonitorPtr
Definition: caChannel.h:66
MonitorRequester::weak_pointer monitorRequester
std::tr1::weak_ptr< NotifyMonitorRequester > NotifyMonitorRequesterWPtr
epicsMutex Mutex
Definition: lock.h:28
C++ and C descriptions for a thread.
#define false
Definition: flexdef.h:85