23#ifndef IPM_INCLUDE_IPM_SENDER_HPP_
24#define IPM_INCLUDE_IPM_SENDER_HPP_
26#include "cetlib/BasicPluginFactory.h"
27#include "cetlib/compiler_macros.h"
41 NullPointerPassedToSend,
42 connection_name <<
": An null pointer to memory was passed to Sender::send",
43 ((
std::
string)connection_name))
46 connection_name <<
": Unable to send within timeout period (timeout period was " << timeout <<
" milliseconds)",
47 ((
std::
string)connection_name)((
int)timeout))
52#ifndef EXTERN_C_FUNC_DECLARE_START
54#define EXTERN_C_FUNC_DECLARE_START \
64#define DEFINE_DUNE_IPM_SENDER(klass) \
65 EXTERN_C_FUNC_DECLARE_START \
66 std::shared_ptr<dunedaq::ipm::Sender> make() \
68 return std::shared_ptr<dunedaq::ipm::Sender>(new klass()); \
102 bool send(const
void* message,
105 std::
string const& metadata =
"",
106 bool no_tmoexcept_mode = false);
118 virtual
bool send_(const
void* message,
121 std::
string const& metadata,
122 bool no_tmoexcept_mode) = 0;
129inline std::shared_ptr<Sender>
132 static cet::BasicPluginFactory bpf(
"duneIPM",
"make");
133 return bpf.makePlugin<std::shared_ptr<Sender>>(plugin_name);
static constexpr duration_t s_block
std::chrono::milliseconds duration_t
std::atomic< size_t > m_messages
virtual std::string connect_for_sends(const ConnectionInfo &connection_info)=0
static constexpr duration_t s_no_block
virtual ~Sender()=default
void generate_opmon_data() override
std::atomic< size_t > m_bytes
bool send(const void *message, message_size_t message_size, const duration_t &timeout, std::string const &metadata="", bool no_tmoexcept_mode=false)
virtual bool send_(const void *message, message_size_t N, const duration_t &timeout, std::string const &metadata, bool no_tmoexcept_mode)=0
ConnectionInfo m_connection_info
virtual bool can_send() const noexcept=0
#define ERS_DECLARE_ISSUE( namespace_name, class_name, message_, attributes)
An ERS Error indicating that an exception was thrown from ZMQ while performing an operation.
std::shared_ptr< Sender > make_ipm_sender(std::string const &plugin_name)
ERS_DECLARE_ISSUE(cmdlib, MalformedUri, "Malformed uri: "<< error<< " uri:"<< uri,((std::string) error)((std::string) uri)) ERS_DECLARE_ISSUE(cmdlib
cmdlib specific issues
std::string connection_string
std::string connection_name