Ice 3.7 C++11 API Reference
Communicator.h
Go to the documentation of this file.
1 //
2 // Copyright (c) ZeroC, Inc. All rights reserved.
3 //
4 //
5 // Ice version 3.7.10
6 //
7 // <auto-generated>
8 //
9 // Generated from file `Communicator.ice'
10 //
11 // Warning: do not edit this file.
12 //
13 // </auto-generated>
14 //
15 
16 #ifndef __Ice_Communicator_h__
17 #define __Ice_Communicator_h__
18 
20 #include <Ice/ProxyF.h>
21 #include <Ice/ObjectF.h>
22 #include <Ice/ValueF.h>
23 #include <Ice/Exception.h>
24 #include <Ice/LocalObject.h>
25 #include <Ice/StreamHelpers.h>
26 #include <Ice/Comparable.h>
27 #include <Ice/Proxy.h>
28 #include <Ice/Object.h>
29 #include <Ice/GCObject.h>
30 #include <Ice/Value.h>
31 #include <Ice/Incoming.h>
32 #include <Ice/IncomingAsync.h>
33 #include <Ice/FactoryTableInit.h>
34 #include <IceUtil/ScopedArray.h>
35 #include <Ice/Optional.h>
36 #include <Ice/ExceptionHelpers.h>
37 #include <Ice/LoggerF.h>
38 #include <Ice/InstrumentationF.h>
39 #include <Ice/ObjectAdapterF.h>
40 #include <Ice/ObjectFactory.h>
41 #include <Ice/ValueFactory.h>
42 #include <Ice/Router.h>
43 #include <Ice/Locator.h>
44 #include <Ice/PluginF.h>
45 #include <Ice/ImplicitContextF.h>
46 #include <Ice/Current.h>
47 #include <Ice/Properties.h>
48 #include <Ice/FacetMap.h>
49 #include <Ice/Connection.h>
50 #include <IceUtil/UndefSysMacros.h>
51 
52 #ifndef ICE_IGNORE_VERSION
53 # if ICE_INT_VERSION / 100 != 307
54 # error Ice version mismatch!
55 # endif
56 # if ICE_INT_VERSION % 100 >= 50
57 # error Beta header file detected
58 # endif
59 # if ICE_INT_VERSION % 100 < 10
60 # error Ice patch level mismatch!
61 # endif
62 #endif
63 
64 #ifndef ICE_API
65 # if defined(ICE_STATIC_LIBS)
66 # define ICE_API
67 # elif defined(ICE_API_EXPORTS)
68 # define ICE_API ICE_DECLSPEC_EXPORT
69 # else
70 # define ICE_API ICE_DECLSPEC_IMPORT
71 # endif
72 #endif
73 
74 #ifdef ICE_CPP11_MAPPING // C++11 mapping
75 
76 namespace Ice
77 {
78 
79 class Communicator;
80 
81 }
82 
83 namespace Ice
84 {
85 
91 enum class ToStringMode : unsigned char
92 {
98  Unicode,
105  ASCII,
111  Compat
112 };
113 
114 }
115 
116 namespace Ice
117 {
118 
129 class ICE_CLASS(ICE_API) Communicator
130 {
131 public:
132 
134 
143  virtual void destroy() noexcept = 0;
144 
159  virtual void shutdown() noexcept = 0;
160 
177  virtual void waitForShutdown() noexcept = 0;
178 
184  virtual bool isShutdown() const noexcept = 0;
185 
200  virtual ::std::shared_ptr<::Ice::ObjectPrx> stringToProxy(const ::std::string& str) const = 0;
201 
209  virtual ::std::string proxyToString(const ::std::shared_ptr<ObjectPrx>& obj) const = 0;
210 
223  virtual ::std::shared_ptr<::Ice::ObjectPrx> propertyToProxy(const ::std::string& property) const = 0;
224 
231  virtual ::Ice::PropertyDict proxyToProperty(const ::std::shared_ptr<ObjectPrx>& proxy, const ::std::string& property) const = 0;
232 
242  ICE_DEPRECATED_API("stringToIdentity() is deprecated, use the static stringToIdentity() method instead.") virtual ::Ice::Identity stringToIdentity(const ::std::string& str) const = 0;
243 
250  virtual ::std::string identityToString(const Identity& ident) const = 0;
251 
269  virtual ::std::shared_ptr<::Ice::ObjectAdapter> createObjectAdapter(const ::std::string& name) = 0;
270 
286  virtual ::std::shared_ptr<::Ice::ObjectAdapter> createObjectAdapterWithEndpoints(const ::std::string& name, const ::std::string& endpoints) = 0;
287 
301  virtual ::std::shared_ptr<::Ice::ObjectAdapter> createObjectAdapterWithRouter(const ::std::string& name, const ::std::shared_ptr<RouterPrx>& rtr) = 0;
302 
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;
350 
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;
364 
371  virtual ::std::shared_ptr<::Ice::ImplicitContext> getImplicitContext() const noexcept = 0;
372 
378  virtual ::std::shared_ptr<::Ice::Properties> getProperties() const noexcept = 0;
379 
385  virtual ::std::shared_ptr<::Ice::Logger> getLogger() const noexcept = 0;
386 
391  virtual ::std::shared_ptr<::Ice::Instrumentation::CommunicatorObserver> getObserver() const noexcept = 0;
392 
399  virtual ::std::shared_ptr<::Ice::RouterPrx> getDefaultRouter() const = 0;
400 
414  virtual void setDefaultRouter(const ::std::shared_ptr<RouterPrx>& rtr) = 0;
415 
422  virtual ::std::shared_ptr<::Ice::LocatorPrx> getDefaultLocator() const = 0;
423 
439  virtual void setDefaultLocator(const ::std::shared_ptr<LocatorPrx>& loc) = 0;
440 
446  virtual ::std::shared_ptr<::Ice::PluginManager> getPluginManager() const = 0;
447 
453  virtual ::std::shared_ptr<::Ice::ValueFactoryManager> getValueFactoryManager() const noexcept = 0;
454 
463  virtual void flushBatchRequests(CompressBatch compress)
464  {
465  flushBatchRequestsAsync(compress).get();
466  }
467 
479  virtual ::std::function<void()>
481  ::std::function<void(::std::exception_ptr)> exception,
482  ::std::function<void(bool)> sent = nullptr) = 0;
483 
493  template<template<typename> class P = ::std::promise>
495  -> decltype(::std::declval<P<void>>().get_future())
496  {
497  using Promise = P<void>;
498  auto promise = ::std::make_shared<Promise>();
499  flushBatchRequestsAsync(compress,
500  [promise](::std::exception_ptr ex)
501  {
502  promise->set_exception(::std::move(ex));
503  },
504  [promise](bool)
505  {
506  promise->set_value();
507  });
508  return promise->get_future();
509  }
510 
523  virtual ::std::shared_ptr<::Ice::ObjectPrx> createAdmin(const ::std::shared_ptr<ObjectAdapter>& adminAdapter, const Identity& adminId) = 0;
524 
539  virtual ::std::shared_ptr<::Ice::ObjectPrx> getAdmin() const = 0;
540 
548  virtual void addAdminFacet(const ::std::shared_ptr<Object>& servant, const ::std::string& facet) = 0;
549 
557  virtual ::std::shared_ptr<::Ice::Object> removeAdminFacet(const ::std::string& facet) = 0;
558 
565  virtual ::std::shared_ptr<::Ice::Object> findAdminFacet(const ::std::string& facet) = 0;
566 
574 };
575 
576 }
577 
579 namespace Ice
580 {
581 
582 }
584 
586 namespace Ice
587 {
588 
589 using CommunicatorPtr = ::std::shared_ptr<Communicator>;
590 
591 }
593 
594 #else // C++98 mapping
595 
596 namespace IceProxy
597 {
598 
599 }
600 
601 namespace Ice
602 {
603 
604 class Communicator;
606 ICE_API LocalObject* upCast(Communicator*);
608 typedef ::IceInternal::Handle< Communicator> CommunicatorPtr;
609 
610 }
611 
612 namespace Ice
613 {
614 
620 enum ToStringMode
621 {
627  Unicode,
634  ASCII,
640  Compat
641 };
642 
643 }
644 
646 namespace IceAsync
647 {
648 
649 }
651 
652 namespace Ice
653 {
654 
660 class Callback_Communicator_flushBatchRequests_Base : public virtual ::IceInternal::CallbackBase { };
661 typedef ::IceUtil::Handle< Callback_Communicator_flushBatchRequests_Base> Callback_Communicator_flushBatchRequestsPtr;
662 
663 }
664 
665 namespace IceProxy
666 {
667 
668 }
669 
670 namespace Ice
671 {
672 
683 class ICE_API Communicator : public virtual LocalObject
684 {
685 public:
686 
687  typedef CommunicatorPtr PointerType;
688 
689  virtual ~Communicator();
690 
691 #ifdef ICE_CPP11_COMPILER
692  Communicator() = default;
693  Communicator(const Communicator&) = default;
694  Communicator& operator=(const Communicator&) = default;
695 #endif
696 
705  virtual void destroy() ICE_NOEXCEPT = 0;
706 
721  virtual void shutdown() ICE_NOEXCEPT = 0;
722 
739  virtual void waitForShutdown() ICE_NOEXCEPT = 0;
740 
746  virtual bool isShutdown() const ICE_NOEXCEPT = 0;
747 
762  virtual ObjectPrx stringToProxy(const ::std::string& str) const = 0;
763 
771  virtual ::std::string proxyToString(const ObjectPrx& obj) const = 0;
772 
785  virtual ObjectPrx propertyToProxy(const ::std::string& property) const = 0;
786 
793  virtual PropertyDict proxyToProperty(const ObjectPrx& proxy, const ::std::string& property) const = 0;
794 
804  ICE_DEPRECATED_API("stringToIdentity() is deprecated, use the static stringToIdentity() method instead.") virtual Identity stringToIdentity(const ::std::string& str) const = 0;
805 
812  virtual ::std::string identityToString(const Identity& ident) const = 0;
813 
831  virtual ObjectAdapterPtr createObjectAdapter(const ::std::string& name) = 0;
832 
848  virtual ObjectAdapterPtr createObjectAdapterWithEndpoints(const ::std::string& name, const ::std::string& endpoints) = 0;
849 
863  virtual ObjectAdapterPtr createObjectAdapterWithRouter(const ::std::string& name, const RouterPrx& rtr) = 0;
864 
911  ICE_DEPRECATED_API("addObjectFactory() is deprecated, use ValueFactoryManager::add() instead.") virtual void addObjectFactory(const ObjectFactoryPtr& factory, const ::std::string& id) = 0;
912 
925  ICE_DEPRECATED_API("findObjectFactory() is deprecated, use ValueFactoryManager::find() instead.") virtual ObjectFactoryPtr findObjectFactory(const ::std::string& id) const ICE_NOEXCEPT = 0;
926 
933  virtual ImplicitContextPtr getImplicitContext() const ICE_NOEXCEPT = 0;
934 
940  virtual PropertiesPtr getProperties() const ICE_NOEXCEPT = 0;
941 
947  virtual LoggerPtr getLogger() const ICE_NOEXCEPT = 0;
948 
953  virtual ::Ice::Instrumentation::CommunicatorObserverPtr getObserver() const ICE_NOEXCEPT = 0;
954 
961  virtual RouterPrx getDefaultRouter() const = 0;
962 
976  virtual void setDefaultRouter(const RouterPrx& rtr) = 0;
977 
984  virtual LocatorPrx getDefaultLocator() const = 0;
985 
1001  virtual void setDefaultLocator(const LocatorPrx& loc) = 0;
1002 
1008  virtual PluginManagerPtr getPluginManager() const = 0;
1009 
1015  virtual ValueFactoryManagerPtr getValueFactoryManager() const ICE_NOEXCEPT = 0;
1016 
1025  virtual void flushBatchRequests(CompressBatch compress) = 0;
1026 
1036  virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch compress) = 0;
1037 
1049  virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch compress, const CallbackPtr& cb, const LocalObjectPtr& cookie = 0) = 0;
1050 
1062  virtual AsyncResultPtr begin_flushBatchRequests(CompressBatch compress, const Callback_Communicator_flushBatchRequestsPtr& cb, const LocalObjectPtr& cookie = 0) = 0;
1063 
1071  virtual void end_flushBatchRequests(const AsyncResultPtr& result) = 0;
1072 
1085  virtual ObjectPrx createAdmin(const ObjectAdapterPtr& adminAdapter, const Identity& adminId) = 0;
1086 
1101  virtual ObjectPrx getAdmin() const = 0;
1102 
1110  virtual void addAdminFacet(const ObjectPtr& servant, const ::std::string& facet) = 0;
1111 
1119  virtual ObjectPtr removeAdminFacet(const ::std::string& facet) = 0;
1120 
1127  virtual ObjectPtr findAdminFacet(const ::std::string& facet) = 0;
1128 
1135  virtual FacetMap findAllAdminFacets() = 0;
1136 };
1137 
1139 inline bool operator==(const Communicator& lhs, const Communicator& rhs)
1140 {
1141  return static_cast<const LocalObject&>(lhs) == static_cast<const LocalObject&>(rhs);
1142 }
1143 
1144 inline bool operator<(const Communicator& lhs, const Communicator& rhs)
1145 {
1146  return static_cast<const LocalObject&>(lhs) < static_cast<const LocalObject&>(rhs);
1147 }
1149 
1150 }
1151 
1153 namespace Ice
1154 {
1155 
1156 }
1158 
1159 #endif
1160 
1162 #endif
Ice::LocalObjectPtr
IceInternal::Handle< LocalObject > LocalObjectPtr
Definition: LocalObjectF.h:17
Ice::Properties
A property set used to configure Ice and Ice applications.
Definition: Properties.h:80
Optional.h
Ice::LocatorPrx
The Ice locator interface.
Definition: Locator.h:517
Ice::Communicator::findAdminFacet
virtual ::std::shared_ptr<::Ice::Object > findAdminFacet(const ::std::string &facet)=0
Returns a facet of the Admin object.
Current.h
Ice::Communicator::flushBatchRequestsAsync
virtual ::std::function< void()> flushBatchRequestsAsync(CompressBatch compress, ::std::function< void(::std::exception_ptr)> exception, ::std::function< void(bool)> sent=nullptr)=0
Flush any pending batch requests for this communicator.
StreamHelpers.h
Ice::Communicator::createAdmin
virtual ::std::shared_ptr<::Ice::ObjectPrx > createAdmin(const ::std::shared_ptr< ObjectAdapter > &adminAdapter, const Identity &adminId)=0
Add the Admin object with all its facets to the provided object adapter.
Ice::Communicator::findAllAdminFacets
virtual ::Ice::FacetMap findAllAdminFacets()=0
Returns a map of all facets of the Admin object.
Ice::Communicator::removeAdminFacet
virtual ::std::shared_ptr<::Ice::Object > removeAdminFacet(const ::std::string &facet)=0
Remove the following facet to the Admin object.
Properties.h
ICE_DEPRECATED_API
#define ICE_DEPRECATED_API(msg)
Definition: Config.h:217
Ice::PropertyDict
::std::map<::std::string, ::std::string > PropertyDict
A simple collection of properties, represented as a dictionary of key/value pairs.
Definition: PropertiesAdmin.h:78
Ice::upCast
IceUtil::Shared * upCast(::Ice::LocalObject *)
Ice::Communicator::destroy
virtual void destroy() noexcept=0
Destroy the communicator.
GCObject.h
Ice::Communicator
The central object in Ice.
Definition: Communicator.h:130
ICE_NOEXCEPT
#define ICE_NOEXCEPT
Definition: Config.h:128
Incoming.h
ICE_API
#define ICE_API
Definition: Config.h:197
ICE_MEMBER
#define ICE_MEMBER(API)
Definition: Config.h:177
ObjectFactory.h
Ice::Communicator::addAdminFacet
virtual void addAdminFacet(const ::std::shared_ptr< Object > &servant, const ::std::string &facet)=0
Add a new facet to the Admin object.
ValueFactory.h
FactoryTableInit.h
Ice::ToStringMode
ToStringMode
The output mode for xxxToString method such as identityToString and proxyToString.
Definition: Communicator.h:92
Ice::stringToIdentity
Identity stringToIdentity(const std::string &str)
Converts a stringified identity into an Identity.
Ice::PluginManager
Each communicator has a plug-in manager to administer the set of plug-ins.
Definition: Plugin.h:100
Ice::identityToString
std::string identityToString(const Identity &id, ToStringMode mode=ToStringMode ::Unicode)
Converts an Identity structure into a string using the specified mode.
IncomingAsync.h
PluginF.h
LocalObject.h
PushDisableWarnings.h
Locator.h
Ice::Logger
The Ice message logger.
Definition: Logger.h:71
Ice::ObjectFactory
A factory for objects.
Definition: ObjectFactory.h:74
ProxyF.h
Ice::operator<
bool operator<(const C &lhs, const C &rhs)
Relational operator for generated structs and classes.
Definition: Comparable.h:136
Ice::ValueFactoryManager
A value factory manager maintains a collection of value factories.
Definition: ValueFactory.h:87
Connection.h
Object.h
Proxy.h
UndefSysMacros.h
Ice::FacetMap
::std::map<::std::string, ::std::shared_ptr< Object > > FacetMap
A mapping from facet name to servant.
Definition: FacetMap.h:61
ObjectF.h
Ice
Definition: BuiltinSequences.h:56
Ice::ObjectAdapter
The object adapter provides an up-call interface from the Ice run time to the implementation of Ice o...
Definition: ObjectAdapter.h:90
ImplicitContextF.h
Ice::ObjectPrx
Base class of all object proxies.
Definition: Proxy.h:317
ExceptionHelpers.h
Ice::Communicator::flushBatchRequestsAsync
auto flushBatchRequestsAsync(CompressBatch compress) -> decltype(::std::declval< P< void >>().get_future())
Flush any pending batch requests for this communicator.
Definition: Communicator.h:494
Ice::Communicator::getAdmin
virtual ::std::shared_ptr<::Ice::ObjectPrx > getAdmin() const =0
Get a proxy to the main facet of the Admin object.
InstrumentationF.h
Comparable.h
ScopedArray.h
FacetMap.h
Ice::CompressBatch
CompressBatch
The batch compression option when flushing queued batch requests.
Definition: Connection.h:78
Router.h
Ice::Identity
The identity of an Ice object.
Definition: Identity.h:67
Exception.h
ValueF.h
Ice::Communicator::~Communicator
virtual ~Communicator()
LoggerF.h
Ice::RouterPrx
The Ice router interface.
Definition: Router.h:242
Value.h
Ice::ToStringMode::Unicode
@ Unicode
Characters with ordinal values greater than 127 are kept as-is in the resulting string.
ObjectAdapterF.h
Ice::ImplicitContext
An interface to associate implict contexts with communicators.
Definition: ImplicitContext.h:93
PopDisableWarnings.h