7#ifndef IceGrid_Session_h_
8#define IceGrid_Session_h_
13#include <Glacier2/Session.h>
14#include <IceGrid/Config.h>
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
23# if defined(ICEGRID_API_EXPORTS)
24# define ICEGRID_API ICE_DECLSPEC_EXPORT
26# define ICEGRID_API ICE_DECLSPEC_IMPORT
48#if defined(__GNUC__) && !defined(__clang__)
49# pragma GCC diagnostic push
50# pragma GCC diagnostic ignored "-Wextra"
66 ~SessionPrx()
override;
107 [[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;
110 void _iceI_keepAlive(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&,
const Ice::Context&)
const;
143 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;
146 void _iceI_allocateObjectById(
const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, const ::Ice::Identity&,
const Ice::Context&)
const;
180 void _iceI_allocateObjectByType(
const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, std::string_view,
const Ice::Context&)
const;
208 void _iceI_releaseObject(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::Identity&,
const Ice::Context&)
const;
238 void _iceI_setAllocationTimeout(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::int32_t,
const Ice::Context&)
const;
245 static
SessionPrx _fromReference(IceInternal::ReferencePtr ref) {
return SessionPrx{std::move(ref)}; }
252 explicit SessionPrx(IceInternal::ReferencePtr&& ref) :
Ice::ObjectPrx{std::move(ref)}
256#if defined(__GNUC__) && !defined(__clang__)
257# pragma GCC diagnostic pop
268 class ICEGRID_API Session :
public virtual ::Glacier2::Session
272 using ProxyType = SessionPrx;
277 void dispatch(Ice::IncomingRequest& request, std::function<
void(Ice::OutgoingResponse)> sendResponse)
override;
279 [[nodiscard]] std::vector<std::string> ice_ids(
const Ice::Current& current)
const override;
281 [[nodiscard]] std::string ice_id(
const Ice::Current& current)
const override;
285 virtual void keepAlive(
const Ice::Current& current) = 0;
288 void _iceD_keepAlive(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
299 virtual std::optional<Ice::ObjectPrx> allocateObjectById(::Ice::Identity
id,
const Ice::Current& current) = 0;
302 void _iceD_allocateObjectById(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
311 virtual std::optional<Ice::ObjectPrx> allocateObjectByType(std::string type,
const Ice::Current& current) = 0;
314 void _iceD_allocateObjectByType(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
323 virtual void releaseObject(::Ice::Identity
id,
const Ice::Current& current) = 0;
326 void _iceD_releaseObject(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
333 virtual void setAllocationTimeout(std::int32_t timeout,
const Ice::Current& current) = 0;
336 void _iceD_setAllocationTimeout(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
340 static const char* ice_staticId() noexcept;
372 virtual void keepAliveAsync(std::function<
void()> response, std::function<
void(std::exception_ptr)> exception,
const Ice::Current& current) = 0;
402 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;
444#include <Ice/PopDisableWarnings.h>
Represents a session between a client application and the Glacier2 router.
SessionPrx ProxyType
The associated proxy type.
virtual void setAllocationTimeoutAsync(std::int32_t timeout, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current ¤t)=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 ¤t)=0
Allocates an object with the given type.
std::string ice_id(const Ice::Current ¤t) 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 ¤t)=0
Allocates an object.
virtual void keepAliveAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current ¤t)=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 ¤t)=0
Releases an object that was allocated using IceGrid::SessionPrx::allocateObjectById or IceGrid::Sessi...
std::vector< std::string > ice_ids(const Ice::Current ¤t) 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.
Represents the main entry point into the IceGrid registry service.
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.
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.
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.
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.
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.
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.
Represents a request received by a connection.
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Represents the response to an incoming request.
Provides typed proxy functions.
std::shared_ptr< Session > SessionPtr
A shared pointer to a Session.
std::shared_ptr< AsyncSession > AsyncSessionPtr
A shared pointer to an AsyncSession.
Deploy and manage Ice servers.
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.
Provides information about an incoming request being dispatched.
Represents the identity of an Ice object.