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&);
47
48public:
49 // virtual functions
50 // NOLINTBEGIN
51 // vIndex: 0
52 virtual ~AsyncPacketSocket() /*override*/;
53
54 // vIndex: 1
55 virtual ::rtc::SocketAddress GetLocalAddress() const = 0;
56
57 // vIndex: 2
58 virtual ::rtc::SocketAddress GetRemoteAddress() const = 0;
59
60 // vIndex: 3
61 virtual int Send(void const* data, uint64 len, ::rtc::PacketOptions const& options) = 0;
62
63 // vIndex: 4
64 virtual int SendTo(void const*, uint64, ::rtc::SocketAddress const&, ::rtc::PacketOptions const&) = 0;
65
66 // vIndex: 5
67 virtual int Close() = 0;
68
69 // vIndex: 6
70 virtual ::rtc::AsyncPacketSocket::State GetState() const = 0;
71
72 // vIndex: 7
73 virtual int GetOption(::rtc::Socket::Option opt, int* value) = 0;
74
75 // vIndex: 8
76 virtual int SetOption(::rtc::Socket::Option, int) = 0;
77
78 // vIndex: 9
79 virtual int GetError() const = 0;
80
81 // vIndex: 10
82 virtual void SetError(int) = 0;
83 // NOLINTEND
84
85public:
86 // member functions
87 // NOLINTBEGIN
89
90 MCNAPI void NotifyPacketReceived(::rtc::ReceivedPacket const& packet);
91
92 MCNAPI void
93 SubscribeCloseEvent(void const* removal_tag, ::std::function<void(::rtc::AsyncPacketSocket*, int)> callback);
94
96 void const* removal_tag,
97 ::absl::AnyInvocable<void(::rtc::AsyncPacketSocket*, ::rtc::ReceivedPacket const&)> received_packet_callback
98 );
99
100 MCNAPI void UnsubscribeCloseEvent(void const* removal_tag);
101
102 MCNAPI void UnsubscribeReceivedPacketEvent(void const* removal_tag);
103 // NOLINTEND
104
105public:
106 // constructor thunks
107 // NOLINTBEGIN
108 MCNAPI void* $ctor();
109 // NOLINTEND
110
111public:
112 // destructor thunk
113 // NOLINTBEGIN
114 MCNAPI void $dtor();
115 // NOLINTEND
116
117public:
118 // virtual function thunks
119 // NOLINTBEGIN
120
121 // NOLINTEND
122
123public:
124 // vftables
125 // NOLINTBEGIN
126 MCNAPI static void** $vftable();
127 // NOLINTEND
128};
129
130} // 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