LeviLamina
Loading...
Searching...
No Matches
LibHttpClientImpl.h
1#pragma once
2
3#include "mc/_HeaderOutputPredefine.h"
4
5// auto generated inclusion list
6#include "mc/deps/core/http/DispatcherProcess.h"
7#include "mc/deps/core/threading/Async.h"
8
9// auto generated forward declare list
10// clang-format off
11struct HC_CALL;
12namespace Bedrock::Http { class Request; }
13namespace Bedrock::Http { class Response; }
14namespace Bedrock::Http::Internal { class IResponseBody; }
15namespace Bedrock::Threading { class Mutex; }
16// clang-format on
17
18namespace Bedrock::Http {
19
20class LibHttpClientImpl : public ::Bedrock::Http::DispatcherProcess {
21public:
22 // member variables
23 // NOLINTBEGIN
28 // NOLINTEND
29
30public:
31 // prevent constructor by default
32 LibHttpClientImpl& operator=(LibHttpClientImpl const&);
33 LibHttpClientImpl(LibHttpClientImpl const&);
34
35public:
36 // virtual functions
37 // NOLINTBEGIN
38 virtual ~LibHttpClientImpl() /*override*/ = default;
39
40 virtual void initialize() /*override*/;
41
42 virtual void shutdown() /*override*/;
43
44 virtual ::Bedrock::Threading::Async<::Bedrock::Http::Response>
45 send(::Bedrock::Http::Request&& request) /*override*/;
46 // NOLINTEND
47
48public:
49 // member functions
50 // NOLINTBEGIN
52
53 MCNAPI ::std::optional<::std::chrono::seconds>
54 _checkRetryPolicy(::gsl::not_null<::HC_CALL*> call, ::Bedrock::Http::Response const& httpResponse);
55
56 MCNAPI ::Bedrock::Threading::Async<::Bedrock::Http::Response>
57 _convertResponse(::gsl::not_null<::HC_CALL*> callHandle);
58
59 MCNAPI ::Bedrock::Threading::Async<::Bedrock::Http::Response>
60 _retry(::gsl::not_null<::HC_CALL*> callHandle, ::std::chrono::seconds delay);
61
62 MCNAPI ::std::shared_ptr<::Bedrock::Http::Internal::IResponseBody>
63 _tryGetResponseBody(::gsl::not_null<::HC_CALL*> call);
64
65 MCNAPI void _untrack(::gsl::not_null<::HC_CALL*> callHandle);
66 // NOLINTEND
67
68public:
69 // static functions
70 // NOLINTBEGIN
71 MCNAPI static long
72 _convertResponseBody(::gsl::not_null<::HC_CALL*> callHandle, ::Bedrock::Http::Response& response);
73
74 MCNAPI static long
75 _convertResponseHeaders(::gsl::not_null<::HC_CALL*> callHandle, ::Bedrock::Http::Response& response);
76
77 MCNAPI static long _createCallHandle(::HC_CALL** outHandle, ::Bedrock::Http::Request const& request);
78
79 MCNAPI static long _requestBodyRead(
80 ::HC_CALL* call,
81 uint64 offset,
82 uint64 bytesAvailable,
83 void* context,
84 uchar* destination,
85 uint64* bytesWritten
86 );
87
88 MCNAPI static long _responseBodyWrite(::HC_CALL* call, uchar const* source, uint64 bytesAvailable, void* context);
89 // NOLINTEND
90
91public:
92 // static variables
93 // NOLINTBEGIN
94 MCNAPI static ::std::weak_ptr<::Bedrock::Http::LibHttpClientImpl>& sWeakThis();
95
96 MCNAPI static ::Bedrock::Threading::Mutex& sWeakThisMutex();
97 // NOLINTEND
98
99public:
100 // constructor thunks
101 // NOLINTBEGIN
102 MCNAPI void* $ctor();
103 // NOLINTEND
104
105public:
106 // virtual function thunks
107 // NOLINTBEGIN
108 MCNAPI void $initialize();
109
110 MCNAPI void $shutdown();
111
112 MCNAPI ::Bedrock::Threading::Async<::Bedrock::Http::Response> $send(::Bedrock::Http::Request&& request);
113
114
115 // NOLINTEND
116
117public:
118 // vftables
119 // NOLINTBEGIN
120 MCNAPI static void** $vftable();
121 // NOLINTEND
122};
123
124} // namespace Bedrock::Http
Definition DispatcherProcess.h:11
Definition IResponseBody.h:10
static MCAPI long _responseBodyWrite(::HC_CALL *call, uchar const *source, uint64 bytesAvailable, void *context)
static MCAPI ::std::weak_ptr<::Bedrock::Http::LibHttpClientImpl > & sWeakThis()
MCAPI ::std::optional<::std::chrono::seconds > _checkRetryPolicy(::gsl::not_null<::HC_CALL * > call, ::Bedrock::Http::Response const &httpResponse)
static MCAPI long _convertResponseBody(::gsl::not_null<::HC_CALL * > callHandle, ::Bedrock::Http::Response &response)
MCAPI ::Bedrock::Threading::Async<::Bedrock::Http::Response > _retry(::gsl::not_null<::HC_CALL * > callHandle, ::std::chrono::seconds delay)
static MCAPI long _createCallHandle(::HC_CALL **outHandle, ::Bedrock::Http::Request const &request)
MCAPI ::Bedrock::Threading::Async<::Bedrock::Http::Response > _convertResponse(::gsl::not_null<::HC_CALL * > callHandle)
MCAPI void _untrack(::gsl::not_null<::HC_CALL * > callHandle)
MCAPI ::Bedrock::Threading::Async<::Bedrock::Http::Response > $send(::Bedrock::Http::Request &&request)
MCAPI ::std::shared_ptr<::Bedrock::Http::Internal::IResponseBody > _tryGetResponseBody(::gsl::not_null<::HC_CALL * > call)
static MCAPI long _requestBodyRead(::HC_CALL *call, uint64 offset, uint64 bytesAvailable, void *context, uchar *destination, uint64 *bytesWritten)
static MCAPI ::Bedrock::Threading::Mutex & sWeakThisMutex()
static MCAPI long _convertResponseHeaders(::gsl::not_null<::HC_CALL * > callHandle, ::Bedrock::Http::Response &response)
static MCAPI void ** $vftable()
Definition Request.h:16
Definition Response.h:13
Definition Mutex.h:10
Definition HC_CALL.h:14
Definition context.h:5
Definition Alias.h:14