SRS-control 0.1.4
Loading...
Searching...
No Matches
Connections.hpp
Go to the documentation of this file.
1#pragma once
2
3#include "ConnectionBase.hpp"
6#include <array>
7#include <gsl/gsl-lite.hpp>
8#include <span>
9#include <spdlog/spdlog.h>
10#include <string_view>
11
12namespace srs::workflow
13{
14 class Handler;
15}
16
17namespace srs::connection
18{
19 class FecCommandSocket;
20 class Starter : public CommandBase
21 {
22 public:
23 explicit Starter(std::string_view name);
24 Starter();
25 void close();
26 static auto get_send_suffix() -> const auto& { return send_suffix_; }
27 static auto get_suffix() -> std::span<const CommunicateEntryType>
28 {
29 return std::span{ send_suffix_.cbegin(), send_suffix_.cend() };
30 }
31
32 private:
33 static constexpr std::array<CommunicateEntryType, 3> send_suffix_ = { 0, 15, 1 };
34 };
35
36 class Stopper : public CommandBase
37 {
38 public:
42 Stopper(const Stopper&) = delete;
43
47 Stopper(Stopper&&) = delete;
48
52 Stopper& operator=(const Stopper&) = delete;
53
58
64 explicit Stopper(std::string_view name);
65
66 Stopper();
67
74 ~Stopper() = default;
75
76 static auto get_send_suffix() -> const auto& { return send_suffix_; }
77 static auto get_suffix() -> std::span<const CommunicateEntryType>
78 {
79 return std::span{ send_suffix_.cbegin(), send_suffix_.cend() };
80 }
81
82 private:
83 static constexpr std::array<CommunicateEntryType, 3> send_suffix_ = { 0, 15, 0 };
84 };
85} // namespace srs::connection
CommandBase(const std::string_view name)
Starter(std::string_view name)
static auto get_suffix() -> std::span< const CommunicateEntryType >
static constexpr std::array< CommunicateEntryType, 3 > send_suffix_
static auto get_send_suffix() -> const auto &
~Stopper()=default
Destructor for Stopper connection class.
static constexpr std::array< CommunicateEntryType, 3 > send_suffix_
Stopper(Stopper &&)=delete
Deleted move constructor (rule of 5).
Stopper & operator=(const Stopper &)=delete
Deleted copy assignment operator (rule of 5).
Stopper(const Stopper &)=delete
Deleted copy constructor (rule of 5).
Stopper & operator=(Stopper &&)=delete
Deleted move assignment operator (rule of 5).
static auto get_send_suffix() -> const auto &
static auto get_suffix() -> std::span< const CommunicateEntryType >