LeviLamina
Loading...
Searching...
No Matches
AsyncPacketSocket.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/external/absl/AnyInvocable.h"
7#include "mc/external/rtc/Socket.h"
8#include "mc/external/sigslot/has_slots.h"
9#include "mc/external/sigslot/single_threaded.h"
10
11// auto generated forward declare list
12// clang-format off
13namespace rtc { class ReceivedPacket; }
14namespace rtc { class SocketAddress; }
15namespace rtc { struct PacketOptions; }
16// clang-format on
17
18namespace rtc {
19
20class AsyncPacketSocket : public ::sigslot::has_slots<::sigslot::single_threaded> {
21public:
22 // AsyncPacketSocket inner types define
23 enum class State : int {
24 Closed = 0,
25 Binding = 1,
26 Bound = 2,
27 Connecting = 3,
28 Connected = 4,
29 };
30
31public:
32 // member variables
33 // NOLINTBEGIN
41 // NOLINTEND
42
43public:
44 // prevent constructor by default
45 AsyncPacketSocket& operator=(AsyncPacketSocket const&);
46 AsyncPacketSocket(AsyncPacketSocket const&);
47
48public:
49 // virtual functions
50 // NOLINTBEGIN
51 virtual ~AsyncPacketSocket() /*override*/;
52
53 virtual ::rtc::SocketAddress GetLocalAddress() const = 0;
54
55 virtual ::rtc::SocketAddress GetRemoteAddress() const = 0;
56
57 virtual int Send(void const* pv, uint64 cb, ::rtc::PacketOptions const& options) = 0;
58
59 virtual int
60 SendTo(void const* pv, uint64 cb, ::rtc::SocketAddress const& addr, ::rtc::PacketOptions const& options) = 0;
61
62 virtual int Close() = 0;
63
64 virtual ::rtc::AsyncPacketSocket::State GetState() const = 0;
65
66 virtual int GetOption(::rtc::Socket::Option opt, int* value) = 0;
67
68 virtual int SetOption(::rtc::Socket::Option opt, int value) = 0;
69
70 virtual int GetError() const = 0;
71
72 virtual void SetError(int error) = 0;
73 // NOLINTEND
74
75public:
76 // member functions
77 // NOLINTBEGIN
79
80 MCNAPI void NotifyPacketReceived(::rtc::ReceivedPacket const& packet);
81
82 MCNAPI void
83 SubscribeCloseEvent(void const* removal_tag, ::std::function<void(::rtc::AsyncPacketSocket*, int)> callback);
84
86 void const* removal_tag,
87 ::absl::AnyInvocable<void(::rtc::AsyncPacketSocket*, ::rtc::ReceivedPacket const&)> received_packet_callback
88 );
89
90 MCNAPI void UnsubscribeCloseEvent(void const* removal_tag);
91
92 MCNAPI void UnsubscribeReceivedPacketEvent(void const* removal_tag);
93 // NOLINTEND
94
95public:
96 // constructor thunks
97 // NOLINTBEGIN
98 MCNAPI void* $ctor();
99 // NOLINTEND
100
101public:
102 // destructor thunk
103 // NOLINTBEGIN
104 MCNAPI void $dtor();
105 // NOLINTEND
106
107public:
108 // virtual function thunks
109 // NOLINTBEGIN
110
111 // NOLINTEND
112
113public:
114 // vftables
115 // NOLINTBEGIN
116 MCNAPI static void** $vftable();
117 // NOLINTEND
118};
119
120} // namespace rtc
Definition AnyInvocable.h:8
Definition AsyncPacketSocket.h:20
MCAPI void UnsubscribeReceivedPacketEvent(void const *removal_tag)
MCAPI void SubscribeReceivedPacketEvent(void const *removal_tag, ::absl::AnyInvocable< void(::rtc::AsyncPacketSocket *, ::rtc::ReceivedPacket const &)> received_packet_callback)
static MCAPI void ** $vftable()
MCAPI void UnsubscribeCloseEvent(void const *removal_tag)
MCAPI void * $ctor()
MCAPI void NotifyPacketReceived(::rtc::ReceivedPacket const &packet)
MCAPI void SubscribeCloseEvent(void const *removal_tag, ::std::function< void(::rtc::AsyncPacketSocket *, int)> callback)
Definition ReceivedPacket.h:16
Definition SocketAddress.h:12
Definition has_slots.h:8
Definition Alias.h:14
Definition PacketOptions.h:10