Ice 3.9
C++ API Reference
Loading...
Searching...
No Matches
Communicator.h
1// Copyright (c) ZeroC, Inc.
2
3#ifndef ICE_COMMUNICATOR_H
4#define ICE_COMMUNICATOR_H
5
6#include "CommunicatorF.h"
7#include "Config.h"
8#include "Connection.h"
9#include "FacetMap.h"
10#include "ImplicitContext.h"
11#include "Initialize.h"
12#include "InstanceF.h"
13#include "Plugin.h"
14#include "Properties.h"
15#include "Proxy.h"
16#include "SSL/ServerAuthenticationOptions.h"
17
18namespace Ice
19{
20 class LocatorPrx;
21 class RouterPrx;
22
23 /// Communicator is the central object in Ice. Its responsibilities include:
24 /// - creating and managing outgoing connections
25 /// - executing callbacks in its client thread pool
26 /// - creating and destroying object adapters
27 /// - loading plug-ins
28 /// - managing properties (configuration), retries, logging, instrumentation, and more.
29 /// You create a communicator with `Ice::initialize`, and it's usually the first object you create when programming
30 /// with Ice. You can create multiple communicators in a single program, but this is not common.
31 /// @see ::initialize(InitializationData)
32 /// @headerfile Ice/Ice.h
33 class ICE_API Communicator final : public std::enable_shared_from_this<Communicator>
34 {
35 public:
36 ~Communicator();
37
38 /// Destroys this communicator. This function calls #shutdown implicitly. Calling this function destroys all
39 /// object adapters, and closes all outgoing connections. This function waits for all outstanding dispatches to
40 /// complete before returning. This includes "bidirectional dispatches" that execute on outgoing connections.
41 /// @see CommunicatorHolder
42 void destroy() noexcept;
43
44 /// Destroys this communicator asynchronously.
45 /// @param completed If not @c nullptr, this callback is called when the destruction is complete. It must not
46 /// throw any exception.
47 /// @remark This function starts a thread to call #destroy and @p completed unless you call this function on a
48 /// communicator that has already been destroyed, in which case @p completed is called by the current thread.
49 /// @see #destroy
50 void destroyAsync(std::function<void()> completed) noexcept;
51
52 /// Shuts down this communicator. This function calls ObjectAdapter::deactivate on all object adapters created
53 /// by this communicator. Shutting down a communicator has no effect on outgoing connections.
54 /// @see #waitForShutdown
55 /// @see ObjectAdapter::deactivate
56 void shutdown() noexcept;
57
58 /// Waits for shutdown to complete. This function calls ObjectAdapter::waitForDeactivate on all object adapters
59 /// created by this communicator. In a client application that does not accept incoming connections, this
60 /// function returns as soon as another thread calls #shutdown or #destroy on this communicator.
61 /// @see #shutdown
62 void waitForShutdown() noexcept;
63
64 /// Waits until this communicator is shut down.
65 /// @param completed The callback to call when the shutdown is complete. This function must not throw any
66 /// exception.
67 /// @remark The callback is usually called by a dedicated background thread. It can also be called by the
68 /// current thread when the shutdown has already completed.
69 /// @see #shutdown
70 void waitForShutdownAsync(std::function<void()> completed) noexcept;
71
72 /// Checks whether or not #shutdown was called on this communicator.
73 /// @return `true` if #shutdown was called on this communicator, `false` otherwise.
74 /// @see #shutdown
75 [[nodiscard]] bool isShutdown() const noexcept;
76
77 /// Converts a stringified proxy into a proxy.
78 /// @tparam Prx The type of the proxy to return.
79 /// @param str The stringified proxy to convert into a proxy.
80 /// @return The proxy, or nullopt if @p str is an empty string.
81 /// @throws ParseException Thrown when @p str is not a valid proxy string.
82 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
83 /// @see #proxyToString
84 template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>, bool> = true>
85 std::optional<Prx> stringToProxy(std::string_view str) const
86 {
87 auto reference = _stringToProxy(str);
88 if (reference)
89 {
90 return Prx::_fromReference(reference);
91 }
92 else
93 {
94 return std::nullopt;
95 }
96 }
97
98 /// Converts a proxy into a string.
99 /// @param obj The proxy to convert into a stringified proxy.
100 /// @return The stringified proxy, or an empty string if `obj` is nullopt.
101 /// @see #stringToProxy
102 std::string proxyToString(const std::optional<ObjectPrx>& obj) const;
103
104 /// Converts a set of proxy properties into a proxy. The "base" name supplied in the @p property argument refers
105 /// to a property containing a stringified proxy, such as `MyProxy=id:tcp -h localhost -p 10000`.
106 /// Additional properties configure local settings for the proxy.
107 /// @tparam Prx The type of the proxy to return.
108 /// @param property The base property name.
109 /// @return The proxy, or nullopt if the property is not set.
110 /// @throws ParseException Thrown when the property value is not a valid proxy string.
111 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
112 template<typename Prx = ObjectPrx, std::enable_if_t<std::is_base_of_v<ObjectPrx, Prx>, bool> = true>
113 std::optional<Prx> propertyToProxy(std::string_view property) const
114 {
115 auto reference = _propertyToProxy(property);
116 if (reference)
117 {
118 return Prx::_fromReference(reference);
119 }
120 else
121 {
122 return std::nullopt;
123 }
124 }
125
126 /// Converts a proxy into a set of proxy properties.
127 /// @param proxy The proxy.
128 /// @param property The base property name.
129 /// @return The property set.
130 PropertyDict proxyToProperty(const std::optional<ObjectPrx>& proxy, std::string property) const;
131
132 /// Converts an identity into a string.
133 /// @param ident The identity to convert into a string.
134 /// @return The "stringified" identity.
135 [[nodiscard]] std::string identityToString(const Identity& ident) const;
136
137 /// Creates a new object adapter. The endpoints for the object adapter are taken from the property
138 /// `name.Endpoints`.
139 /// It is legal to create an object adapter with the empty string as its name. Such an object adapter is
140 /// accessible via bidirectional connections or by collocated invocations.
141 /// @param name The object adapter name.
142 /// @param serverAuthenticationOptions The SSL options for server connections.
143 /// @return The new object adapter.
144 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
145 /// @see #createObjectAdapterWithEndpoints
146 /// @see ObjectAdapter
147 /// @see Properties
148 /// @see SSL::OpenSSLServerAuthenticationOptions
149 /// @see SSL::SecureTransportServerAuthenticationOptions
150 /// @see SSL::SchannelServerAuthenticationOptions
152 std::string name,
153 std::optional<SSL::ServerAuthenticationOptions> serverAuthenticationOptions = std::nullopt);
154
155 /// Creates a new object adapter with endpoints. This function sets the property `name.Endpoints`, and then
156 /// calls #createObjectAdapter. It is provided as a convenience function. Calling this function with an empty
157 /// name will result in a UUID being generated for the name.
158 /// @param name The object adapter name.
159 /// @param endpoints The endpoints of the object adapter.
160 /// @param serverAuthenticationOptions The SSL options for server connections.
161 /// @return The new object adapter.
162 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
163 /// @see #createObjectAdapter
164 /// @see Properties
165 /// @see SSL::OpenSSLServerAuthenticationOptions
166 /// @see SSL::SecureTransportServerAuthenticationOptions
167 /// @see SSL::SchannelServerAuthenticationOptions
169 std::string name,
170 std::string_view endpoints,
171 std::optional<SSL::ServerAuthenticationOptions> serverAuthenticationOptions = std::nullopt);
172
173 /// Creates a new object adapter with a router. This function creates a routed object adapter. Calling this
174 /// function with an empty name will result in a UUID being generated for the name.
175 /// @param name The object adapter name.
176 /// @param rtr The router.
177 /// @return The new object adapter.
178 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
179 /// @see #createObjectAdapter
180 /// @see Properties
182
183 /// Gets the object adapter that is associated by default with new outgoing connections created by this
184 /// communicator. This function returns `nullptr` unless you set a non-null default object adapter using
185 /// #setDefaultObjectAdapter.
186 /// @return The object adapter associated by default with new outgoing connections.
187 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
188 /// @see Connection::getAdapter
190
191 /// Sets the object adapter that will be associated with new outgoing connections created by this
192 /// communicator. This function has no effect on existing outgoing connections, or on incoming connections.
193 /// @param adapter The object adapter to associate with new outgoing connections.
194 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
195 /// @see Connection::setAdapter
197
198 /// Gets the implicit context associated with this communicator.
199 /// @return The implicit context associated with this communicator; returns `nullptr` when the property
200 /// `Ice.ImplicitContext` is not set or is set to `None`.
201 [[nodiscard]] ImplicitContextPtr getImplicitContext() const noexcept;
202
203 /// Gets the properties of this communicator.
204 /// @return This communicator's properties.
205 [[nodiscard]] PropertiesPtr getProperties() const noexcept;
206
207 /// Gets the logger of this communicator.
208 /// @return This communicator's logger.
209 [[nodiscard]] LoggerPtr getLogger() const noexcept;
210
211 /// Adds a Slice loader to this communicator, after the Slice loader set in InitializationData (if any) and
212 /// after other Slice loaders added by this function.
213 /// @param loader The Slice loader to add.
214 /// @remarks This function is not thread-safe and should only be called right after the communicator is created.
215 /// It's provided for applications that cannot set the Slice loader in the InitializationData of the
216 /// communicator, such as IceBox services.
217 void addSliceLoader(SliceLoaderPtr loader) noexcept;
218
219 /// Gets the observer object of this communicator.
220 /// @return This communicator's observer object.
221 [[nodiscard]] Instrumentation::CommunicatorObserverPtr getObserver() const noexcept;
222
223 /// Gets the default router of this communicator.
224 /// @return The default router of this communicator.
225 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
226 /// @see #setDefaultRouter
227 [[nodiscard]] std::optional<RouterPrx> getDefaultRouter() const;
228
229 /// Sets the default router of this communicator. All newly created proxies will use this default router. This
230 /// function has no effect on existing proxies.
231 /// @param rtr The new default router. Use `nullopt` to remove the default router.
232 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
233 /// @see #getDefaultRouter
234 /// @see #createObjectAdapterWithRouter
235 /// @see Router
236 void setDefaultRouter(const std::optional<RouterPrx>& rtr);
237
238 /// Gets the default locator of this communicator.
239 /// @return The default locator of this communicator.
240 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
241 /// @see #setDefaultLocator
242 /// @see Locator
243 [[nodiscard]] std::optional<Ice::LocatorPrx> getDefaultLocator() const;
244
245 /// Sets the default locator of this communicator. All newly created proxies will use this default locator.
246 /// This function has no effect on existing proxies or object adapters.
247 /// @param loc The new default locator. Use `nullopt` to remove the default locator.
248 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
249 /// @see #getDefaultLocator
250 /// @see Locator
251 /// @see ObjectAdapter#setLocator
252 void setDefaultLocator(const std::optional<LocatorPrx>& loc);
253
254 /// Gets the plug-in manager of this communicator.
255 /// @return This communicator's plug-in manager.
256 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
257 /// @see PluginManager
258 [[nodiscard]] PluginManagerPtr getPluginManager() const;
259
260 /// Flushes any pending batch requests of this communicator. This means all batch requests invoked on fixed
261 /// proxies for all connections associated with the communicator. Errors that occur while flushing a connection
262 /// are ignored.
263 /// @param compress Specifies whether or not the queued batch requests should be compressed before being sent
264 /// over the wire.
265 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
267
268 /// Flushes any pending batch requests of this communicator. This means all batch requests invoked on fixed
269 /// proxies for all connections associated with the communicator. Errors that occur while flushing a connection
270 /// are ignored.
271 /// @param compress Specifies whether or not the queued batch requests should be compressed before being sent
272 /// over the wire.
273 /// @param exception The exception callback. The Ice runtime never calls this function: errors that occur
274 /// while flushing a connection are ignored.
275 /// @param sent The sent callback. The Ice runtime calls this function when the flush completes for all
276 /// connections; since errors are ignored, a flush that fails on a connection is complete for this connection.
277 /// When the flush completes synchronously, the Ice runtime calls this function from the current thread and
278 /// passes `true` as argument. Otherwise, the Ice runtime calls this function from an Ice thread pool thread
279 /// and passes `false` as argument. If you set InitializationData::executor, the executor determines the
280 /// thread that executes this function in the asynchronous case.
281 /// @return A function that can be called to cancel the flush.
282 /// @throws CommunicatorDestroyedException Thrown synchronously when the communicator has been destroyed.
283 std::function<void()> flushBatchRequestsAsync(
284 CompressBatch compress,
285 std::function<void(std::exception_ptr)> exception,
286 std::function<void(bool)> sent = nullptr);
287
288 /// Flushes any pending batch requests of this communicator. This means all batch requests invoked on fixed
289 /// proxies for all connections associated with the communicator. Errors that occur while flushing a connection
290 /// are ignored.
291 /// @param compress Specifies whether or not the queued batch requests should be compressed before being sent
292 /// over the wire.
293 /// @return A future that becomes available when all batch requests have been sent.
294 /// @throws CommunicatorDestroyedException Thrown synchronously when the communicator has been destroyed.
295 [[nodiscard]] std::future<void> flushBatchRequestsAsync(CompressBatch compress);
296
297 /// Adds the Admin object with all its facets to the provided object adapter. If `Ice.Admin.ServerId`
298 /// is set and the provided object adapter has a Locator, this function registers the Admin's Process facet with
299 /// the Locator's LocatorRegistry.
300 /// @param adminAdapter The object adapter used to host the Admin object; if it is null and
301 /// `Ice.Admin.Endpoints` is set, this function uses the `Ice.Admin` object adapter, after creating and
302 /// activating this adapter.
303 /// @param adminId The identity of the Admin object.
304 /// @return A proxy to the main ("") facet of the Admin object.
305 /// @throws InitializationException Thrown when this function is called more than once.
306 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
307 /// @see #getAdmin
308 ObjectPrx createAdmin(const ObjectAdapterPtr& adminAdapter, const Identity& adminId);
309
310 /// Gets a proxy to the main facet of the Admin object. #getAdmin also creates the Admin object and creates and
311 /// activates the `Ice.Admin` object adapter to host this Admin object if `Ice.Admin.Endpoints` is set. The
312 /// identity of the Admin object created by getAdmin is `{value of Ice.Admin.InstanceName}/admin`, or
313 /// `{UUID}/admin` when `Ice.Admin.InstanceName` is not set. If `Ice.Admin.DelayCreation` is `0` or not set,
314 /// #getAdmin is called by the communicator initialization, after initialization of all plugins.
315 /// @return A proxy to the main ("") facet of the Admin object, or nullopt if no Admin object is configured.
316 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
317 /// @see #createAdmin
318 std::optional<ObjectPrx> getAdmin() const; // NOLINT(modernize-use-nodiscard)
319
320 /// Adds a new facet to the Admin object.
321 /// @param servant The servant that implements the new Admin facet.
322 /// @param facet The name of the new Admin facet.
323 /// @throws AlreadyRegisteredException Thrown when a facet with the same name is already registered.
324 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
325 void addAdminFacet(ObjectPtr servant, std::string facet);
326
327 /// Removes a facet from the Admin object.
328 /// @param facet The name of the Admin facet.
329 /// @return The servant associated with this Admin facet.
330 /// @throws NotRegisteredException Thrown when no facet with the given name is registered.
331 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
332 ObjectPtr removeAdminFacet(std::string_view facet);
333
334 /// Returns a facet of the Admin object.
335 /// @tparam T The type of the facet to return.
336 /// @param facet The name of the Admin facet.
337 /// @return The servant associated with this Admin facet, or null if no facet is registered with the given name.
338 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
339 template<typename T = Object, std::enable_if_t<std::is_base_of_v<Object, T>, bool> = true>
340 std::shared_ptr<T> findAdminFacet(std::string_view facet)
341 {
342 return std::dynamic_pointer_cast<T>(_findAdminFacet(facet));
343 }
344
345 /// Returns a map of all facets of the Admin object.
346 /// @return A collection containing all the facet names and servants of the Admin object.
347 /// @throws CommunicatorDestroyedException Thrown when the communicator has been destroyed.
348 /// @see #findAdminFacet
350
351 private:
352 Communicator() = default;
353
354 static CommunicatorPtr create(InitializationData);
355
356 // Certain initialization tasks need to be completed after the constructor.
357 void finishSetup();
358
359 [[nodiscard]] IceInternal::ReferencePtr _stringToProxy(std::string_view str) const;
360 [[nodiscard]] IceInternal::ReferencePtr _propertyToProxy(std::string_view property) const;
361 [[nodiscard]] ObjectPtr _findAdminFacet(std::string_view facet);
362
363 /// @cond INTERNAL
364 friend ICE_API_FRIEND CommunicatorPtr initialize(int&, const char*[], InitializationData);
365 friend ICE_API_FRIEND CommunicatorPtr initialize(InitializationData);
366 /// @endcond
367
368 friend ICE_API_FRIEND IceInternal::InstancePtr IceInternal::getInstance(const Ice::CommunicatorPtr&);
369 friend ICE_API_FRIEND IceInternal::TimerPtr IceInternal::getInstanceTimer(const Ice::CommunicatorPtr&);
370
371 const IceInternal::InstancePtr _instance;
372 };
373
374 /// A helper class that uses Resource Acquisition Is Initialization (RAII) to hold a communicator instance, and
375 /// automatically destroy this instance when the holder goes out of scope.
376 /// @headerfile Ice/Ice.h
377 class ICE_API CommunicatorHolder
378 {
379 public:
380 /// Default constructor.
382
383 /// Constructs a CommunicatorHolder that adopts an existing communicator.
384 /// @param communicator The communicator to adopt.
386
387 /// Constructs a CommunicatorHolder for a new communicator created using an `Ice::initialize` overload.
388 /// @tparam T The types of the arguments to pass to the `Ice::initialize` function.
389 /// @param args The arguments to pass to the `Ice::initialize` function.
390 template<class... T>
391 explicit CommunicatorHolder(T&&... args) : _communicator(std::move(initialize(std::forward<T>(args)...)))
392 {
393 }
394
395 /// Move constructor. Constructs a CommunicatorHolder with the contents of @p other using move semantics.
396 /// @param other The holder to move from.
398
399 CommunicatorHolder(const CommunicatorHolder&) = delete;
400
401 /// Assignment operator. Destroys the current communicator (if any) and adopts a new communicator.
402 /// @param communicator The communicator to adopt.
404
405 CommunicatorHolder& operator=(const CommunicatorHolder&) noexcept = delete;
406
407 /// Move assignment operator. Destroys the current communicator (if any) and adopts a new communicator.
408 /// @param holder The holder from which to adopt a communicator.
410
411 /// Determines whether this holder holds a communicator.
412 /// @return `true` if the holder currently holds a communicator, `false` otherwise.
413 explicit operator bool() const noexcept { return _communicator != nullptr; }
414
416
417 /// Gets the communicator.
418 /// @return The communicator held by this holder, or nullptr if the holder is empty.
419 [[nodiscard]] const CommunicatorPtr& communicator() const noexcept { return _communicator; }
420
421 /// Gets the communicator.
422 /// @return The communicator held by this holder, or nullptr if the holder is empty.
423 const CommunicatorPtr& operator->() const noexcept { return _communicator; }
424
425 /// Gets the communicator and clears the reference held by the holder.
426 /// @return The communicator held by this holder, or null if the holder is empty.
427 CommunicatorPtr release() noexcept { return std::move(_communicator); }
428
429 private:
430 CommunicatorPtr _communicator;
431 };
432}
433
434#endif
CommunicatorHolder(CommunicatorHolder &&other)=default
Move constructor.
CommunicatorHolder & operator=(CommunicatorHolder &&holder) noexcept
Move assignment operator.
const CommunicatorPtr & operator->() const noexcept
Gets the communicator.
CommunicatorHolder & operator=(CommunicatorPtr communicator) noexcept
Assignment operator.
CommunicatorPtr release() noexcept
Gets the communicator and clears the reference held by the holder.
CommunicatorHolder()=default
Default constructor.
CommunicatorHolder(T &&... args)
Constructs a CommunicatorHolder for a new communicator created using an Ice::initialize overload.
CommunicatorHolder(CommunicatorPtr communicator) noexcept
Constructs a CommunicatorHolder that adopts an existing communicator.
const CommunicatorPtr & communicator() const noexcept
Gets the communicator.
A helper class that uses Resource Acquisition Is Initialization (RAII) to hold a communicator instanc...
void waitForShutdown() noexcept
Waits for shutdown to complete.
void setDefaultLocator(const std::optional< LocatorPrx > &loc)
Sets the default locator of this communicator.
ObjectAdapterPtr createObjectAdapter(std::string name, std::optional< SSL::ServerAuthenticationOptions > serverAuthenticationOptions=std::nullopt)
Creates a new object adapter.
void setDefaultObjectAdapter(ObjectAdapterPtr adapter)
Sets the object adapter that will be associated with new outgoing connections created by this communi...
std::optional< Ice::LocatorPrx > getDefaultLocator() const
Gets the default locator of this communicator.
std::string identityToString(const Identity &ident) const
Converts an identity into a string.
std::string proxyToString(const std::optional< ObjectPrx > &obj) const
Converts a proxy into a string.
void flushBatchRequests(CompressBatch compress)
Flushes any pending batch requests of this communicator.
ObjectAdapterPtr getDefaultObjectAdapter() const
Gets the object adapter that is associated by default with new outgoing connections created by this c...
PluginManagerPtr getPluginManager() const
Gets the plug-in manager of this communicator.
void waitForShutdownAsync(std::function< void()> completed) noexcept
Waits until this communicator is shut down.
std::function< void()> flushBatchRequestsAsync(CompressBatch compress, std::function< void(std::exception_ptr)> exception, std::function< void(bool)> sent=nullptr)
Flushes any pending batch requests of this communicator.
ObjectAdapterPtr createObjectAdapterWithEndpoints(std::string name, std::string_view endpoints, std::optional< SSL::ServerAuthenticationOptions > serverAuthenticationOptions=std::nullopt)
Creates a new object adapter with endpoints.
std::shared_ptr< T > findAdminFacet(std::string_view facet)
Returns a facet of the Admin object.
ObjectPrx createAdmin(const ObjectAdapterPtr &adminAdapter, const Identity &adminId)
Adds the Admin object with all its facets to the provided object adapter.
FacetMap findAllAdminFacets()
Returns a map of all facets of the Admin object.
ObjectPtr removeAdminFacet(std::string_view facet)
Removes a facet from the Admin object.
std::optional< RouterPrx > getDefaultRouter() const
Gets the default router of this communicator.
Instrumentation::CommunicatorObserverPtr getObserver() const noexcept
Gets the observer object of this communicator.
ObjectAdapterPtr createObjectAdapterWithRouter(std::string name, RouterPrx rtr)
Creates a new object adapter with a router.
PropertyDict proxyToProperty(const std::optional< ObjectPrx > &proxy, std::string property) const
Converts a proxy into a set of proxy properties.
void shutdown() noexcept
Shuts down this communicator.
std::optional< Prx > propertyToProxy(std::string_view property) const
Converts a set of proxy properties into a proxy.
void destroyAsync(std::function< void()> completed) noexcept
Destroys this communicator asynchronously.
std::optional< Prx > stringToProxy(std::string_view str) const
Converts a stringified proxy into a proxy.
std::optional< ObjectPrx > getAdmin() const
Gets a proxy to the main facet of the Admin object.
ImplicitContextPtr getImplicitContext() const noexcept
Gets the implicit context associated with this communicator.
void addSliceLoader(SliceLoaderPtr loader) noexcept
Adds a Slice loader to this communicator, after the Slice loader set in InitializationData (if any) a...
void addAdminFacet(ObjectPtr servant, std::string facet)
Adds a new facet to the Admin object.
void setDefaultRouter(const std::optional< RouterPrx > &rtr)
Sets the default router of this communicator.
PropertiesPtr getProperties() const noexcept
Gets the properties of this communicator.
void destroy() noexcept
Destroys this communicator.
bool isShutdown() const noexcept
Checks whether or not shutdown was called on this communicator.
LoggerPtr getLogger() const noexcept
Gets the logger of this communicator.
Client applications use the Locator object to resolve Ice indirect proxies.
Definition Locator.h:39
The base class for all Ice proxies.
Definition Proxy.h:265
The base class for servants.
Definition Object.h:21
Represents an intermediary object that routes requests and replies between clients and Ice objects th...
Definition Router.h:36
Observers for objects created by the Ice runtime.
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
std::shared_ptr< ObjectAdapter > ObjectAdapterPtr
A shared pointer to an ObjectAdapter.
std::shared_ptr< Properties > PropertiesPtr
A shared pointer to a Properties.
Definition PropertiesF.h:13
std::shared_ptr< SliceLoader > SliceLoaderPtr
A shared pointer to a SliceLoader.
Definition SliceLoader.h:44
std::shared_ptr< PluginManager > PluginManagerPtr
A shared pointer to a PluginManager.
Definition Plugin.h:70
std::shared_ptr< Logger > LoggerPtr
A shared pointer to a Logger.
Definition Logger.h:16
std::shared_ptr< Object > ObjectPtr
A shared pointer to an Object.
Definition ObjectF.h:13
std::shared_ptr< ImplicitContext > ImplicitContextPtr
A shared pointer to an ImplicitContext.
std::map< std::string, std::string, std::less<> > PropertyDict
A simple collection of properties, represented as a dictionary of key/value pairs.
CompressBatch
Represents batch compression options for flushing queued batch requests.
Definition Connection.h:30
CommunicatorPtr initialize(InitializationData initData={})
Creates a new communicator.
std::map< std::string, ObjectPtr, std::less<> > FacetMap
A mapping from facet name to servant.
Definition FacetMap.h:13
The Ice RPC framework.
Definition SampleEvent.h:60
Represents the identity of an Ice object.
Definition Identity.h:41
Represents a set of options that you can specify when initializing a communicator.
Definition Initialize.h:28