srs-control 0.2.2
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 AnalysisHandle;
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 static constexpr auto tag = std::string_view{ "on" };
32
33 private:
34 static constexpr std::array<CommunicateEntryType, 3> send_suffix_ = { 0, 15, 1 };
35 };
36
37 class Stopper : public CommandBase
38 {
39 public:
43 Stopper(const Stopper&) = delete;
44
48 Stopper(Stopper&&) = delete;
49
53 Stopper& operator=(const Stopper&) = delete;
54
59
65 explicit Stopper(std::string_view name);
66
67 Stopper();
68
75 ~Stopper() = default;
76
77 static constexpr auto tag = std::string_view{ "off" };
78 static auto get_send_suffix() -> const auto& { return send_suffix_; }
79 static auto get_suffix() -> std::span<const CommunicateEntryType>
80 {
81 return std::span{ send_suffix_.cbegin(), send_suffix_.cend() };
82 }
83
84 private:
85 static constexpr std::array<CommunicateEntryType, 3> send_suffix_ = { 0, 15, 0 };
86 };
87} // 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 &
static constexpr auto tag
~Stopper()=default
Destructor for Stopper connection class.
static constexpr auto tag
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 >