5#ifndef adc_publisher_ipp
6#define adc_publisher_ipp
20 const std::vector<string> tags;
27 const char *env = getenv(
"ADC_MULTI_PUBLISHER_DEBUG");
28 if (env && !strcmp(env,
"1") ) {
40 void add(std::shared_ptr<publisher_api> p) {
43 "multi_publisher: null publisher add ignored."
48 std::cout <<
"publisher added: "
49 << p->name() << std::endl;
53 int publish(std::shared_ptr<builder_api> b)
58 for (
auto& element : pvec) {
59 int e = element->publish(b);
63 std::cout <<
"publish failed (" << e <<
65 << element->name() << std::endl;
74 for (
auto& element : pvec) {
82 for (
auto& element : pvec) {
89 for (
auto& element : pvec) {
Interface for a group of publishers all being fed the same message(s).
void pause()
Pause all publishers.
string_view version() const
Get the version.
void add(std::shared_ptr< publisher_api > p)
Add a configured and initialized publisher.
void resume()
Resume all publishers.
void terminate()
Finalize all added publishers.
int publish(std::shared_ptr< builder_api > b)
Publish the same message to all added publishers.
std::vector< std::shared_ptr< publisher_api > > publisher_vector
list of publishers
std::string_view string_view