inline message_t () { int rc = zmq_msg_init (&msg); if (rc != 0) throw error_t (); }
void start() const { int rc = zyre_start(m_self); if (rc == -1) throw error_t("Failed to start Zyre node"); }
inline void bind (const char *addr_) { int rc = zmq_bind (ptr, addr_); if (rc != 0) throw error_t (); }
inline void connect (const char *addr_) { int rc = zmq_connect (ptr, addr_); if (rc != 0) throw error_t (); }
inline void MCDAQ_t::reset_trigger() { int ret; ret = mc_set_dio_bit(&dev, 3, 0); if(ret!=MC_SUCCESS) throw error_t(ret); }
inline void copy (message_t *msg_) { int rc = zmq_msg_copy (&msg, &(msg_->msg)); if (rc != 0) throw error_t (); }
inline void copy (message_t const *msg_) { int rc = zmq_msg_copy (&msg, const_cast<zmq_msg_t*>(&(msg_->msg))); if (rc != 0) throw error_t (); }
inline context_t (int io_threads_) { ptr = zmq_init (io_threads_); if (ptr == NULL) throw error_t (); }
inline void proxy_steerable (void *frontend, void *backend, void *capture, void *control) { int rc = zmq_proxy_steerable (frontend, backend, capture, control); if (rc != 0) throw error_t (); }
inline message_t (message_t &&rhs): msg (rhs.msg) { int rc = zmq_msg_init (&rhs.msg); if (rc != 0) throw error_t (); }
inline void proxy (void *frontend, void *backend, void *capture) { int rc = zmq_proxy (frontend, backend, capture); if (rc != 0) throw error_t (); }
inline context_t () { ptr = zmq_ctx_new (); if (ptr == NULL) throw error_t (); }
inline ~message_t () { int rc = zmq_msg_close (this); if (rc != 0) throw error_t (); }
bool add_error(error_context_t& ctx, error_t::level_t lvl, T *node, const std::string& msg) { ctx.add(error_t(lvl, xml_loc(node), msg)); return false; }
inline void device (int device_, void * insocket_, void* outsocket_) { int rc = zmq_device (device_, insocket_, outsocket_); if (rc != 0) throw error_t (); }
inline void copy (message_t *msg_) { int rc = zmq_msg_copy (this, (zmq_msg_t*) msg_); if (rc != 0) throw error_t (); }
inline message_t (size_t size_) { int rc = zmq_msg_init_size (&msg, size_); if (rc != 0) throw error_t (); }
inline socket_t (context_t &context_, int type_) { ptr = zmq_socket (context_.ptr, type_); if (ptr == NULL) throw error_t (); }
inline void MCDAQ_t::set_dio_out_dir() { int ret; ret = mc_set_dio_out(&dev); if(ret!=MC_SUCCESS) throw error_t(ret); }