6#include <boost/asio/executor_work_guard.hpp>
7#include <boost/asio/ip/udp.hpp>
8#include <boost/asio/signal_set.hpp>
9#include <boost/asio/strand.hpp>
10#include <boost/asio/thread_pool.hpp>
11#include <boost/system/detail/error_code.hpp>
148 void read_data(
bool is_non_stop =
true);
156 void start_workflow();
164 void wait_for_finish();
182 void set_output_filenames(
const std::vector<std::string>& filenames, std::size_t n_lines = 1);
189 void exit_and_switch_off();
203 void action_after_destructor();
206 using udp = asio::ip::udp;
268 template <
typename T>
The primary interface class of SRS-Control.
asio::executor_work_guard< io_context_type::executor_type > io_work_guard_
Asio io_context work guard.
void set_fec_data_receiv_port(int port_num)
Set the local listen port number for the communications to FEC devices.
void init()
Initialization of internal members.
SwitchFutureType switch_on_future_
App & operator=(const App &)=delete
uint16_t channel_address_
void add_remote_fec_endpoint(std::string_view remote_ip, int port_number)
auto get_config() const -> const auto &
asio::signal_set signal_set_
User signal handler for interrupts.
std::vector< udp::endpoint > remote_fec_endpoints_
Remote endpoints of FEC devices.
std::expected< std::future< void >, boost::system::error_code > SwitchFutureType
auto get_workflow_handler() const -> const auto &
std::jthread working_thread_
Main working thread.
std::expected< std::future_status, boost::system::error_code > SwitchFutureStatusType
std::unique_ptr< workflow::Handler > workflow_handler_
The handler to the analysis working flow.
auto get_channel_address() const -> uint16_t
App & operator=(App &&)=delete
App()
Constructor of the App class.
internal::AppExitHelper exit_helper_
Exit helper for App class. This is called after calling the destructor.
auto get_fec_strand() -> auto &
asio::strand< io_context_type::executor_type > fec_strand_
FEC communication strand for synchronous communications.
auto get_io_context() -> auto &
void set_options(Config options)
Set the configuration values.
void set_remote_fec_endpoints()
std::shared_ptr< connection::DataSocket > data_socket_
Communication to the main input data stream.
static auto wait_for_switch_action(const SwitchFutureType &switch_future) -> SwitchFutureStatusType
SwitchFutureType switch_off_future_
io_context_type io_context_
Asio io_context that manages the task scheduling and network IO.
std::jthread workflow_thread_
Main thread to run workflow.
auto get_config_ref() -> auto &
auto switch_FECs(std::string_view connection_name) -> SwitchFutureType
void wait_for_reading_finish()
An internal exit helper for App class.
AppExitHelper & operator=(const AppExitHelper &)=default
~AppExitHelper() noexcept
Destructor calling srs::App::end_of_work method.
AppExitHelper & operator=(AppExitHelper &&)=delete
AppExitHelper(const AppExitHelper &)=default
AppExitHelper(AppExitHelper &&)=delete
AppExitHelper(App *app)
Constructor with pointer to srs::App instance.
constexpr auto DEFAULT_CHANNEL_ADDRE
DataPrintMode
Print mode of the status line.
asio::thread_pool io_context_type
Main configuration struct.