libadc-cxx 1.0.0
Structured logging for scientific computing
Loading...
Searching...
No Matches
multi_publisher.hpp
Go to the documentation of this file.
1/* Copyright 2025 NTESS. See the top-level LICENSE.txt file for details.
2 *
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5#ifndef adc_multi_publisher_hpp
6#define adc_multi_publisher_hpp
7#include <string>
8#include <iostream>
9#include <sstream>
10#include <map>
11#include <memory>
12#include "adc/types.hpp"
15#define MULTI_PUBLISHER_VERSION "0.0.0"
16#define MULTI_PUBLISHER_TAGS {"none"}
17
18namespace adc {
19
20
21/** \addtogroup API
22 * @{
23 */
24
26
27/*! \brief Interface for a group of publishers all being fed the same message(s).
28
29 */
30class ADC_VISIBLE multi_publisher_api
31{
32public:
33 /// \brief Get the version.
34 virtual std::string_view version() const = 0;
35
36 /// \brief Add a configured and initialized publisher
37 virtual void add(std::shared_ptr<publisher_api> pub) = 0;
38
39 /// \brief Finalize all added publishers
40 virtual void terminate() = 0;
41
42 /// \brief Publish the same message to all added publishers.
43 virtual int publish(std::shared_ptr<builder_api> b) = 0;
44
45 /// \brief Pause all publishers
46 virtual void pause() = 0;
47
48 /// \brief Resume all publishers
49 virtual void resume() = 0;
50
51
53};
54
55/** @}*/
56
57} // namespace adc
58#endif // adc_publisher_hpp
Interface for a group of publishers all being fed the same message(s).
virtual void resume()=0
Resume all publishers.
virtual void terminate()=0
Finalize all added publishers.
virtual void add(std::shared_ptr< publisher_api > pub)=0
Add a configured and initialized publisher.
virtual void pause()=0
Pause all publishers.
virtual std::string_view version() const =0
Get the version.
virtual int publish(std::shared_ptr< builder_api > b)=0
Publish the same message to all added publishers.
version multi_publisher_version(MULTI_PUBLISHER_VERSION, MULTI_PUBLISHER_TAGS)
#define MULTI_PUBLISHER_TAGS
#define MULTI_PUBLISHER_VERSION
Definition adc.hpp:82
A version with tags list.
Definition types.hpp:28