16#ifndef __Ice_Communicator_h__
17#define __Ice_Communicator_h__
52#ifndef ICE_IGNORE_VERSION
53# if ICE_INT_VERSION / 100 != 307
54# error Ice version mismatch!
56# if ICE_INT_VERSION % 100 >= 50
57# error Beta header file detected
59# if ICE_INT_VERSION % 100 < 11
60# error Ice patch level mismatch!
65# if defined(ICE_STATIC_LIBS)
67# elif defined(ICE_API_EXPORTS)
68# define ICE_API ICE_DECLSPEC_EXPORT
70# define ICE_API ICE_DECLSPEC_IMPORT
74#ifdef ICE_CPP11_MAPPING
129class ICE_CLASS(ICE_API) Communicator
143 virtual void destroy() noexcept = 0;
159 virtual
void shutdown() noexcept = 0;
177 virtual
void waitForShutdown() noexcept = 0;
184 virtual
bool isShutdown() const noexcept = 0;
200 virtual ::std::shared_ptr<::Ice::ObjectPrx> stringToProxy(const ::std::
string& str) const = 0;
209 virtual ::std::
string proxyToString(const ::std::shared_ptr<ObjectPrx>& obj) const = 0;
223 virtual ::std::shared_ptr<::Ice::ObjectPrx> propertyToProxy(const ::std::
string& property) const = 0;
231 virtual ::Ice::PropertyDict proxyToProperty(const ::std::shared_ptr<ObjectPrx>& proxy, const ::std::
string& property) const = 0;
242 ICE_DEPRECATED_API(
"stringToIdentity() is deprecated, use the static stringToIdentity() method instead.") virtual ::Ice::Identity stringToIdentity(const ::std::
string& str) const = 0;
250 virtual ::std::
string identityToString(const Identity& ident) const = 0;
269 virtual ::std::shared_ptr<::Ice::ObjectAdapter> createObjectAdapter(const ::std::
string& name) = 0;
286 virtual ::std::shared_ptr<::Ice::ObjectAdapter> createObjectAdapterWithEndpoints(const ::std::
string& name, const ::std::
string& endpoints) = 0;
301 virtual ::std::shared_ptr<::Ice::ObjectAdapter> createObjectAdapterWithRouter(const ::std::
string& name, const ::std::shared_ptr<RouterPrx>& rtr) = 0;
349 ICE_DEPRECATED_API(
"addObjectFactory() is deprecated, use ValueFactoryManager::add() instead.") virtual
void addObjectFactory(const ::std::shared_ptr<ObjectFactory>& factory, const ::std::
string&
id) = 0;
363 ICE_DEPRECATED_API(
"findObjectFactory() is deprecated, use ValueFactoryManager::find() instead.") virtual ::std::shared_ptr<::Ice::ObjectFactory> findObjectFactory(const ::std::
string&
id) const noexcept = 0;
371 virtual ::std::shared_ptr<::Ice::ImplicitContext> getImplicitContext() const noexcept = 0;
378 virtual ::std::shared_ptr<::Ice::Properties> getProperties() const noexcept = 0;
385 virtual ::std::shared_ptr<::Ice::Logger> getLogger() const noexcept = 0;
391 virtual ::std::shared_ptr<::Ice::Instrumentation::CommunicatorObserver> getObserver() const noexcept = 0;
399 virtual ::std::shared_ptr<::Ice::RouterPrx> getDefaultRouter() const = 0;
414 virtual
void setDefaultRouter(const ::std::shared_ptr<RouterPrx>& rtr) = 0;
422 virtual ::std::shared_ptr<::Ice::LocatorPrx> getDefaultLocator() const = 0;
439 virtual
void setDefaultLocator(const ::std::shared_ptr<LocatorPrx>& loc) = 0;
446 virtual ::std::shared_ptr<::Ice::PluginManager> getPluginManager() const = 0;
453 virtual ::std::shared_ptr<::Ice::ValueFactoryManager> getValueFactoryManager() const noexcept = 0;
463 virtual
void flushBatchRequests(CompressBatch compress)
465 flushBatchRequestsAsync(compress).get();
479 virtual ::std::function<void()>
480 flushBatchRequestsAsync(CompressBatch compress,
481 ::std::function<
void(::std::exception_ptr)> exception,
482 ::std::function<
void(
bool)> sent =
nullptr) = 0;
493 template<
template<
typename>
class P = ::std::promise>
494 auto flushBatchRequestsAsync(CompressBatch compress)
495 ->
decltype(::std::declval<P<void>>().get_future())
497 using Promise = P<void>;
498 auto promise = ::std::make_shared<Promise>();
499 flushBatchRequestsAsync(compress,
500 [promise](::std::exception_ptr ex)
502 promise->set_exception(::std::move(ex));
506 promise->set_value();
508 return promise->get_future();
523 virtual ::std::shared_ptr<::Ice::ObjectPrx> createAdmin(const ::std::shared_ptr<ObjectAdapter>& adminAdapter,
const Identity& adminId) = 0;
539 virtual ::std::shared_ptr<::Ice::ObjectPrx> getAdmin()
const = 0;
548 virtual void addAdminFacet(const ::std::shared_ptr<Object>& servant, const ::std::string& facet) = 0;
557 virtual ::std::shared_ptr<::Ice::Object> removeAdminFacet(const ::std::string& facet) = 0;
565 virtual ::std::shared_ptr<::Ice::Object> findAdminFacet(const ::std::string& facet) = 0;
573 virtual ::Ice::FacetMap findAllAdminFacets() = 0;
691#ifdef ICE_CPP11_COMPILER
#define ICE_DEPRECATED_API(msg)
Definition Config.h:217
#define ICE_API
Definition Config.h:197
#define ICE_NOEXCEPT
Definition Config.h:128
#define ICE_MEMBER(API)
Definition Config.h:177
Shared & operator=(const Shared &)
Definition Shared.h:94
Base class for asynchronous callback wrapper classes used for calls to IceProxy::Ice::Communicator::b...
Definition Communicator.h:660
The central object in Ice.
Definition Communicator.h:684
virtual ValueFactoryManagerPtr getValueFactoryManager() const =0
Get the value factory manager for this communicator.
virtual ObjectPtr findAdminFacet(const ::std::string &facet)=0
Returns a facet of the Admin object.
virtual::std::string proxyToString(const ObjectPrx &obj) const =0
Convert a proxy into a string.
virtual bool isShutdown() const =0
Check whether communicator has been shut down.
virtual::std::string identityToString(const Identity &ident) const =0
Convert an identity into a string.
virtual PluginManagerPtr getPluginManager() const =0
Get the plug-in manager for this communicator.
virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch compress)=0
Flush any pending batch requests for this communicator.
virtual ObjectPrx propertyToProxy(const ::std::string &property) const =0
Convert a set of proxy properties into a proxy.
virtual void addObjectFactory(const ObjectFactoryPtr &factory, const ::std::string &id)=0
Add an object factory to this communicator.
virtual ObjectAdapterPtr createObjectAdapter(const ::std::string &name)=0
Create a new object adapter.
CommunicatorPtr PointerType
Definition Communicator.h:687
virtual ObjectPrx getAdmin() const =0
Get a proxy to the main facet of the Admin object.
virtual ObjectPrx createAdmin(const ObjectAdapterPtr &adminAdapter, const Identity &adminId)=0
Add the Admin object with all its facets to the provided object adapter.
virtual PropertiesPtr getProperties() const =0
Get the properties for this communicator.
virtual::Ice::Instrumentation::CommunicatorObserverPtr getObserver() const =0
Get the observer resolver object for this communicator.
virtual void end_flushBatchRequests(const AsyncResultPtr &result)=0
Flush any pending batch requests for this communicator.
virtual void waitForShutdown()=0
Wait until the application has called shutdown (or destroy).
virtual void shutdown()=0
Shuts down this communicator's server functionality, which includes the deactivation of all object ad...
virtual Identity stringToIdentity(const ::std::string &str) const =0
Convert a string into an identity.
virtual void flushBatchRequests(CompressBatch compress)=0
Flush any pending batch requests for this communicator.
virtual LocatorPrx getDefaultLocator() const =0
Get the default locator this communicator.
virtual FacetMap findAllAdminFacets()=0
Returns a map of all facets of the Admin object.
virtual LoggerPtr getLogger() const =0
Get the logger for this communicator.
virtual ObjectAdapterPtr createObjectAdapterWithEndpoints(const ::std::string &name, const ::std::string &endpoints)=0
Create a new object adapter with endpoints.
virtual ObjectFactoryPtr findObjectFactory(const ::std::string &id) const =0
Find an object factory registered with this communicator.
virtual ImplicitContextPtr getImplicitContext() const =0
Get the implicit context associated with this communicator.
virtual void setDefaultLocator(const LocatorPrx &loc)=0
Set a default Ice locator for this communicator.
virtual void setDefaultRouter(const RouterPrx &rtr)=0
Set a default router for this communicator.
virtual ObjectPrx stringToProxy(const ::std::string &str) const =0
Convert a stringified proxy into a proxy.
virtual ObjectAdapterPtr createObjectAdapterWithRouter(const ::std::string &name, const RouterPrx &rtr)=0
Create a new object adapter with a router.
virtual ObjectPtr removeAdminFacet(const ::std::string &facet)=0
Remove the following facet to the Admin object.
virtual void addAdminFacet(const ObjectPtr &servant, const ::std::string &facet)=0
Add a new facet to the Admin object.
virtual RouterPrx getDefaultRouter() const =0
Get the default router this communicator.
virtual PropertyDict proxyToProperty(const ObjectPrx &proxy, const ::std::string &property) const =0
Convert a proxy to a set of proxy properties.
virtual void destroy()=0
Destroy the communicator.
Base class for local Slice classes and interfaces.
Definition LocalObject.h:25
Definition Instrumentation.h:527
Definition BuiltinSequences.h:113
IceInternal::Handle< Object > ObjectPtr
Definition ObjectF.h:21
IceUtil::Handle< ::IceInternal::GenericCallbackBase > CallbackPtr
Definition OutgoingAsync.h:822
IceInternal::ProxyHandle< ::IceProxy::Ice::Object > ObjectPrx
Smart pointer for an object proxy.
Definition ProxyF.h:47
::IceInternal::Handle< ObjectFactory > ObjectFactoryPtr
Definition ObjectFactory.h:128
::IceInternal::Handle< ImplicitContext > ImplicitContextPtr
Definition ImplicitContext.h:170
::std::map< ::std::string, ::std::string > PropertyDict
A simple collection of properties, represented as a dictionary of key/value pairs.
Definition PropertiesAdmin.h:420
::IceInternal::Handle< ValueFactoryManager > ValueFactoryManagerPtr
Definition ValueFactory.h:177
IceInternal::Handle< LocalObject > LocalObjectPtr
Definition LocalObjectF.h:17
::IceInternal::Handle< Properties > PropertiesPtr
Definition Properties.h:256
::std::map< ::std::string, ObjectPtr > FacetMap
A mapping from facet name to servant.
Definition FacetMap.h:73
::IceInternal::Handle< Logger > LoggerPtr
Definition Logger.h:145
::IceInternal::Handle< PluginManager > PluginManagerPtr
Definition Plugin.h:181
ToStringMode
The output mode for xxxToString method such as identityToString and proxyToString.
Definition Communicator.h:621
@ Unicode
Characters with ordinal values greater than 127 are kept as-is in the resulting string.
Definition Communicator.h:627
@ Compat
Characters with ordinal values greater than 127 are encoded as a sequence of UTF-8 bytes using octal ...
Definition Communicator.h:640
@ ASCII
Characters with ordinal values greater than 127 are encoded as universal character names in the resul...
Definition Communicator.h:634
::IceInternal::ProxyHandle< ::IceProxy::Ice::Router > RouterPrx
Definition Router.h:548
IceInternal::Handle< AsyncResult > AsyncResultPtr
Definition AsyncResultF.h:18
CompressBatch
The batch compression option when flushing queued batch requests.
Definition Connection.h:814
::IceInternal::Handle< ObjectAdapter > ObjectAdapterPtr
Definition ObjectAdapter.h:620
::IceInternal::Handle< Communicator > CommunicatorPtr
Definition Communicator.h:608
IceUtil::Shared * upCast(::Ice::AsyncResult *)
::IceInternal::ProxyHandle< ::IceProxy::Ice::Locator > LocatorPrx
Definition Locator.h:1043
::IceUtil::Handle< Callback_Communicator_flushBatchRequests_Base > Callback_Communicator_flushBatchRequestsPtr
Definition Communicator.h:661
The identity of an Ice object.
Definition Identity.h:144