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*, uint64, ::rtc::PacketOptions const&) = 0;
58
59 virtual int SendTo(void const*, uint64, ::rtc::SocketAddress const&, ::rtc::PacketOptions const&) = 0;
60
61 virtual int Close() = 0;
62
63 virtual ::rtc::AsyncPacketSocket::State GetState() const = 0;
64
65 virtual int GetOption(::rtc::Socket::Option opt, int* value) = 0;
66
67 virtual int SetOption(::rtc::Socket::Option, int) = 0;
68
69 virtual int GetError() const = 0;
70
71 virtual void SetError(int) = 0;
72 // NOLINTEND
73
74public:
75 // member functions
76 // NOLINTBEGIN
78
79 MCNAPI void NotifyPacketReceived(::rtc::ReceivedPacket const& packet);
80
81 MCNAPI void
82 SubscribeCloseEvent(void const* removal_tag, ::std::function<void(::rtc::AsyncPacketSocket*, int)> callback);
83
85 void const* removal_tag,
86 ::absl::AnyInvocable<void(::rtc::AsyncPacketSocket*, ::rtc::ReceivedPacket const&)> received_packet_callback
87 );
88
89 MCNAPI void UnsubscribeCloseEvent(void const* removal_tag);
90
91 MCNAPI void UnsubscribeReceivedPacketEvent(void const* removal_tag);
92 // NOLINTEND
93
94public:
95 // constructor thunks
96 // NOLINTBEGIN
97 MCNAPI void* $ctor();
98 // NOLINTEND
99
100public:
101 // destructor thunk
102 // NOLINTBEGIN
103 MCNAPI void $dtor();
104 // NOLINTEND
105
106public:
107 // virtual function thunks
108 // NOLINTBEGIN
109
110 // NOLINTEND
111
112public:
113 // vftables
114 // NOLINTBEGIN
115 MCNAPI static void** $vftable();
116 // NOLINTEND
117};
118
119} // 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