SRS-control 0.1.4
 
Loading...
Searching...
No Matches
srs::App Class Reference

#include <Application.hpp>

Collaboration diagram for srs::App:

Public Member Functions

 App ()
 
 App (const App &)=delete
 
 App (App &&)=delete
 
Appoperator= (const App &)=delete
 
Appoperator= (App &&)=delete
 
 ~App () noexcept
 
void init ()
 
void configure_fec ()
 
void switch_on ()
 
void switch_off ()
 
void read_data (bool is_non_stop=true)
 
void notify_status_change ()
 
void start_workflow (bool is_blocking=true)
 
void wait_for_finish ()
 
auto wait_for_status (auto &&condition, std::chrono::seconds time_duration=common::DEFAULT_STATUS_WAITING_TIME_SECONDS) -> bool
 
void set_remote_endpoint (std::string_view remote_ip, int port_number)
 
void set_fec_data_receiv_port (int port_num)
 
void set_status_acq_on (bool val=true)
 
void set_status_acq_off (bool val=true)
 
void set_status_is_reading (bool val=true)
 
void set_print_mode (common::DataPrintMode mode)
 
void set_output_filenames (const std::vector< std::string > &filenames)
 
void set_error_string (std::string_view err_msg)
 
auto get_channel_address () const -> uint16_t
 
auto get_status () const -> const auto &
 
auto get_io_context () -> auto &
 
auto get_data_reader () -> connection::DataReader *
 
auto get_error_string () const -> const std::string &
 
auto get_workflow_handler () const -> const auto &
 
void end_of_work ()
 

Private Types

using udp = asio::ip::udp
 

Private Member Functions

void exit ()
 
void wait_for_reading_finish ()
 

Private Attributes

Status status_
 
uint16_t channel_address_ = common::DEFAULT_CHANNEL_ADDRE
 
Config configurations_
 
std::string error_string_
 
io_context_type io_context_ { 4 }
 
asio::executor_work_guard< io_context_type::executor_type > io_work_guard_
 
udp::endpoint remote_endpoint_
 
asio::signal_set signal_set_ { io_context_, SIGINT, SIGTERM }
 
std::jthread working_thread_
 
AppExitHelper exit_helper_ { this }
 
std::unique_ptr< workflow::Handlerworkflow_handler_
 
std::shared_ptr< connection::DataReaderdata_reader_
 

Detailed Description

Definition at line 46 of file Application.hpp.

Member Typedef Documentation

◆ udp

using srs::App::udp = asio::ip::udp
private

Definition at line 96 of file Application.hpp.

Constructor & Destructor Documentation

◆ App() [1/3]

srs::App::App ( )

Definition at line 12 of file Application.cpp.

◆ App() [2/3]

srs::App::App ( const App & )
delete

◆ App() [3/3]

srs::App::App ( App && )
delete

◆ ~App()

srs::App::~App ( )
noexcept

Definition at line 44 of file Application.cpp.

Member Function Documentation

◆ configure_fec()

void srs::App::configure_fec ( )
inline

Definition at line 59 of file Application.hpp.

◆ end_of_work()

void srs::App::end_of_work ( )

Definition at line 22 of file Application.cpp.

◆ exit()

void srs::App::exit ( )
private

Definition at line 107 of file Application.cpp.

◆ get_channel_address()

auto srs::App::get_channel_address ( ) const -> uint16_t
inlinenodiscard

Definition at line 84 of file Application.hpp.

◆ get_data_reader()

auto srs::App::get_data_reader ( ) -> connection::DataReader*
inline

Definition at line 88 of file Application.hpp.

◆ get_error_string()

auto srs::App::get_error_string ( ) const -> const std::string&
inlinenodiscard

Definition at line 89 of file Application.hpp.

◆ get_io_context()

auto srs::App::get_io_context ( ) -> auto&
inlinenodiscard

Definition at line 87 of file Application.hpp.

◆ get_status()

auto srs::App::get_status ( ) const -> const auto&
inlinenodiscard

Definition at line 86 of file Application.hpp.

◆ get_workflow_handler()

auto srs::App::get_workflow_handler ( ) const -> const auto&
inlinenodiscard

Definition at line 90 of file Application.hpp.

◆ init()

void srs::App::init ( )

Definition at line 64 of file Application.cpp.

◆ notify_status_change()

void srs::App::notify_status_change ( )
inline

Definition at line 64 of file Application.hpp.

◆ operator=() [1/2]

App & srs::App::operator= ( App && )
delete

◆ operator=() [2/2]

App & srs::App::operator= ( const App & )
delete

◆ read_data()

void srs::App::read_data ( bool is_non_stop = true)

Definition at line 147 of file Application.cpp.

◆ set_error_string()

void srs::App::set_error_string ( std::string_view err_msg)
inline

Definition at line 81 of file Application.hpp.

◆ set_fec_data_receiv_port()

void srs::App::set_fec_data_receiv_port ( int port_num)
inline

Definition at line 75 of file Application.hpp.

◆ set_output_filenames()

void srs::App::set_output_filenames ( const std::vector< std::string > & filenames)

Definition at line 116 of file Application.cpp.

◆ set_print_mode()

void srs::App::set_print_mode ( common::DataPrintMode mode)

Definition at line 115 of file Application.cpp.

◆ set_remote_endpoint()

void srs::App::set_remote_endpoint ( std::string_view remote_ip,
int port_number )

Definition at line 121 of file Application.cpp.

◆ set_status_acq_off()

void srs::App::set_status_acq_off ( bool val = true)
inline

Definition at line 77 of file Application.hpp.

◆ set_status_acq_on()

void srs::App::set_status_acq_on ( bool val = true)
inline

Definition at line 76 of file Application.hpp.

◆ set_status_is_reading()

void srs::App::set_status_is_reading ( bool val = true)
inline

Definition at line 78 of file Application.hpp.

◆ start_workflow()

void srs::App::start_workflow ( bool is_blocking = true)

Definition at line 155 of file Application.cpp.

◆ switch_off()

void srs::App::switch_off ( )

Definition at line 138 of file Application.cpp.

◆ switch_on()

void srs::App::switch_on ( )

Definition at line 129 of file Application.cpp.

◆ wait_for_finish()

void srs::App::wait_for_finish ( )

Definition at line 156 of file Application.cpp.

◆ wait_for_reading_finish()

void srs::App::wait_for_reading_finish ( )
private

Definition at line 90 of file Application.cpp.

◆ wait_for_status()

auto srs::App::wait_for_status ( auto && condition,
std::chrono::seconds time_duration = common::DEFAULT_STATUS_WAITING_TIME_SECONDS ) -> bool
inline

Definition at line 67 of file Application.hpp.

Member Data Documentation

◆ channel_address_

uint16_t srs::App::channel_address_ = common::DEFAULT_CHANNEL_ADDRE
private

Definition at line 99 of file Application.hpp.

◆ configurations_

Config srs::App::configurations_
private

Definition at line 100 of file Application.hpp.

◆ data_reader_

std::shared_ptr<connection::DataReader> srs::App::data_reader_
private

Definition at line 111 of file Application.hpp.

◆ error_string_

std::string srs::App::error_string_
private

Definition at line 101 of file Application.hpp.

◆ exit_helper_

AppExitHelper srs::App::exit_helper_ { this }
private

Definition at line 109 of file Application.hpp.

◆ io_context_

io_context_type srs::App::io_context_ { 4 }
private

Definition at line 104 of file Application.hpp.

◆ io_work_guard_

asio::executor_work_guard<io_context_type::executor_type> srs::App::io_work_guard_
private

Definition at line 105 of file Application.hpp.

◆ remote_endpoint_

udp::endpoint srs::App::remote_endpoint_
private

Definition at line 106 of file Application.hpp.

◆ signal_set_

asio::signal_set srs::App::signal_set_ { io_context_, SIGINT, SIGTERM }
private

Definition at line 107 of file Application.hpp.

◆ status_

Status srs::App::status_
private

Definition at line 98 of file Application.hpp.

◆ workflow_handler_

std::unique_ptr<workflow::Handler> srs::App::workflow_handler_
private

Definition at line 110 of file Application.hpp.

◆ working_thread_

std::jthread srs::App::working_thread_
private

Definition at line 108 of file Application.hpp.


The documentation for this class was generated from the following files: