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 < 10
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 // C++11 mapping
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;
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;
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;
439 virtual
void setDefaultLocator(const ::std::shared_ptr<
LocatorPrx>& loc) = 0;
465 flushBatchRequestsAsync(compress).get();
479 virtual ::std::function<void()>
481 ::std::function<
void(::std::exception_ptr)> exception,
482 ::std::function<
void(
bool)> sent =
nullptr) = 0;
493 template<
template<
typename>
class P = ::std::promise>
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;
565 virtual ::std::shared_ptr<::Ice::Object>
findAdminFacet(const ::std::string& facet) = 0;
589 using CommunicatorPtr = ::std::shared_ptr<Communicator>;
594 #else // C++98 mapping
608 typedef ::IceInternal::Handle< Communicator> CommunicatorPtr;
660 class Callback_Communicator_flushBatchRequests_Base :
public virtual ::IceInternal::CallbackBase { };
661 typedef ::IceUtil::Handle< Callback_Communicator_flushBatchRequests_Base> Callback_Communicator_flushBatchRequestsPtr;
683 class ICE_API Communicator :
public virtual LocalObject
687 typedef CommunicatorPtr PointerType;
689 virtual ~Communicator();
691 #ifdef ICE_CPP11_COMPILER
692 Communicator() =
default;
693 Communicator(
const Communicator&) =
default;
694 Communicator& operator=(
const Communicator&) =
default;
762 virtual ObjectPrx stringToProxy(const ::std::
string& str) const = 0;
771 virtual ::std::
string proxyToString(const ObjectPrx& obj) const = 0;
785 virtual ObjectPrx propertyToProxy(const ::std::
string& property) const = 0;
793 virtual
PropertyDict proxyToProperty(const ObjectPrx& proxy, const ::std::
string& property) const = 0;
831 virtual ObjectAdapterPtr createObjectAdapter(const ::std::
string& name) = 0;
848 virtual ObjectAdapterPtr createObjectAdapterWithEndpoints(const ::std::
string& name, const ::std::
string& endpoints) = 0;
863 virtual ObjectAdapterPtr createObjectAdapterWithRouter(const ::std::
string& name, const RouterPrx& rtr) = 0;
911 ICE_DEPRECATED_API("addObjectFactory() is deprecated, use ValueFactoryManager::add() instead.") virtual
void addObjectFactory(const ObjectFactoryPtr& factory, const ::std::
string&
id) = 0;
925 ICE_DEPRECATED_API("findObjectFactory() is deprecated, use ValueFactoryManager::find() instead.") virtual ObjectFactoryPtr findObjectFactory(const ::std::
string&
id) const
ICE_NOEXCEPT = 0;
933 virtual ImplicitContextPtr getImplicitContext() const
ICE_NOEXCEPT = 0;
940 virtual PropertiesPtr getProperties() const
ICE_NOEXCEPT = 0;
953 virtual ::
Ice::Instrumentation::CommunicatorObserverPtr getObserver() const
ICE_NOEXCEPT = 0;
961 virtual RouterPrx getDefaultRouter() const = 0;
976 virtual
void setDefaultRouter(const RouterPrx& rtr) = 0;
984 virtual LocatorPrx getDefaultLocator() const = 0;
1001 virtual
void setDefaultLocator(const LocatorPrx& loc) = 0;
1008 virtual PluginManagerPtr getPluginManager() const = 0;
1015 virtual ValueFactoryManagerPtr getValueFactoryManager() const
ICE_NOEXCEPT = 0;
1025 virtual
void flushBatchRequests(
CompressBatch compress) = 0;
1036 virtual AsyncResultPtr begin_flushBatchRequests(
CompressBatch compress) = 0;
1049 virtual AsyncResultPtr begin_flushBatchRequests(
CompressBatch compress, const CallbackPtr& cb, const
LocalObjectPtr& cookie = 0) = 0;
1062 virtual AsyncResultPtr begin_flushBatchRequests(
CompressBatch compress, const Callback_Communicator_flushBatchRequestsPtr& cb, const
LocalObjectPtr& cookie = 0) = 0;
1071 virtual
void end_flushBatchRequests(const AsyncResultPtr& result) = 0;
1085 virtual ObjectPrx createAdmin(const ObjectAdapterPtr& adminAdapter, const Identity& adminId) = 0;
1101 virtual ObjectPrx getAdmin() const = 0;
1110 virtual
void addAdminFacet(const ObjectPtr& servant, const ::std::
string& facet) = 0;
1119 virtual ObjectPtr removeAdminFacet(const ::std::
string& facet) = 0;
1127 virtual ObjectPtr findAdminFacet(const ::std::
string& facet) = 0;
1135 virtual
FacetMap findAllAdminFacets() = 0;
1139 inline
bool operator==(const Communicator& lhs, const Communicator& rhs)
1141 return static_cast<const LocalObject&
>(lhs) ==
static_cast<const LocalObject&
>(rhs);
1144 inline bool operator<(
const Communicator& lhs,
const Communicator& rhs)
1146 return static_cast<const LocalObject&
>(lhs) <
static_cast<const LocalObject&
>(rhs);