pvAccessCPP  7.1.7
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
serverChannelImpl.h
1 
7 #ifndef SERVERCHANNEL_H_
8 #define SERVERCHANNEL_H_
9 
10 #include <pv/destroyable.h>
11 #include <pv/remote.h>
12 #include <pv/security.h>
13 #include <pv/baseChannelRequester.h>
14 
15 namespace epics {
16 namespace pvAccess {
17 
18 class BaseChannelRequester;
19 
20 class ServerChannel
21 {
22 public:
23  POINTER_DEFINITIONS(ServerChannel);
24 
25  static size_t num_instances;
26 
34  ServerChannel(Channel::shared_pointer const & channel,
35  const ChannelRequester::shared_pointer& requester,
36  pvAccessID cid, pvAccessID sid);
37  ~ServerChannel();
38 
39  const Channel::shared_pointer& getChannel() const { return _channel; }
40 
41  pvAccessID getCID() const { return _cid; }
42 
43  pvAccessID getSID() const { return _sid; }
44 
45  void registerRequest(pvAccessID id, const std::tr1::shared_ptr<BaseChannelRequester>& request);
46 
47  void unregisterRequest(pvAccessID id);
48 
49  void installGetField(const GetFieldRequester::shared_pointer& gf);
50  void completeGetField(GetFieldRequester *req);
51 
53  std::tr1::shared_ptr<BaseChannelRequester> getRequest(pvAccessID id);
54 
55  void destroy();
56 
57  void printInfo() const;
58 
59  void printInfo(FILE *fd) const;
60 private:
61  const Channel::shared_pointer _channel;
62 
63  const ChannelRequester::shared_pointer _requester;
64 
65  const pvAccessID _cid, _sid;
66 
68  GetFieldRequester::shared_pointer _active_requester;
69 
71  _requests_t _requests;
72 
73  bool _destroyed;
74 
75  mutable epics::pvData::Mutex _mutex;
76 };
77 
78 }
79 }
80 
81 
82 #endif /* SERVERCHANNEL_H_ */