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"
39ERS_DECLARE_ISSUE(ipm, KnownStateForbidsSend,
"Sender not in a state to send data", )
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()); \
80 std::string connection_name{
"" };
81 std::string connection_string{
"inproc://default" };
86 static constexpr duration_t s_no_block = duration_t::zero();
102 bool send(const
void* message,
105 std::
string const& metadata = "",
106 bool no_tmoexcept_mode = false);
116 void generate_opmon_data() override;
118 virtual
bool send_(const
void* message,
121 std::
string const& metadata,
122 bool no_tmoexcept_mode) = 0;
125 mutable
std::atomic<
size_t> m_bytes = { 0 };
126 mutable std::atomic<size_t> m_messages = { 0 };
129inline std::shared_ptr<Sender>
132 static cet::BasicPluginFactory bpf(
"duneIPM",
"make");
133 return bpf.makePlugin<std::shared_ptr<Sender>>(plugin_name);
std::chrono::milliseconds duration_t
virtual std::string connect_for_sends(const ConnectionInfo &connection_info)=0
virtual ~Sender()=default
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)
Both frame_count_limit and tp_count_limit were set to(disabled) in the TPCRawDataProcessor config. TPs will not send."