|
rogue
|
ZeroMQ client for Rogue control and update messaging. More...
#include <ZmqClient.h>
Public Member Functions | |
| ZmqClient (const std::string &addr, uint16_t port, bool doString) | |
| Constructs a ZeroMQ client and connects sockets. | |
| virtual | ~ZmqClient () |
| Destroys client and stops background activity. | |
| void | setTimeout (uint32_t msecs, bool waitRetry) |
| Sets request timeout behavior. | |
| std::string | sendString (const std::string &path, const std::string &attr, const std::string &arg) |
| Sends a string-mode request. | |
| std::string | getDisp (const std::string &path) |
| Reads display-formatted value at a path (string mode). | |
| void | setDisp (const std::string &path, const std::string &value) |
| Writes display-formatted value at a path (string mode). | |
| std::string | exec (const std::string &path, const std::string &arg="") |
| Executes callable node at path (string mode). | |
| std::string | valueDisp (const std::string &path) |
| Reads compact value display at a path (string mode). | |
| boost::python::object | send (boost::python::object data) |
| Sends binary request payload and receives binary response. | |
| virtual void | doUpdate (boost::python::object data) |
| Handles async update payloads received on subscriber socket. | |
| void | stop () |
| Stops client sockets and background thread. | |
Static Public Member Functions | |
| static std::shared_ptr< rogue::interfaces::ZmqClient > | create (const std::string &addr, uint16_t port, bool doString) |
| Creates a ZeroMQ client. | |
| static void | setup_python () |
| Registers Python bindings for this class. | |
ZeroMQ client for Rogue control and update messaging.
ZmqClient connects to a ZmqServer endpoint and supports two operating modes selected by doString:
doString == false): subscribes to update messages and uses request/reply for binary RPC payloads.doString == true): uses a string request/reply endpoint for high-level display/value operations.In binary mode, a background thread receives publish updates and dispatches them to doUpdate().
Definition at line 48 of file ZmqClient.h.
| rogue::interfaces::ZmqClient::ZmqClient | ( | const std::string & | addr, |
| uint16_t | port, | ||
| bool | doString | ||
| ) |
Constructs a ZeroMQ client and connects sockets.
This constructor is a low-level C++ allocation path. Prefer create() when shared ownership or Python exposure is required.
| addr | Server bind address or host. |
| port | Base server port. |
| doString | true for string request mode, false for binary mode. |
Definition at line 61 of file ZmqClient.cpp.
|
virtual |
Destroys client and stops background activity.
Definition at line 138 of file ZmqClient.cpp.
|
static |
Creates a ZeroMQ client.
Parameter semantics are identical to the constructor; see ZmqClient() for socket setup behavior details. This static factory is the preferred construction path when the object is shared across Rogue graph connections or exposed to Python. It returns std::shared_ptr ownership compatible with Rogue pointer typedefs.
| addr | Server bind address or host. |
| port | Base server port. |
| doString | true for string request mode, false for binary mode. |
Description:
This file is part of the rogue software platform. It is subject to the license terms in the LICENSE.txt file found in the top-level directory of this distribution and at: https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html. No part of the rogue software platform, including this file, may be copied, modified, propagated, or distributed except according to the terms
Definition at line 38 of file ZmqClient.cpp.
|
virtual |
Handles async update payloads received on subscriber socket.
| data | Update payload as Python object. |
Reimplemented in rogue::interfaces::ZmqClientWrap.
Definition at line 283 of file ZmqClient.cpp.
| std::string rogue::interfaces::ZmqClient::exec | ( | const std::string & | path, |
| const std::string & | arg = "" |
||
| ) |
Executes callable node at path (string mode).
| path | Rogue node path. |
| arg | Optional argument string. |
Definition at line 220 of file ZmqClient.cpp.
| std::string rogue::interfaces::ZmqClient::getDisp | ( | const std::string & | path | ) |
Reads display-formatted value at a path (string mode).
| path | Rogue node path. |
Definition at line 212 of file ZmqClient.cpp.
| boost::python::object rogue::interfaces::ZmqClient::send | ( | boost::python::object | data | ) |
Sends binary request payload and receives binary response.
| data | Python object exposing a readable buffer. |
Definition at line 230 of file ZmqClient.cpp.
| std::string rogue::interfaces::ZmqClient::sendString | ( | const std::string & | path, |
| const std::string & | attr, | ||
| const std::string & | arg | ||
| ) |
Sends a string-mode request.
| path | Rogue node path. |
| attr | Attribute or operation name. |
| arg | Optional argument string. |
Definition at line 169 of file ZmqClient.cpp.
| void rogue::interfaces::ZmqClient::setDisp | ( | const std::string & | path, |
| const std::string & | value | ||
| ) |
Writes display-formatted value at a path (string mode).
| path | Rogue node path. |
| value | Value string to apply. |
Definition at line 216 of file ZmqClient.cpp.
| void rogue::interfaces::ZmqClient::setTimeout | ( | uint32_t | msecs, |
| bool | waitRetry | ||
| ) |
Sets request timeout behavior.
| msecs | Timeout in milliseconds. |
| waitRetry | true to continue waiting/retrying after timeouts. |
Definition at line 157 of file ZmqClient.cpp.
|
static |
Registers Python bindings for this class.
Setup class in python.
Definition at line 44 of file ZmqClient.cpp.
| void rogue::interfaces::ZmqClient::stop | ( | ) |
Stops client sockets and background thread.
Definition at line 142 of file ZmqClient.cpp.
| std::string rogue::interfaces::ZmqClient::valueDisp | ( | const std::string & | path | ) |
Reads compact value display at a path (string mode).
| path | Rogue node path. |
Definition at line 224 of file ZmqClient.cpp.