UMPS
The University of Utah Seismograph Stations Message Passing System.
proxy.hpp
1 #ifndef UMPS_SERVICES_CONNECTIONINFORMATION_SOCKETDETAILS_PROXY_HPP
2 #define UMPS_SERVICES_CONNECTIONINFORMATION_SOCKETDETAILS_PROXY_HPP
3 #include <memory>
4 #include "umps/services/connectionInformation/enums.hpp"
5 namespace UMPS::Services::ConnectionInformation::SocketDetails
6 {
7  //class Publisher;
8  //class Subscriber;
9  //class Request;
10  class Dealer;
11  class Router;
12  class XPublisher;
13  class XSubscriber;
14 }
15 namespace UMPS::Services::ConnectionInformation::SocketDetails
16 {
20 class Proxy
21 {
22 public:
25 
27  Proxy();
30  Proxy(const Proxy &socket);
34  Proxy(Proxy &&socket) noexcept;
36 
39 
43  Proxy& operator=(const Proxy &socket);
48  Proxy& operator=(Proxy &&socket) noexcept;
50 
53 
60  void setSocketPair(const std::pair<XSubscriber, XPublisher> &socketPair);
67  void setSocketPair(const std::pair<Router, Dealer> &socketPair);
74  void setSocketPair(const std::pair<Router, Router> &socketPair);
75 
77  [[nodiscard]] bool haveSocketPair() const noexcept;
80  [[nodiscard]] SocketType getFrontendSocketType() const;
83  [[nodiscard]] SocketType getBackendSocketType() const;
85  [[nodiscard]] XSubscriber getXSubscriberFrontend() const;
87  [[nodiscard]] Router getRouterFrontend() const;
89  [[nodiscard]] XPublisher getXPublisherBackend() const;
91  [[nodiscard]] Dealer getDealerBackend() const;
93  [[nodiscard]] Router getRouterBackend() const;
94 
97  [[nodiscard]] std::string getFrontendAddress() const;
100  [[nodiscard]] std::string getBackendAddress() const;
102 
104  [[nodiscard]] static SocketType getSocketType() noexcept;
105 
108 
110  void clear() noexcept;
112  ~Proxy();
114 private:
115  class ProxyImpl;
116  std::unique_ptr<ProxyImpl> pImpl;
117 };
118 }
119 #endif
Defines how a client would connect to this dealer socket.
Definition: dealer.hpp:12
Defines how a client would connect to this proxy socket.
Definition: proxy.hpp:21
void setSocketPair(const std::pair< Router, Dealer > &socketPair)
Sets the router/dealer socket pair for this proxy.
Proxy & operator=(const Proxy &socket)
Copy assignment operator.
void setSocketPair(const std::pair< Router, Router > &socketPair)
Sets the router/router socket pair for this proxy.
void setSocketPair(const std::pair< XSubscriber, XPublisher > &socketPair)
Sets the xpub/xsub socket pair for this proxy.
Proxy(Proxy &&socket) noexcept
Move constructor.
Proxy & operator=(Proxy &&socket) noexcept
Move assignment operator.
void clear() noexcept
Resets the class and releases memory.
Defines how a client would connect to this router socket.
Definition: router.hpp:12
Defines how a client would connect to this extended publisher socket.
Definition: xPublisher.hpp:12
Defines how a client would bind to this extended subscriber socket.
Definition: xSubscriber.hpp:12
SocketType
This defines the socket type. Note, ZeroMQ may have more socket types than what is enumerated here....
Definition: enums.hpp:29