Ice 3.9
C++ API Reference
Loading...
Searching...
No Matches
Process.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.9.0-alpha.0
4// <auto-generated>Generated from Slice file 'Process.ice'.</auto-generated>
5// clang-format off
6
7#ifndef Ice_Process_h_
8#define Ice_Process_h_
9
11#include <Ice/Ice.h>
12#include "LocatorRegistry.h"
13
14#ifndef ICE_DISABLE_VERSION
15# if ICE_INT_VERSION != 30950
16# error Ice version mismatch: an exact match is required for beta generated code
17# endif
18#endif
19
20// NOLINTBEGIN(modernize-concat-nested-namespaces)
21
22namespace Ice
23{
24 class ProcessPrx;
25}
26
27namespace Ice
28{
29 /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
30 /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
31 /// @remarks The Slice compiler generated this proxy class from Slice interface `::Ice::Process`.
32 /// @headerfile Ice/Ice.h
33 class ICE_API ProcessPrx : public Ice::Proxy<ProcessPrx, Ice::ObjectPrx>
34 {
35 public:
36 /// Constructs a proxy from a Communicator and a proxy string.
37 /// @param communicator The communicator of the new proxy.
38 /// @param proxyString The proxy string to parse.
39 ProcessPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
40
41 /// Copy constructor. Constructs with a copy of the contents of @p other.
42 /// @param other The proxy to copy from.
43 ProcessPrx(const ProcessPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
44
45 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
46 /// @param other The proxy to move from.
47 ProcessPrx(ProcessPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
48
49 ~ProcessPrx() override;
50
51 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
52 /// @param rhs The proxy to copy from.
53 /// @return A reference to this proxy.
54 ProcessPrx& operator=(const ProcessPrx& rhs) noexcept
55 {
56 if (this != &rhs)
57 {
59 }
60 return *this;
61 }
62
63 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
64 /// @param rhs The proxy to move from.
66 {
67 if (this != &rhs)
68 {
69 Ice::ObjectPrx::operator=(std::move(rhs));
70 }
71 return *this;
72 }
73
74 /// Initiates a graceful shutdown of the server application.
75 /// @param context The request context.
76 void shutdown(const Ice::Context& context = Ice::noExplicitContext) const;
77
78 /// Initiates a graceful shutdown of the server application.
79 /// @param context The request context.
80 /// @return A future that becomes available when the invocation completes.
81 [[nodiscard]] std::future<void> shutdownAsync(const Ice::Context& context = Ice::noExplicitContext) const;
82
83 /// Initiates a graceful shutdown of the server application.
84 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
85 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
86 /// function.
87 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
88 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
89 /// function.
90 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
91 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
92 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
93 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
94 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
95 /// asynchronous case.
96 /// @param context The request context.
97 /// @return A function that can be called to cancel the invocation locally.
98 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
99 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
100 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
101 /// callbacks, and the request is sent later, by a flush.
102 // NOLINTNEXTLINE(modernize-use-nodiscard)
103 std::function<void()> shutdownAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
104
105 /// @private
106 void _iceI_shutdown(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
107
108 /// Writes a message on the server application's stdout or stderr.
109 /// @param message The message to write.
110 /// @param fd 1 for stdout, 2 for stderr.
111 /// @param context The request context.
112 void writeMessage(std::string_view message, std::int32_t fd, const Ice::Context& context = Ice::noExplicitContext) const;
113
114 /// Writes a message on the server application's stdout or stderr.
115 /// @param message The message to write.
116 /// @param fd 1 for stdout, 2 for stderr.
117 /// @param context The request context.
118 /// @return A future that becomes available when the invocation completes.
119 [[nodiscard]] std::future<void> writeMessageAsync(std::string_view message, std::int32_t fd, const Ice::Context& context = Ice::noExplicitContext) const;
120
121 /// Writes a message on the server application's stdout or stderr.
122 /// @param message The message to write.
123 /// @param fd 1 for stdout, 2 for stderr.
124 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
125 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
126 /// function.
127 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
128 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
129 /// function.
130 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
131 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
132 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
133 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
134 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
135 /// asynchronous case.
136 /// @param context The request context.
137 /// @return A function that can be called to cancel the invocation locally.
138 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
139 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
140 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
141 /// callbacks, and the request is sent later, by a flush.
142 // NOLINTNEXTLINE(modernize-use-nodiscard)
143 std::function<void()> writeMessageAsync(std::string_view message, std::int32_t fd, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
144
145 /// @private
146 void _iceI_writeMessage(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, std::int32_t, const Ice::Context&) const;
147
148 /// Gets the type ID of the associated Slice interface.
149 /// @return The string `"::Ice::Process"`.
150 static const char* ice_staticId() noexcept;
151
152 /// @private
153 static ProcessPrx _fromReference(IceInternal::ReferencePtr ref) { return ProcessPrx{std::move(ref)}; }
154
155 protected:
156 /// @private
157 ProcessPrx() = default;
158
159 /// @private
160 explicit ProcessPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
161 {
162 }
163 };
164}
165
166namespace Ice
167{
168 /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
169 /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
170 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::Process`.
171 /// @headerfile Ice/Ice.h
172 class ICE_API Process : public virtual Ice::Object
173 {
174 public:
175 /// The associated proxy type.
176 using ProxyType = ProcessPrx;
177
178 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
179 /// @param request The incoming request.
180 /// @param sendResponse The callback to send the response.
181 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
182
183 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
184
185 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
186
187 /// Initiates a graceful shutdown of the server application.
188 /// @param current The Current object of the incoming request.
189 virtual void shutdown(const Ice::Current& current) = 0;
190
191 /// @private
192 void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
193
194 /// Writes a message on the server application's stdout or stderr.
195 /// @param message The message to write.
196 /// @param fd 1 for stdout, 2 for stderr.
197 /// @param current The Current object of the incoming request.
198 virtual void writeMessage(std::string message, std::int32_t fd, const Ice::Current& current) = 0;
199
200 /// @private
201 void _iceD_writeMessage(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
202
203 /// Gets the type ID of the associated Slice interface.
204 /// @return The string `"::Ice::Process"`.
205 static const char* ice_staticId() noexcept;
206 };
207
208 /// A shared pointer to a Process.
209 using ProcessPtr = std::shared_ptr<Process>;
210}
211
212namespace Ice
213{
214 /// A server application managed by a locator implementation such as IceGrid hosts a Process object and registers a
215 /// proxy to this object with the locator registry. See LocatorRegistryPrx::setServerProcessProxy.
216 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::Process`.
217 /// @headerfile Ice/Ice.h
218 class ICE_API AsyncProcess : public virtual Ice::Object
219 {
220 public:
221 /// The associated proxy type.
223
224 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
225 /// @param request The incoming request.
226 /// @param sendResponse The callback to send the response.
227 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
228
229 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
230
231 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
232
233 /// Initiates a graceful shutdown of the server application.
234 /// @param response The response callback.
235 /// @param exception The exception callback.
236 /// @param current The Current object of the incoming request.
237 virtual void shutdownAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
238
239 /// @private
240 void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
241
242 /// Writes a message on the server application's stdout or stderr.
243 /// @param message The message to write.
244 /// @param fd 1 for stdout, 2 for stderr.
245 /// @param response The response callback.
246 /// @param exception The exception callback.
247 /// @param current The Current object of the incoming request.
248 virtual void writeMessageAsync(std::string message, std::int32_t fd, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
249
250 /// @private
251 void _iceD_writeMessage(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
252
253 /// Gets the type ID of the associated Slice interface.
254 /// @return The string `"::Ice::Process"`.
255 static const char* ice_staticId() noexcept;
256 };
257
258 /// A shared pointer to an AsyncProcess.
259 using AsyncProcessPtr = std::shared_ptr<AsyncProcess>;
260}
261
262// NOLINTEND(modernize-concat-nested-namespaces)
263
264#include <Ice/PopDisableWarnings.h>
265#endif
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
virtual void writeMessageAsync(std::string message, std::int32_t fd, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Writes a message on the server application's stdout or stderr.
virtual void shutdownAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Initiates a graceful shutdown of the server application.
ProcessPrx ProxyType
The associated proxy type.
Definition Process.h:222
void dispatch(IncomingRequest &request, std::function< void(OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
A server application managed by a locator implementation such as IceGrid hosts a Process object and r...
Definition Process.h:219
Represents a request received by a connection.
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Definition Proxy.h:265
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
std::future< void > writeMessageAsync(std::string_view message, std::int32_t fd, const Ice::Context &context=Ice::noExplicitContext) const
Writes a message on the server application's stdout or stderr.
std::function< void()> shutdownAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Initiates a graceful shutdown of the server application.
ProcessPrx(const ProcessPrx &other) noexcept
Copy constructor.
Definition Process.h:43
ProcessPrx & operator=(ProcessPrx &&rhs) noexcept
Move assignment operator.
Definition Process.h:65
std::function< void()> writeMessageAsync(std::string_view message, std::int32_t fd, std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Writes a message on the server application's stdout or stderr.
void writeMessage(std::string_view message, std::int32_t fd, const Ice::Context &context=Ice::noExplicitContext) const
Writes a message on the server application's stdout or stderr.
ProcessPrx(ProcessPrx &&other) noexcept
Move constructor.
Definition Process.h:47
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
void shutdown(const Ice::Context &context=Ice::noExplicitContext) const
Initiates a graceful shutdown of the server application.
ProcessPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition Process.h:39
ProcessPrx & operator=(const ProcessPrx &rhs) noexcept
Copy assignment operator.
Definition Process.h:54
std::future< void > shutdownAsync(const Ice::Context &context=Ice::noExplicitContext) const
Initiates a graceful shutdown of the server application.
A server application managed by a locator implementation such as IceGrid hosts a Process object and r...
Definition Process.h:34
Provides typed proxy functions.
Definition Proxy.h:48
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
const Context noExplicitContext
Marker value used to indicate that no explicit request context was passed to a proxy invocation.
std::shared_ptr< Process > ProcessPtr
A shared pointer to a Process.
Definition Process.h:209
std::shared_ptr< AsyncProcess > AsyncProcessPtr
A shared pointer to an AsyncProcess.
Definition Process.h:259
std::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:28
The Ice RPC framework.
Definition SampleEvent.h:60
Provides information about an incoming request being dispatched.
Definition Current.h:18