SRS-control 0.1.4
Loading...
Searching...
No Matches
ConnectionTypeDef.hpp
Go to the documentation of this file.
1#pragma once
2
3#include <boost/asio.hpp>
4#include <boost/asio/ip/basic_endpoint.hpp>
5#include <boost/asio/ip/udp.hpp>
6#include <memory>
7#include <type_traits>
8
9namespace srs
10{
11 class App;
12}
13
14namespace srs::connection
15{
16 using udp = boost::asio::ip::udp;
17 using UDPEndpoint = boost::asio::ip::basic_endpoint<boost::asio::ip::udp>;
18
19 class CommandBase;
20
21 template <typename T>
22 struct is_shared_ptr : std::false_type
23 {
24 };
25 template <typename T>
26 struct is_shared_ptr<std::shared_ptr<T>> : std::true_type
27 {
28 };
29
30 template <typename T>
31 concept SharedConnectionPtr = is_shared_ptr<T>::value and requires(T obj) { obj->get_name(); };
32
33 template <typename T>
34 struct IsConnectionType : std::false_type
35 {
36 };
37
38 template <>
39 struct IsConnectionType<CommandBase> : std::true_type
40 {
41 };
42
43 // struct Info
44 // {
45 // explicit Info(App* control_ptr)
46 // : control{ control_ptr }
47 // {
48 // }
49 // App* control = nullptr;
50 // int local_port_number = 0;
51 // };
52
53} // namespace srs::connection
The primary interface class of SRS-Control.
boost::asio::ip::udp udp
boost::asio::ip::basic_endpoint< boost::asio::ip::udp > UDPEndpoint