This is Unofficial EPICS BASE Doxygen Site
channelConnectThread.h
Go to the documentation of this file.
1 
10 #ifndef ChannelConnectThread_H
11 #define ChannelConnectThread_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 NotifyChannelRequester;
24 typedef std::tr1::shared_ptr<NotifyChannelRequester> NotifyChannelRequesterPtr;
25 typedef std::tr1::weak_ptr<NotifyChannelRequester> NotifyChannelRequesterWPtr;
26 
27 
29 typedef std::tr1::shared_ptr<ChannelConnectThread> ChannelConnectThreadPtr;
30 
31 class CAChannel;
32 typedef std::tr1::shared_ptr<CAChannel> CAChannelPtr;
33 typedef std::tr1::weak_ptr<CAChannel> CAChannelWPtr;
34 
36 {
37 public:
38  ChannelRequester::weak_pointer channelRequester;
39  CAChannelWPtr channel;
40  bool isOnQueue;
41  NotifyChannelRequester() : isOnQueue(false) {}
42  void setChannel(CAChannelPtr const &channel)
43  { this->channel = channel;}
44 };
45 
46 
48  public epicsThreadRunable
49 {
50 public:
51  static ChannelConnectThreadPtr get();
53  virtual void run();
54  void start();
55  void stop();
56  void channelConnected(NotifyChannelRequesterPtr const &notifyChannelRequester);
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<NotifyChannelRequesterWPtr> notifyChannelQueue;
66 };
67 
68 
69 }}}
70 
71 #endif /* ChannelConnectThread_H */
C++ wrapper for epicsEvent from EPICS base.
Definition: event.h:31
std::tr1::weak_ptr< NotifyChannelRequester > NotifyChannelRequesterWPtr
std::tr1::shared_ptr< NotifyChannelRequester > NotifyChannelRequesterPtr
Definition: caChannel.h:37
TODO only here because of the Lockable.
Definition: ntaggregate.cpp:16
Mark external symbols and entry points for shared libraries.
std::tr1::shared_ptr< CAChannel > CAChannelPtr
Definition: caChannel.h:31
epicsMutex mutex
Definition: pvAccess.cpp:71
std::tr1::weak_ptr< CAChannel > CAChannelWPtr
Definition: caChannel.h:33
void setChannel(CAChannelPtr const &channel)
epicsMutex Mutex
Definition: lock.h:28
C++ and C descriptions for a thread.
#define false
Definition: flexdef.h:85
std::tr1::shared_ptr< ChannelConnectThread > ChannelConnectThreadPtr
Definition: caChannel.h:34
ChannelRequester::weak_pointer channelRequester