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 != 30850
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
47#if defined(__GNUC__) && !defined(__clang__)
48# pragma GCC diagnostic push
49# pragma GCC diagnostic ignored "-Wextra"
65 ~SessionPrx()
override;
106 [[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;
109 void _iceI_keepAlive(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&,
const Ice::Context&)
const;
142 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;
145 void _iceI_allocateObjectById(
const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, const ::Ice::Identity&,
const Ice::Context&)
const;
179 void _iceI_allocateObjectByType(
const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, std::string_view,
const Ice::Context&)
const;
207 void _iceI_releaseObject(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::Identity&,
const Ice::Context&)
const;
237 void _iceI_setAllocationTimeout(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::int32_t,
const Ice::Context&)
const;
244 static
SessionPrx _fromReference(IceInternal::ReferencePtr ref) {
return SessionPrx{std::move(ref)}; }
251 explicit SessionPrx(IceInternal::ReferencePtr&& ref) :
Ice::ObjectPrx{std::move(ref)}
255#if defined(__GNUC__) && !defined(__clang__)
256# pragma GCC diagnostic pop
266 class ICEGRID_API Session :
public virtual ::Glacier2::Session
270 using ProxyType = SessionPrx;
275 void dispatch(Ice::IncomingRequest& request, std::function<
void(Ice::OutgoingResponse)> sendResponse)
override;
277 [[nodiscard]] std::vector<std::string> ice_ids(
const Ice::Current& current)
const override;
279 [[nodiscard]] std::string ice_id(
const Ice::Current& current)
const override;
283 virtual void keepAlive(
const Ice::Current& current) = 0;
286 void _iceD_keepAlive(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
299 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;
302 void _iceD_allocateObjectById(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
313 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;
316 void _iceD_allocateObjectByType(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
325 virtual void releaseObject(::Ice::Identity
id,
const Ice::Current& current) = 0;
328 void _iceD_releaseObject(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
335 virtual void setAllocationTimeout(std::int32_t timeout,
const Ice::Current& current) = 0;
338 void _iceD_setAllocationTimeout(Ice::IncomingRequest&, std::function<
void(Ice::OutgoingResponse)>);
342 static const char* ice_staticId() noexcept;
351#include <Ice/PopDisableWarnings.h>
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.
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Provides typed proxy functions.
std::shared_ptr< Session > SessionPtr
A shared pointer to a Session.
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.