3#ifndef ICE_OBJECT_ADAPTER_H
4#define ICE_OBJECT_ADAPTER_H
6#include "CommunicatorF.h"
9#include "ObjectAdapterF.h"
11#include "ProxyFunctions.h"
12#include "ServantLocator.h"
38 [[nodiscard]]
virtual const std::string&
getName() const noexcept = 0;
105 template<typename Prx =
ObjectPrx, std::enable_if_t<std::is_base_of_v<
ObjectPrx, Prx>,
bool> = true>
120 template<
typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>,
bool> = true>
123 return uncheckedCast<Prx>(_addFacet(std::move(servant), std::move(
id), std::move(facet)));
131 template<
typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>,
bool> = true>
143 template<
typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>,
bool> = true>
255 template<typename Prx =
ObjectPrx, std::enable_if_t<std::is_base_of_v<
ObjectPrx, Prx>,
bool> = true>
265 template<
typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>,
bool> = true>
276 template<
typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>,
bool> = true>
288 [[nodiscard]]
virtual std::optional<LocatorPrx>
getLocator() const noexcept = 0;
Client applications use the Locator object to resolve Ice indirect proxies.
virtual void addServantLocator(ServantLocatorPtr locator, std::string category)=0
Adds a ServantLocator to this object adapter for a specific category.
virtual EndpointSeq getPublishedEndpoints() const =0
Gets the set of endpoints that proxies created by this object adapter will contain.
virtual ObjectPtr remove(const Identity &id)=0
Removes a servant from the object adapter's Active Servant Map.
virtual bool isDeactivated() const noexcept=0
Checks whether or not deactivate was called on this object adapter.
Prx addWithUUID(ObjectPtr servant)
Adds a servant to this object adapter's Active Servant Map (ASM), using an automatically generated UU...
virtual EndpointSeq getEndpoints() const =0
Gets the set of endpoints configured on this object adapter.
virtual CommunicatorPtr getCommunicator() const noexcept=0
Gets the communicator that created this object adapter.
virtual void activate()=0
Starts receiving and dispatching requests received over incoming connections.
virtual ServantLocatorPtr removeServantLocator(std::string_view category)=0
Removes a ServantLocator from this object adapter.
virtual ObjectPtr removeFacet(const Identity &id, std::string_view facet)=0
Removes a servant from the object adapter's Active Servant Map, while specifying a facet.
virtual const ObjectPtr & dispatchPipeline() const noexcept=0
Gets the dispatch pipeline of this object adapter.
virtual void setPublishedEndpoints(EndpointSeq newEndpoints)=0
Sets the endpoints that proxies created by this object adapter will contain.
virtual ObjectPtr removeDefaultServant(std::string_view category)=0
Removes the default servant for a specific category.
virtual void hold()=0
Stops reading requests from incoming connections.
virtual void deactivate() noexcept=0
Deactivates this object adapter: stops accepting new connections from clients and closes gracefully a...
Prx createProxy(Identity id)
Creates a proxy from an Ice identity.
Prx createIndirectProxy(Identity id)
Creates an indirect proxy for an Ice identity.
virtual void destroy() noexcept=0
Destroys this object adapter and cleans up all resources associated with it.
Prx addFacetWithUUID(ObjectPtr servant, std::string facet)
Adds a servant to this object adapter's Active Servant Map (ASM), using an automatically generated UU...
virtual void waitForHold()=0
Waits until the object adapter is in the holding state (see hold) and the dispatch of requests receiv...
Prx createDirectProxy(Identity id)
Creates a direct proxy from an Ice identity.
virtual const std::string & getName() const noexcept=0
Gets the name of this object adapter.
virtual ObjectPtr findFacet(const Identity &id, std::string_view facet) const =0
Looks up a servant with an identity and facet.
Prx addFacet(ObjectPtr servant, Identity id, std::string facet)
Adds a servant to this object adapter's Active Servant Map (ASM), while specifying a facet.
virtual FacetMap findAllFacets(const Identity &id) const =0
Finds all facets for a given identity in the Active Servant Map.
Prx add(const ObjectPtr &servant, const Identity &id)
Adds a servant to this object adapter's Active Servant Map (ASM).
virtual FacetMap removeAllFacets(const Identity &id)=0
Removes all facets with the given identity from the Active Servant Map.
virtual std::optional< LocatorPrx > getLocator() const noexcept=0
Gets the Ice locator used by this object adapter.
virtual ServantLocatorPtr findServantLocator(std::string_view category) const =0
Finds a ServantLocator registered with this object adapter.
virtual void setLocator(std::optional< LocatorPrx > loc)=0
Sets an Ice locator on this object adapter.
virtual void waitForDeactivate() noexcept=0
Waits until deactivate is called on this object adapter and all connections accepted by this object a...
virtual ObjectPtr findDefaultServant(std::string_view category) const =0
Finds the default servant for a specific category.
virtual ObjectPtr find(const Identity &id) const =0
Looks up a servant.
virtual ObjectPtr findByProxy(const ObjectPrx &proxy) const =0
Looks up a servant with an identity and a facet.
virtual void addDefaultServant(ObjectPtr servant, std::string category)=0
Adds a default servant to handle requests for a specific category.
virtual ObjectAdapterPtr use(std::function< ObjectPtr(ObjectPtr)> middlewareFactory)=0
Adds a middleware to the dispatch pipeline of this object adapter.
An object adapter is the main server-side Ice API.
The base class for all Ice proxies.
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
std::shared_ptr< ObjectAdapter > ObjectAdapterPtr
A shared pointer to an ObjectAdapter.
std::vector< EndpointPtr > EndpointSeq
A sequence of endpoints.
Prx uncheckedCast(const ObjectPrx &proxy)
Creates a new proxy from an existing proxy.
std::shared_ptr< ServantLocator > ServantLocatorPtr
A shared pointer to a ServantLocator.
std::shared_ptr< Object > ObjectPtr
A shared pointer to an Object.
std::map< std::string, ObjectPtr, std::less<> > FacetMap
A mapping from facet name to servant.
Represents the identity of an Ice object.