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