pva2pva  1.4.1
 All Classes Functions Variables Pages
server.h
1 #ifndef SERVER_H
2 #define SERVER_H
3 
4 #include <pv/serverContext.h>
5 
6 #include "chancache.h"
7 #include "channel.h"
8 
10  public epics::pvAccess::ChannelProvider,
11  public epics::pvAccess::ChannelFind,
12  public std::tr1::enable_shared_from_this<GWServerChannelProvider>
13 {
14  POINTER_DEFINITIONS(GWServerChannelProvider);
15  ChannelCache cache;
16 
17  virtual std::tr1::shared_ptr<ChannelProvider> getChannelProvider();
18 
19  virtual void cancel() {}
20 
21  virtual std::string getProviderName() {
22  return "GWServer";
23  }
24 
25  virtual epics::pvAccess::ChannelFind::shared_pointer channelFind(std::string const & channelName,
26  epics::pvAccess::ChannelFindRequester::shared_pointer const & channelFindRequester);
27 
28  using epics::pvAccess::ChannelProvider::createChannel;
29  virtual epics::pvAccess::Channel::shared_pointer createChannel(std::string const & channelName,
30  epics::pvAccess::ChannelRequester::shared_pointer const & channelRequester,
31  short priority, std::string const & addressx);
32  virtual void destroy();
33 
34  explicit GWServerChannelProvider(const epics::pvAccess::ChannelProvider::shared_pointer& prov);
35  virtual ~GWServerChannelProvider();
36 };
37 
38 struct ServerConfig {
39  int debug;
40  bool interactive;
41  epics::pvData::PVStructure::shared_pointer conf;
42 
43  typedef std::map<std::string, GWServerChannelProvider::shared_pointer> clients_t;
44  clients_t clients;
45 
46  typedef std::map<std::string, epics::pvAccess::ServerContext::shared_pointer> servers_t;
47  servers_t servers;
48 
49  ServerConfig() :debug(1), interactive(true) {}
50 
51  void drop(const char *client, const char *channel);
52  void status_server(int lvl, const char *server);
53  void status_client(int lvl, const char *client, const char *channel);
54 };
55 
56 #endif // SERVER_H