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