LeviLamina
Loading...
Searching...
No Matches
WebSocket.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/http/StatusCode.h"
7#include "mc/deps/core/threading/Async.h"
8#include "mc/deps/core/threading/AsyncPromise.h"
9
10// auto generated forward declare list
11// clang-format off
12namespace Bedrock::Http { class HeaderCollection; }
14// clang-format on
15
16namespace Bedrock::Http {
17
18class WebSocket : public ::std::enable_shared_from_this<::Bedrock::Http::WebSocket> {
19public:
20 // member variables
21 // NOLINTBEGIN
25 // NOLINTEND
26
27public:
28 // prevent constructor by default
29 WebSocket& operator=(WebSocket const&);
30 WebSocket(WebSocket const&);
31 WebSocket();
32
33public:
34 // virtual functions
35 // NOLINTBEGIN
36 virtual ~WebSocket();
37
38 virtual ::Bedrock::Threading::Async<::std::error_code> send(::std::string const& message) const;
39
40 virtual void onMessage(::std::string_view message);
41
42 virtual void onBinaryMessage(::gsl::span<uchar const>);
43
44 virtual void onClose(uint status);
45 // NOLINTEND
46
47public:
48 // member functions
49 // NOLINTBEGIN
50 MCNAPI ::Bedrock::Threading::Async<::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code>>
51 connect(::std::string const& uri, ::Bedrock::Http::HeaderCollection const& headers);
52 // NOLINTEND
53
54public:
55 // static functions
56 // NOLINTBEGIN
58 // NOLINTEND
59
60public:
61 // destructor thunk
62 // NOLINTBEGIN
63 MCNAPI void $dtor();
64 // NOLINTEND
65
66public:
67 // virtual function thunks
68 // NOLINTBEGIN
69 MCNAPI ::Bedrock::Threading::Async<::std::error_code> $send(::std::string const& message) const;
70
71 MCNAPI void $onMessage(::std::string_view message);
72
73 MCNAPI void $onBinaryMessage(::gsl::span<uchar const>);
74
75 MCNAPI void $onClose(uint status);
76
77
78 // NOLINTEND
79
80public:
81 // vftables
82 // NOLINTBEGIN
83 MCNAPI static void** $vftable();
84 // NOLINTEND
85};
86
87} // namespace Bedrock::Http
Definition HeaderCollection.h:7
MCAPI void $onMessage(::std::string_view message)
static MCAPI void ** $vftable()
MCAPI ::Bedrock::Threading::Async<::std::error_code > $send(::std::string const &message) const
MCAPI void $onClose(uint status)
MCAPI ::Bedrock::Threading::Async<::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code > > connect(::std::string const &uri, ::Bedrock::Http::HeaderCollection const &headers)
MCAPI void $onBinaryMessage(::gsl::span< uchar const >)
static MCAPI void _deallocateSocketAsync(::HC_WEBSOCKET_OBSERVER *handle)
Definition HC_WEBSOCKET_OBSERVER.h:8
Definition Alias.h:14