17#ifndef __ROGUE_ZMQ_CLIENT_H__
18#define __ROGUE_ZMQ_CLIENT_H__
30 #include <boost/python.hpp>
51 void* zmqCtx_ =
nullptr;
52 void* zmqSub_ =
nullptr;
53 void* zmqReq_ =
nullptr;
56 std::shared_ptr<rogue::Logging> log_;
71 std::atomic<bool> stopping_{
false};
75 std::thread* thread_ =
nullptr;
76 std::atomic<bool> threadEn_{
false};
80 bool running_ =
false;
106 static std::shared_ptr<rogue::interfaces::ZmqClient>
create(
const std::string& addr, uint16_t port,
bool doString);
122 ZmqClient(
const std::string& addr, uint16_t port,
bool doString);
144 void setTimeout(uint32_t warnTime, uint32_t failTime = 0);
151 void setTimeout(uint32_t warnTime,
bool waitRetry, uint32_t maxRetries) =
delete;
160 std::string
sendString(
const std::string& path,
const std::string& attr,
const std::string& arg);
167 std::string
getDisp(
const std::string& path);
174 void setDisp(
const std::string& path,
const std::string& value);
182 std::string
exec(
const std::string& path,
const std::string& arg =
"");
189 std::string
valueDisp(
const std::string& path);
197 boost::python::object
send(boost::python::object data);
203 virtual void doUpdate(boost::python::object data);
224 ZmqClientWrap(
const std::string& addr, uint16_t port,
bool doString);
233 void doUpdate(boost::python::object data);
Python-overridable wrapper for ZmqClient.
void defDoUpdate(boost::python::object data)
Calls base-class doUpdate() implementation.
void doUpdate(boost::python::object data)
Handles an update message from the subscription path.
ZeroMQ client for Rogue control and update messaging.
std::string sendString(const std::string &path, const std::string &attr, const std::string &arg)
Sends a string-mode request.
void stop()
Stops client sockets and background thread.
void setTimeout(uint32_t warnTime, bool waitRetry, uint32_t maxRetries)=delete
std::string getDisp(const std::string &path)
Reads display-formatted value at a path (string mode).
virtual void doUpdate(boost::python::object data)
Handles async update payloads received on subscriber socket.
std::string exec(const std::string &path, const std::string &arg="")
Executes callable node at path (string mode).
boost::python::object send(boost::python::object data)
Sends binary request payload and receives binary response.
void setTimeout(uint32_t warnTime, bool failTime)=delete
static void setup_python()
Registers Python bindings for this class.
void setTimeout(uint32_t warnTime, uint32_t failTime=0)
Sets request timeout behavior.
std::string valueDisp(const std::string &path)
Reads compact value display at a path (string mode).
static std::shared_ptr< rogue::interfaces::ZmqClient > create(const std::string &addr, uint16_t port, bool doString)
Creates a ZeroMQ client.
virtual ~ZmqClient()
Destroys client and stops background activity.
void setDisp(const std::string &path, const std::string &value)
Writes display-formatted value at a path (string mode).
std::shared_ptr< rogue::interfaces::ZmqClient > ZmqClientPtr
std::shared_ptr< rogue::interfaces::ZmqClientWrap > ZmqClientWrapPtr