7#ifndef IceBox_ServiceManager_h_
8#define IceBox_ServiceManager_h_
12#include <Ice/BuiltinSequences.h>
13#include <IceBox/Config.h>
15#ifndef ICE_DISABLE_VERSION
16# if ICE_INT_VERSION != 30850
17# error Ice version mismatch: an exact match is required for beta generated code
22# if defined(ICEBOX_API_EXPORTS)
23# define ICEBOX_API ICE_DECLSPEC_EXPORT
25# define ICEBOX_API ICE_DECLSPEC_IMPORT
61 ~ServiceObserverPrx()
override;
108 void _iceI_servicesStarted(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::StringSeq&,
const Ice::Context&)
const;
132 void _iceI_servicesStopped(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::StringSeq&,
const Ice::Context&)
const;
169 ~ServiceManagerPrx()
override;
218 void _iceI_startService(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view,
const Ice::Context&)
const;
244 void _iceI_stopService(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view,
const Ice::Context&)
const;
265 std::function<void()>
addObserverAsync(
const std::optional<ServiceObserverPrx>& observer, 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;
268 void _iceI_addObserver(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&,
const std::optional<ServiceObserverPrx>&,
const Ice::Context&)
const;
289 void _iceI_shutdown(
const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&,
const Ice::Context&)
const;
320 [[nodiscard]] const
char*
ice_id() const noexcept override;
326 void _writeImpl(
Ice::OutputStream*) const override;
329 void _readImpl(
Ice::InputStream*) override;
341 [[nodiscard]] const
char*
ice_id() const noexcept override;
347 void _writeImpl(
Ice::OutputStream*) const override;
350 void _readImpl(
Ice::InputStream*) override;
362 [[nodiscard]] const
char*
ice_id() const noexcept override;
368 void _writeImpl(
Ice::OutputStream*) const override;
371 void _readImpl(
Ice::InputStream*) override;
422 class ICEBOX_API ServiceManager : public virtual
Ice::Object
433 [[nodiscard]] std::vector<std::string> ice_ids(
const Ice::Current& current)
const override;
435 [[nodiscard]] std::string ice_id(
const Ice::Current& current)
const override;
442 virtual void startService(std::string service,
const Ice::Current& current) = 0;
452 virtual void stopService(std::string service,
const Ice::Current& current) = 0;
460 virtual void addObserver(std::optional<ServiceObserverPrx> observer,
const Ice::Current& current) = 0;
474 static const char* ice_staticId()
noexcept;
const char * ice_id() const noexcept override
Returns the type ID of this exception.
void ice_throw() const override
Throws this exception.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
The exception that is thrown when attempting to start a service that is already running.
void ice_throw() const override
Throws this exception.
const char * ice_id() const noexcept override
Returns the type ID of this exception.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
The exception that is thrown when attempting to stop a service that is already stopped.
const char * ice_id() const noexcept override
Returns the type ID of this exception.
void ice_throw() const override
Throws this exception.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
The exception that is thrown when a service name does not refer to a known service.
std::function< void()> addObserverAsync(const std::optional< ServiceObserverPrx > &observer, 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
Registers a new observer with this service manager.
void stopService(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Stops a service.
std::function< void()> stopServiceAsync(std::string_view service, 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
Stops a service.
ServiceManagerPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
ServiceManagerPrx & operator=(const ServiceManagerPrx &rhs) noexcept
Copy assignment operator.
void shutdown(const Ice::Context &context=Ice::noExplicitContext) const
Shuts down all services.
std::future< void > shutdownAsync(const Ice::Context &context=Ice::noExplicitContext) const
Shuts down all services.
std::function< void()> startServiceAsync(std::string_view service, 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
Starts a service.
std::future< void > startServiceAsync(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Starts a service.
ServiceManagerPrx(const ServiceManagerPrx &other) noexcept
Copy constructor.
std::function< void()> shutdownAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Shuts down all services.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
void startService(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Starts a service.
void addObserver(const std::optional< ServiceObserverPrx > &observer, const Ice::Context &context=Ice::noExplicitContext) const
Registers a new observer with this service manager.
std::future< void > stopServiceAsync(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Stops a service.
std::future< void > addObserverAsync(const std::optional< ServiceObserverPrx > &observer, const Ice::Context &context=Ice::noExplicitContext) const
Registers a new observer with this service manager.
ServiceManagerPrx & operator=(ServiceManagerPrx &&rhs) noexcept
Move assignment operator.
ServiceManagerPrx(ServiceManagerPrx &&other) noexcept
Move constructor.
Administers the services of an IceBox server.
std::future< void > servicesStoppedAsync(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were stopped.
std::future< void > servicesStartedAsync(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were started.
ServiceObserverPrx(ServiceObserverPrx &&other) noexcept
Move constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
ServiceObserverPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
void servicesStopped(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were stopped.
ServiceObserverPrx & operator=(ServiceObserverPrx &&rhs) noexcept
Move assignment operator.
ServiceObserverPrx(const ServiceObserverPrx &other) noexcept
Copy constructor.
std::function< void()> servicesStoppedAsync(const ::Ice::StringSeq &services, 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
Receives the names of the services that were stopped.
std::function< void()> servicesStartedAsync(const ::Ice::StringSeq &services, 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
Receives the names of the services that were started.
void servicesStarted(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were started.
ServiceObserverPrx & operator=(const ServiceObserverPrx &rhs) noexcept
Copy assignment operator.
Observes the status of services in an IceBox server.
virtual void servicesStarted(::Ice::StringSeq services, const Ice::Current ¤t)=0
Receives the names of the services that were started.
virtual void servicesStopped(::Ice::StringSeq services, const Ice::Current ¤t)=0
Receives the names of the services that were stopped.
std::vector< std::string > ice_ids(const Ice::Current ¤t) const override
Gets the Slice interfaces supported by this object as a list of type IDs.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
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,...
ServiceObserverPrx ProxyType
The associated proxy 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.
Observes the status of services in an IceBox server.
Represents a request received by a connection.
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
The base class for servants.
Represents the response to an incoming request.
Provides typed proxy functions.
Abstract base class for all Ice exceptions defined in Slice.
std::shared_ptr< ServiceManager > ServiceManagerPtr
A shared pointer to a ServiceManager.
std::shared_ptr< ServiceObserver > ServiceObserverPtr
A shared pointer to a ServiceObserver.
Host multiple independent services in the same Ice server.
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::vector< std::string > StringSeq
A sequence of strings.
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.