SRS-control
0.1.4
Loading...
Searching...
No Matches
SRSWorld.cpp
Go to the documentation of this file.
1
#include "
SRSWorld.hpp
"
2
#include "
srs/SRSEmulator.hpp
"
3
#include <memory>
4
#include <optional>
5
#include <spdlog/spdlog.h>
6
#include <string>
7
#include <string_view>
8
#include <thread>
9
10
namespace
srs::test
11
{
12
World::World
(std::string_view input_filename)
13
:
app_config_
{
app_
.get_config_ref() }
14
{
15
srs_server_
=
16
std::make_unique<SRSEmulator>(
SRSEmulator::Config
{ .data_port =
app_config_
.fec_data_receive_port,
17
.listen_port =
app_config_
.fec_control_remote_port,
18
.write_port =
app_config_
.fec_control_local_port,
19
.filename = input_filename });
20
}
21
22
void
World::init
() {
app_
.init(); }
23
24
auto
World::launch_server
() -> std::optional<std::string>
25
{
26
srs_server_thread_
= std::jthread(
27
[
this
]()
28
{
29
srs_server_
->wait_for_connection();
30
spdlog::trace(
"World: Server stops waiting for connections."
);
31
});
32
return
{};
33
}
34
35
}
// namespace srs::test
SRSEmulator.hpp
SRSWorld.hpp
srs::test::World::srs_server_thread_
std::jthread srs_server_thread_
Definition
SRSWorld.hpp:42
srs::test::World::srs_server_
std::unique_ptr< SRSEmulator > srs_server_
Definition
SRSWorld.hpp:39
srs::test::World::launch_server
auto launch_server() -> std::optional< std::string >
Definition
SRSWorld.cpp:24
srs::test::World::World
World(std::string_view input_filename)
Definition
SRSWorld.cpp:12
srs::test::World::init
void init()
Definition
SRSWorld.cpp:22
srs::test::World::app_
App app_
Definition
SRSWorld.hpp:37
srs::test::World::app_config_
Config & app_config_
Definition
SRSWorld.hpp:38
srs::test
Definition
SRSEmulator.cpp:37
srs::test::SRSEmulator::Config
Definition
SRSEmulator.hpp:34
test
backend
srs
SRSWorld.cpp
Impressum
Datenschutzerklärung
Generated by
1.16.1