LeviLamina
Loading...
Searching...
No Matches
PersistentWebSocket.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/http/WebSocket.h"
8#include "mc/deps/core/threading/Async.h"
9#include "mc/deps/core/threading/AsyncPromise.h"
10
11// auto generated forward declare list
12// clang-format off
13namespace Bedrock::Http { class HeaderCollection; }
14namespace Bedrock::Http { class RetryPolicy; }
15namespace Bedrock::Http { struct Url; }
16// clang-format on
17
18namespace Bedrock::Http {
19
20class PersistentWebSocket : public ::Bedrock::Http::WebSocket {
21public:
22 // member variables
23 // NOLINTBEGIN
26 // NOLINTEND
27
28public:
29 // prevent constructor by default
30 PersistentWebSocket& operator=(PersistentWebSocket const&);
31 PersistentWebSocket(PersistentWebSocket const&);
32
33public:
34 // virtual functions
35 // NOLINTBEGIN
36 virtual ~PersistentWebSocket() /*override*/;
37
38 virtual bool shouldReconnect() const;
39
40 virtual ::Bedrock::Threading::Async<::Bedrock::Http::Url> getUrl() = 0;
41
42 virtual ::Bedrock::Threading::Async<::Bedrock::Http::HeaderCollection> getHeaders();
43
44 virtual ::Bedrock::Http::RetryPolicy getReconnectPolicy();
45
46 virtual void onConnect();
47
48 virtual void onDisconnect(bool, uint);
49
50 virtual void onClose(uint status) /*override*/;
51 // NOLINTEND
52
53public:
54 // member functions
55 // NOLINTBEGIN
57
58 MCNAPI void _onConnect(
59 ::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code> result,
61 );
62
63 MCNAPI void _reconnect(
64 ::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code> lastResult,
66 );
67
68 MCNAPI ::Bedrock::Threading::Async<::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code>>
70
71 MCNAPI void disconnect();
72 // NOLINTEND
73
74public:
75 // constructor thunks
76 // NOLINTBEGIN
77 MCNAPI void* $ctor();
78 // NOLINTEND
79
80public:
81 // destructor thunk
82 // NOLINTBEGIN
83 MCNAPI void $dtor();
84 // NOLINTEND
85
86public:
87 // virtual function thunks
88 // NOLINTBEGIN
89 MCNAPI bool $shouldReconnect() const;
90
91 MCNAPI ::Bedrock::Threading::Async<::Bedrock::Http::HeaderCollection> $getHeaders();
92
93 MCNAPI ::Bedrock::Http::RetryPolicy $getReconnectPolicy();
94
95 MCNAPI void $onConnect();
96
97 MCNAPI void $onDisconnect(bool, uint);
98
99 MCNAPI void $onClose(uint status);
100
101
102 // NOLINTEND
103
104public:
105 // vftables
106 // NOLINTBEGIN
107 MCNAPI static void** $vftable();
108 // NOLINTEND
109};
110
111} // namespace Bedrock::Http
Definition HeaderCollection.h:7
MCAPI void _reconnect(::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code > lastResult, ::Bedrock::Http::RetryPolicy &&retry)
MCAPI::Bedrock::Http::RetryPolicy $getReconnectPolicy()
MCAPI void $onDisconnect(bool, uint)
MCAPI void $onClose(uint status)
MCAPI bool $shouldReconnect() const
MCAPI void _onConnect(::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code > result, ::Bedrock::Http::RetryPolicy &&retry)
static MCAPI void ** $vftable()
MCAPI ::Bedrock::Threading::Async<::Bedrock::Http::HeaderCollection > $getHeaders()
MCAPI ::Bedrock::Threading::Async<::nonstd::expected<::Bedrock::Http::StatusCode, ::std::error_code > > connectWithRetry(::Bedrock::Http::RetryPolicy &&retry)
Definition RetryPolicy.h:12
Definition WebSocket.h:18
Definition Url.h:7
Definition Alias.h:14