Ice 3.9
C++ API Reference
Loading...
Searching...
No Matches
Session.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.9.0-alpha.0
4// <auto-generated>Generated from Slice file 'Session.ice'.</auto-generated>
5// clang-format off
6
7#ifndef IceGrid_Session_h_
8#define IceGrid_Session_h_
9
11#include <Ice/Ice.h>
12#include "Exception.h"
13#include <Glacier2/Session.h>
14#include <IceGrid/Config.h>
15
16#ifndef ICE_DISABLE_VERSION
17# if ICE_INT_VERSION != 30950
18# error Ice version mismatch: an exact match is required for beta generated code
19# endif
20#endif
21
22#ifndef ICEGRID_API
23# if defined(ICEGRID_API_EXPORTS)
24# define ICEGRID_API ICE_DECLSPEC_EXPORT
25# else
26# define ICEGRID_API ICE_DECLSPEC_IMPORT
27# endif
28#endif
29
30// NOLINTBEGIN(modernize-concat-nested-namespaces)
31
32namespace IceGrid
33{
34 class RegistryPrx;
35
36 class SessionPrx;
37}
38
39namespace IceGrid
40{
41 /// Represents a session object used by IceGrid clients to allocate and release objects. Client sessions are created
42 /// either via the RegistryPrx object or via the registry client ::Glacier2::SessionManagerPrx object.
43 /// @remarks The Slice compiler generated this proxy class from Slice interface `::IceGrid::Session`.
44 /// @headerfile IceGrid/IceGrid.h
45 class ICEGRID_API SessionPrx : public Ice::Proxy<SessionPrx, ::Glacier2::SessionPrx>
46 {
47 public:
48#if defined(__GNUC__) && !defined(__clang__)
49# pragma GCC diagnostic push
50# pragma GCC diagnostic ignored "-Wextra" // initialize all virtual bases in correct order
51#endif
52
53 /// Constructs a proxy from a Communicator and a proxy string.
54 /// @param communicator The communicator of the new proxy.
55 /// @param proxyString The proxy string to parse.
56 SessionPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
57
58 /// Copy constructor. Constructs with a copy of the contents of @p other.
59 /// @param other The proxy to copy from.
60 SessionPrx(const SessionPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
61
62 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
63 /// @param other The proxy to move from.
64 SessionPrx(SessionPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
65
66 ~SessionPrx() override;
67
68 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
69 /// @param rhs The proxy to copy from.
70 /// @return A reference to this proxy.
71 SessionPrx& operator=(const SessionPrx& rhs) noexcept
72 {
73 if (this != &rhs)
74 {
76 }
77 return *this;
78 }
79
80 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
81 /// @param rhs The proxy to move from.
83 {
84 if (this != &rhs)
85 {
86 Ice::ObjectPrx::operator=(std::move(rhs));
87 }
88 return *this;
89 }
90
91 /// Keeps the session alive.
92 /// @param context The request context.
93 [[deprecated("As of Ice 3.8, there is no need to call this operation, and its implementation does nothing.")]] void keepAlive(const Ice::Context& context = Ice::noExplicitContext) const;
94
95 /// Keeps the session alive.
96 /// @param context The request context.
97 /// @return A future that becomes available when the invocation completes.
98 [[deprecated("As of Ice 3.8, there is no need to call this operation, and its implementation does nothing.")]] [[nodiscard]] std::future<void> keepAliveAsync(const Ice::Context& context = Ice::noExplicitContext) const;
99
100 /// Keeps the session alive.
101 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
102 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
103 /// function.
104 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
105 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
106 /// function.
107 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
108 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
109 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
110 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
111 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
112 /// asynchronous case.
113 /// @param context The request context.
114 /// @return A function that can be called to cancel the invocation locally.
115 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
116 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
117 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
118 /// callbacks, and the request is sent later, by a flush.
119 // NOLINTNEXTLINE(modernize-use-nodiscard)
120 [[deprecated("As of Ice 3.8, there is no need to call this operation, and its implementation does nothing.")]] std::function<void()> keepAliveAsync(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;
121
122 /// @private
123 void _iceI_keepAlive(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
124
125 /// Allocates an object.
126 /// @param id The identity of the object to allocate.
127 /// @param context The request context.
128 /// @return A proxy to the allocated object. This proxy is never null.
129 /// @throws IceGrid::AllocationException Thrown when the allocation fails.
130 /// @throws IceGrid::ObjectNotRegisteredException Thrown when an object with the given identity is not registered with
131 /// the registry.
132 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
133 /// @see ::IceGrid::SessionPrx::releaseObject
134 std::optional<Ice::ObjectPrx> allocateObjectById(const ::Ice::Identity& id, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
135
136 /// Allocates an object.
137 /// @param id The identity of the object to allocate.
138 /// @param context The request context.
139 /// @return A future that becomes available when the invocation completes. This future holds:
140 /// - A proxy to the allocated object. This proxy is never null.
141 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
142 /// @see ::IceGrid::SessionPrx::releaseObject
143 [[nodiscard]] std::future<std::optional<Ice::ObjectPrx>> allocateObjectByIdAsync(const ::Ice::Identity& id, const Ice::Context& context = Ice::noExplicitContext) const;
144
145 /// Allocates an object.
146 /// @param id The identity of the object to allocate.
147 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
148 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
149 /// function. It accepts:
150 /// - A proxy to the allocated object. This proxy is never null.
151 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
152 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
153 /// function.
154 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
155 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
156 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
157 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
158 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
159 /// asynchronous case.
160 /// @param context The request context.
161 /// @return A function that can be called to cancel the invocation locally.
162 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
163 /// @see ::IceGrid::SessionPrx::releaseObject
164 // NOLINTNEXTLINE(modernize-use-nodiscard)
165 std::function<void()> allocateObjectByIdAsync(const ::Ice::Identity& id, std::function<void(std::optional<Ice::ObjectPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
166
167 /// @private
168 void _iceI_allocateObjectById(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, const ::Ice::Identity&, const Ice::Context&) const;
169
170 /// Allocates an object with the given type.
171 /// @param type The type of the object.
172 /// @param context The request context.
173 /// @return A proxy to the allocated object. This proxy is never null.
174 /// @throws IceGrid::AllocationException Thrown when the allocation fails.
175 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
176 /// @see ::IceGrid::SessionPrx::releaseObject
177 std::optional<Ice::ObjectPrx> allocateObjectByType(std::string_view type, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
178
179 /// Allocates an object with the given type.
180 /// @param type The type of the object.
181 /// @param context The request context.
182 /// @return A future that becomes available when the invocation completes. This future holds:
183 /// - A proxy to the allocated object. This proxy is never null.
184 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
185 /// @see ::IceGrid::SessionPrx::releaseObject
186 [[nodiscard]] std::future<std::optional<Ice::ObjectPrx>> allocateObjectByTypeAsync(std::string_view type, const Ice::Context& context = Ice::noExplicitContext) const;
187
188 /// Allocates an object with the given type.
189 /// @param type The type of the object.
190 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
191 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
192 /// function. It accepts:
193 /// - A proxy to the allocated object. This proxy is never null.
194 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
195 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
196 /// function.
197 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
198 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
199 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
200 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
201 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
202 /// asynchronous case.
203 /// @param context The request context.
204 /// @return A function that can be called to cancel the invocation locally.
205 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
206 /// @see ::IceGrid::SessionPrx::releaseObject
207 // NOLINTNEXTLINE(modernize-use-nodiscard)
208 std::function<void()> allocateObjectByTypeAsync(std::string_view type, std::function<void(std::optional<Ice::ObjectPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
209
210 /// @private
211 void _iceI_allocateObjectByType(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, std::string_view, const Ice::Context&) const;
212
213 /// Releases an object that was allocated using ::IceGrid::SessionPrx::allocateObjectById or ::IceGrid::SessionPrx::allocateObjectByType.
214 /// @param id The identity of the object to release.
215 /// @param context The request context.
216 /// @throws IceGrid::AllocationException Thrown when the object can't be released. This can happen when the object is not
217 /// allocatable or is not allocated by this session.
218 /// @throws IceGrid::ObjectNotRegisteredException Thrown when an object with the given identity is not registered with
219 /// the registry.
220 void releaseObject(const ::Ice::Identity& id, const Ice::Context& context = Ice::noExplicitContext) const;
221
222 /// Releases an object that was allocated using ::IceGrid::SessionPrx::allocateObjectById or ::IceGrid::SessionPrx::allocateObjectByType.
223 /// @param id The identity of the object to release.
224 /// @param context The request context.
225 /// @return A future that becomes available when the invocation completes.
226 [[nodiscard]] std::future<void> releaseObjectAsync(const ::Ice::Identity& id, const Ice::Context& context = Ice::noExplicitContext) const;
227
228 /// Releases an object that was allocated using ::IceGrid::SessionPrx::allocateObjectById or ::IceGrid::SessionPrx::allocateObjectByType.
229 /// @param id The identity of the object to release.
230 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
231 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
232 /// function.
233 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
234 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
235 /// function.
236 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
237 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
238 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
239 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
240 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
241 /// asynchronous case.
242 /// @param context The request context.
243 /// @return A function that can be called to cancel the invocation locally.
244 // NOLINTNEXTLINE(modernize-use-nodiscard)
245 std::function<void()> releaseObjectAsync(const ::Ice::Identity& id, 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;
246
247 /// @private
248 void _iceI_releaseObject(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::Identity&, const Ice::Context&) const;
249
250 /// Sets the allocation timeout. When no object is immediately available for an allocation request, the
251 /// implementation of ::IceGrid::SessionPrx::allocateObjectById and ::IceGrid::SessionPrx::allocateObjectByType waits for the duration of
252 /// this @p timeout.
253 /// @param timeout The timeout in milliseconds.
254 /// @param context The request context.
255 void setAllocationTimeout(std::int32_t timeout, const Ice::Context& context = Ice::noExplicitContext) const;
256
257 /// Sets the allocation timeout. When no object is immediately available for an allocation request, the
258 /// implementation of ::IceGrid::SessionPrx::allocateObjectById and ::IceGrid::SessionPrx::allocateObjectByType waits for the duration of
259 /// this @p timeout.
260 /// @param timeout The timeout in milliseconds.
261 /// @param context The request context.
262 /// @return A future that becomes available when the invocation completes.
263 [[nodiscard]] std::future<void> setAllocationTimeoutAsync(std::int32_t timeout, const Ice::Context& context = Ice::noExplicitContext) const;
264
265 /// Sets the allocation timeout. When no object is immediately available for an allocation request, the
266 /// implementation of ::IceGrid::SessionPrx::allocateObjectById and ::IceGrid::SessionPrx::allocateObjectByType waits for the duration of
267 /// this @p timeout.
268 /// @param timeout The timeout in milliseconds.
269 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
270 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
271 /// function.
272 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
273 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
274 /// function.
275 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
276 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
277 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
278 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
279 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
280 /// asynchronous case.
281 /// @param context The request context.
282 /// @return A function that can be called to cancel the invocation locally.
283 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
284 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
285 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
286 /// callbacks, and the request is sent later, by a flush.
287 // NOLINTNEXTLINE(modernize-use-nodiscard)
288 std::function<void()> setAllocationTimeoutAsync(std::int32_t timeout, 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;
289
290 /// @private
291 void _iceI_setAllocationTimeout(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::int32_t, const Ice::Context&) const;
292
293 /// Gets the type ID of the associated Slice interface.
294 /// @return The string `"::IceGrid::Session"`.
295 static const char* ice_staticId() noexcept;
296
297 /// @private
298 static SessionPrx _fromReference(IceInternal::ReferencePtr ref) { return SessionPrx{std::move(ref)}; }
299
300 protected:
301 /// @private
302 SessionPrx() = default;
303
304 /// @private
305 explicit SessionPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
306 {
307 }
308
309#if defined(__GNUC__) && !defined(__clang__)
310# pragma GCC diagnostic pop
311#endif
312 };
313}
314
315namespace IceGrid
316{
317 /// Represents a session object used by IceGrid clients to allocate and release objects. Client sessions are created
318 /// either via the RegistryPrx object or via the registry client ::Glacier2::SessionManagerPrx object.
319 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::Session`.
320 /// @headerfile IceGrid/IceGrid.h
321 class ICEGRID_API Session : public virtual ::Glacier2::Session
322 {
323 public:
324 /// The associated proxy type.
325 using ProxyType = SessionPrx;
326
327 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
328 /// @param request The incoming request.
329 /// @param sendResponse The callback to send the response.
330 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
331
332 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
333
334 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
335
336 /// Keeps the session alive.
337 /// @param current The Current object of the incoming request.
338 virtual void keepAlive(const Ice::Current& current) = 0;
339
340 /// @private
341 void _iceD_keepAlive(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
342
343 /// Allocates an object.
344 /// @param id The identity of the object to allocate.
345 /// @param current The Current object of the incoming request.
346 /// @return A proxy to the allocated object. This proxy is never null.
347 /// @throws IceGrid::AllocationException Thrown when the allocation fails.
348 /// @throws IceGrid::ObjectNotRegisteredException Thrown when an object with the given identity is not registered with
349 /// the registry.
350 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
351 /// @see ::IceGrid::SessionPrx::releaseObject
352 virtual std::optional<Ice::ObjectPrx> allocateObjectById(::Ice::Identity id, const Ice::Current& current) = 0;
353
354 /// @private
355 void _iceD_allocateObjectById(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
356
357 /// Allocates an object with the given type.
358 /// @param type The type of the object.
359 /// @param current The Current object of the incoming request.
360 /// @return A proxy to the allocated object. This proxy is never null.
361 /// @throws IceGrid::AllocationException Thrown when the allocation fails.
362 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
363 /// @see ::IceGrid::SessionPrx::releaseObject
364 virtual std::optional<Ice::ObjectPrx> allocateObjectByType(std::string type, const Ice::Current& current) = 0;
365
366 /// @private
367 void _iceD_allocateObjectByType(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
368
369 /// Releases an object that was allocated using ::IceGrid::SessionPrx::allocateObjectById or ::IceGrid::SessionPrx::allocateObjectByType.
370 /// @param id The identity of the object to release.
371 /// @param current The Current object of the incoming request.
372 /// @throws IceGrid::AllocationException Thrown when the object can't be released. This can happen when the object is not
373 /// allocatable or is not allocated by this session.
374 /// @throws IceGrid::ObjectNotRegisteredException Thrown when an object with the given identity is not registered with
375 /// the registry.
376 virtual void releaseObject(::Ice::Identity id, const Ice::Current& current) = 0;
377
378 /// @private
379 void _iceD_releaseObject(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
380
381 /// Sets the allocation timeout. When no object is immediately available for an allocation request, the
382 /// implementation of ::IceGrid::SessionPrx::allocateObjectById and ::IceGrid::SessionPrx::allocateObjectByType waits for the duration of
383 /// this @p timeout.
384 /// @param timeout The timeout in milliseconds.
385 /// @param current The Current object of the incoming request.
386 virtual void setAllocationTimeout(std::int32_t timeout, const Ice::Current& current) = 0;
387
388 /// @private
389 void _iceD_setAllocationTimeout(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
390
391 /// Gets the type ID of the associated Slice interface.
392 /// @return The string `"::IceGrid::Session"`.
393 static const char* ice_staticId() noexcept;
394 };
395
396 /// A shared pointer to a Session.
397 using SessionPtr = std::shared_ptr<Session>;
398}
399
400namespace IceGrid
401{
402 /// Represents a session object used by IceGrid clients to allocate and release objects. Client sessions are created
403 /// either via the RegistryPrx object or via the registry client ::Glacier2::SessionManagerPrx object.
404 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceGrid::Session`.
405 /// @headerfile IceGrid/IceGrid.h
406 class ICEGRID_API AsyncSession : public virtual ::Glacier2::AsyncSession
407 {
408 public:
409 /// The associated proxy type.
411
412 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
413 /// @param request The incoming request.
414 /// @param sendResponse The callback to send the response.
415 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
416
417 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
418
419 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
420
421 /// Keeps the session alive.
422 /// @param response The response callback.
423 /// @param exception The exception callback.
424 /// @param current The Current object of the incoming request.
425 virtual void keepAliveAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
426
427 /// @private
428 void _iceD_keepAlive(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
429
430 /// Allocates an object.
431 /// @param id The identity of the object to allocate.
432 /// @param response The response callback. It accepts:
433 /// - A proxy to the allocated object. This proxy is never null.
434 /// @param exception The exception callback.
435 /// @param current The Current object of the incoming request.
436 /// @throws IceGrid::AllocationException Thrown when the allocation fails.
437 /// @throws IceGrid::ObjectNotRegisteredException Thrown when an object with the given identity is not registered with
438 /// the registry.
439 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
440 /// @see ::IceGrid::SessionPrx::releaseObject
441 virtual void allocateObjectByIdAsync(::Ice::Identity id, std::function<void(const std::optional<Ice::ObjectPrx>& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
442
443 /// @private
444 void _iceD_allocateObjectById(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
445
446 /// Allocates an object with the given type.
447 /// @param type The type of the object.
448 /// @param response The response callback. It accepts:
449 /// - A proxy to the allocated object. This proxy is never null.
450 /// @param exception The exception callback.
451 /// @param current The Current object of the incoming request.
452 /// @throws IceGrid::AllocationException Thrown when the allocation fails.
453 /// @see ::IceGrid::SessionPrx::setAllocationTimeout
454 /// @see ::IceGrid::SessionPrx::releaseObject
455 virtual void allocateObjectByTypeAsync(std::string type, std::function<void(const std::optional<Ice::ObjectPrx>& returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
456
457 /// @private
458 void _iceD_allocateObjectByType(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
459
460 /// Releases an object that was allocated using ::IceGrid::SessionPrx::allocateObjectById or ::IceGrid::SessionPrx::allocateObjectByType.
461 /// @param id The identity of the object to release.
462 /// @param response The response callback.
463 /// @param exception The exception callback.
464 /// @param current The Current object of the incoming request.
465 /// @throws IceGrid::AllocationException Thrown when the object can't be released. This can happen when the object is not
466 /// allocatable or is not allocated by this session.
467 /// @throws IceGrid::ObjectNotRegisteredException Thrown when an object with the given identity is not registered with
468 /// the registry.
469 virtual void releaseObjectAsync(::Ice::Identity id, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
470
471 /// @private
472 void _iceD_releaseObject(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
473
474 /// Sets the allocation timeout. When no object is immediately available for an allocation request, the
475 /// implementation of ::IceGrid::SessionPrx::allocateObjectById and ::IceGrid::SessionPrx::allocateObjectByType waits for the duration of
476 /// this @p timeout.
477 /// @param timeout The timeout in milliseconds.
478 /// @param response The response callback.
479 /// @param exception The exception callback.
480 /// @param current The Current object of the incoming request.
481 virtual void setAllocationTimeoutAsync(std::int32_t timeout, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
482
483 /// @private
484 void _iceD_setAllocationTimeout(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
485
486 /// Gets the type ID of the associated Slice interface.
487 /// @return The string `"::IceGrid::Session"`.
488 static const char* ice_staticId() noexcept;
489 };
490
491 /// A shared pointer to an AsyncSession.
492 using AsyncSessionPtr = std::shared_ptr<AsyncSession>;
493}
494
495// NOLINTEND(modernize-concat-nested-namespaces)
496
497#include <Ice/PopDisableWarnings.h>
498#endif
Represents a session between a client application and the Glacier2 router.
Definition Session.h:1291
SessionPrx ProxyType
The associated proxy type.
Definition Session.h:410
virtual void setAllocationTimeoutAsync(std::int32_t timeout, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Sets the allocation timeout.
virtual void allocateObjectByTypeAsync(std::string type, std::function< void(const std::optional< Ice::ObjectPrx > &returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Allocates an object with the given type.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
virtual void allocateObjectByIdAsync(::Ice::Identity id, std::function< void(const std::optional< Ice::ObjectPrx > &returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Allocates an object.
virtual void keepAliveAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Keeps the session alive.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
virtual void releaseObjectAsync(::Ice::Identity id, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Releases an object that was allocated using IceGrid::SessionPrx::allocateObjectById or IceGrid::Sessi...
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.
Represents a session object used by IceGrid clients to allocate and release objects.
Definition Session.h:407
Represents the main entry point into the IceGrid registry service.
Definition Registry.h:323
std::future< std::optional< Ice::ObjectPrx > > allocateObjectByIdAsync(const ::Ice::Identity &id, const Ice::Context &context=Ice::noExplicitContext) const
Allocates an object.
std::optional< Ice::ObjectPrx > allocateObjectById(const ::Ice::Identity &id, const Ice::Context &context=Ice::noExplicitContext) const
Allocates an object.
SessionPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition Session.h:56
std::future< std::optional< Ice::ObjectPrx > > allocateObjectByTypeAsync(std::string_view type, const Ice::Context &context=Ice::noExplicitContext) const
Allocates an object with the given type.
std::function< void()> keepAliveAsync(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
Keeps the session alive.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
SessionPrx(const SessionPrx &other) noexcept
Copy constructor.
Definition Session.h:60
std::future< void > releaseObjectAsync(const ::Ice::Identity &id, const Ice::Context &context=Ice::noExplicitContext) const
Releases an object that was allocated using IceGrid::SessionPrx::allocateObjectById or IceGrid::Sessi...
SessionPrx & operator=(const SessionPrx &rhs) noexcept
Copy assignment operator.
Definition Session.h:71
void releaseObject(const ::Ice::Identity &id, const Ice::Context &context=Ice::noExplicitContext) const
Releases an object that was allocated using IceGrid::SessionPrx::allocateObjectById or IceGrid::Sessi...
void setAllocationTimeout(std::int32_t timeout, const Ice::Context &context=Ice::noExplicitContext) const
Sets the allocation timeout.
std::function< void()> allocateObjectByIdAsync(const ::Ice::Identity &id, std::function< void(std::optional< Ice::ObjectPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Allocates an object.
std::optional< Ice::ObjectPrx > allocateObjectByType(std::string_view type, const Ice::Context &context=Ice::noExplicitContext) const
Allocates an object with the given type.
SessionPrx & operator=(SessionPrx &&rhs) noexcept
Move assignment operator.
Definition Session.h:82
void keepAlive(const Ice::Context &context=Ice::noExplicitContext) const
Keeps the session alive.
std::future< void > setAllocationTimeoutAsync(std::int32_t timeout, const Ice::Context &context=Ice::noExplicitContext) const
Sets the allocation timeout.
SessionPrx(SessionPrx &&other) noexcept
Move constructor.
Definition Session.h:64
std::function< void()> allocateObjectByTypeAsync(std::string_view type, std::function< void(std::optional< Ice::ObjectPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Allocates an object with the given type.
std::future< void > keepAliveAsync(const Ice::Context &context=Ice::noExplicitContext) const
Keeps the session alive.
std::function< void()> setAllocationTimeoutAsync(std::int32_t timeout, 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
Sets the allocation timeout.
std::function< void()> releaseObjectAsync(const ::Ice::Identity &id, 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
Releases an object that was allocated using IceGrid::SessionPrx::allocateObjectById or IceGrid::Sessi...
Represents a session object used by IceGrid clients to allocate and release objects.
Definition Session.h:46
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
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:48
std::shared_ptr< Session > SessionPtr
A shared pointer to a Session.
Definition Session.h:397
std::shared_ptr< AsyncSession > AsyncSessionPtr
A shared pointer to an AsyncSession.
Definition Session.h:492
Deploy and manage Ice servers.
Definition Admin.h:34
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::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
Represents the identity of an Ice object.
Definition Identity.h:41