Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
IceStorm.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0-alpha.0
4// <auto-generated>Generated from Slice file 'IceStorm.ice'.</auto-generated>
5// clang-format off
6
7#ifndef IceStorm_IceStorm_h_
8#define IceStorm_IceStorm_h_
9
11#include <Ice/Ice.h>
12#include <Ice/Identity.h>
13#include "Metrics.h"
14#include <IceStorm/Config.h>
15
16#ifndef ICE_DISABLE_VERSION
17# if ICE_INT_VERSION != 30850
18# error Ice version mismatch: an exact match is required for beta generated code
19# endif
20#endif
21
22#ifndef ICESTORM_API
23# if defined(ICESTORM_API_EXPORTS)
24# define ICESTORM_API ICE_DECLSPEC_EXPORT
25# else
26# define ICESTORM_API ICE_DECLSPEC_IMPORT
27# endif
28#endif
29
30// NOLINTBEGIN(modernize-concat-nested-namespaces)
31
32/// Lightweight publish/subscribe framework, available for all Ice language mappings.
33namespace IceStorm
34{
35 class TopicPrx;
36
37 struct LinkInfo;
38
39 /// A sequence of LinkInfo objects.
40 using LinkInfoSeq = std::vector<LinkInfo>;
41
42 /// Quality of service parameters.
43 /// @see Topic#subscribeAndGetPublisher
44 using QoS = std::map<std::string, std::string>;
45
46 /// A dictionary of topic name to topic proxy.
47 using TopicDict = std::map<std::string, std::optional<TopicPrx>>;
48
49 class TopicManagerPrx;
50
51 class FinderPrx;
52}
53
54namespace IceStorm
55{
56 /// Represents an IceStorm topic. Publishers publish data to a topic (via the topic's publisher object), and
57 /// subscribers subscribe to a topic.
58 /// @see TopicManager
59 /// @headerfile IceStorm/IceStorm.h
60 class ICESTORM_API TopicPrx : public Ice::Proxy<TopicPrx, Ice::ObjectPrx>
61 {
62 public:
63 /// Constructs a proxy from a Communicator and a proxy string.
64 /// @param communicator The communicator of the new proxy.
65 /// @param proxyString The proxy string to parse.
66 TopicPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
67
68 /// Copy constructor. Constructs with a copy of the contents of @p other.
69 /// @param other The proxy to copy from.
70 TopicPrx(const TopicPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
71
72 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
73 /// @param other The proxy to move from.
74 TopicPrx(TopicPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
75
76 ~TopicPrx() override;
77
78 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
79 /// @param rhs The proxy to copy from.
80 /// @return A reference to this proxy.
81 TopicPrx& operator=(const TopicPrx& rhs) noexcept
82 {
83 if (this != &rhs)
84 {
86 }
87 return *this;
88 }
89
90 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
91 /// @param rhs The proxy to move from.
92 TopicPrx& operator=(TopicPrx&& rhs) noexcept
93 {
94 if (this != &rhs)
95 {
96 Ice::ObjectPrx::operator=(std::move(rhs));
97 }
98 return *this;
99 }
100
101 /// Gets the name of this topic.
102 /// @param context The request context.
103 /// @return The name of the topic.
104 /// @see TopicManager#create
105 std::string getName(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
106
107 /// Gets the name of this topic.
108 /// @param context The request context.
109 /// @return A future that becomes available when the invocation completes. This future holds:
110 /// - The name of the topic.
111 /// @see TopicManager#create
112 [[nodiscard]] std::future<std::string> getNameAsync(const Ice::Context& context = Ice::noExplicitContext) const;
113
114 /// Gets the name of this topic.
115 /// @param response The response callback. It accepts:
116 /// - The name of the topic.
117 /// @param exception The exception callback.
118 /// @param sent The sent callback.
119 /// @param context The request context.
120 /// @return A function that can be called to cancel the invocation locally.
121 /// @see TopicManager#create
122 // NOLINTNEXTLINE(modernize-use-nodiscard)
123 std::function<void()> getNameAsync(std::function<void(std::string)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
124
125 /// @private
126 void _iceI_getName(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::string>>&, const Ice::Context&) const;
127
128 /// Gets a proxy to a publisher object for this topic. To publish data to a topic, a publisher calls this
129 /// operation and then creates a proxy with the publisher type from this proxy. If a replicated IceStorm
130 /// deployment is used, this call may return a replicated proxy.
131 /// @param context The request context.
132 /// @return A proxy to publish data on this topic. This proxy is never null.
133 std::optional<Ice::ObjectPrx> getPublisher(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
134
135 /// Gets a proxy to a publisher object for this topic. To publish data to a topic, a publisher calls this
136 /// operation and then creates a proxy with the publisher type from this proxy. If a replicated IceStorm
137 /// deployment is used, this call may return a replicated proxy.
138 /// @param context The request context.
139 /// @return A future that becomes available when the invocation completes. This future holds:
140 /// - A proxy to publish data on this topic. This proxy is never null.
141 [[nodiscard]] std::future<std::optional<Ice::ObjectPrx>> getPublisherAsync(const Ice::Context& context = Ice::noExplicitContext) const;
142
143 /// Gets a proxy to a publisher object for this topic. To publish data to a topic, a publisher calls this
144 /// operation and then creates a proxy with the publisher type from this proxy. If a replicated IceStorm
145 /// deployment is used, this call may return a replicated proxy.
146 /// @param response The response callback. It accepts:
147 /// - A proxy to publish data on this topic. This proxy is never null.
148 /// @param exception The exception callback.
149 /// @param sent The sent callback.
150 /// @param context The request context.
151 /// @return A function that can be called to cancel the invocation locally.
152 // NOLINTNEXTLINE(modernize-use-nodiscard)
153 std::function<void()> getPublisherAsync(std::function<void(std::optional<Ice::ObjectPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
154
155 /// @private
156 void _iceI_getPublisher(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, const Ice::Context&) const;
157
158 /// Gets a non-replicated proxy to a publisher object for this topic. To publish data to a topic, a publisher
159 /// calls this operation and then creates a proxy with the publisher type from this proxy.
160 /// @param context The request context.
161 /// @return A proxy to publish data on this topic. This proxy is never null.
162 std::optional<Ice::ObjectPrx> getNonReplicatedPublisher(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
163
164 /// Gets a non-replicated proxy to a publisher object for this topic. To publish data to a topic, a publisher
165 /// calls this operation and then creates a proxy with the publisher type from this proxy.
166 /// @param context The request context.
167 /// @return A future that becomes available when the invocation completes. This future holds:
168 /// - A proxy to publish data on this topic. This proxy is never null.
169 [[nodiscard]] std::future<std::optional<Ice::ObjectPrx>> getNonReplicatedPublisherAsync(const Ice::Context& context = Ice::noExplicitContext) const;
170
171 /// Gets a non-replicated proxy to a publisher object for this topic. To publish data to a topic, a publisher
172 /// calls this operation and then creates a proxy with the publisher type from this proxy.
173 /// @param response The response callback. It accepts:
174 /// - A proxy to publish data on this topic. This proxy is never null.
175 /// @param exception The exception callback.
176 /// @param sent The sent callback.
177 /// @param context The request context.
178 /// @return A function that can be called to cancel the invocation locally.
179 // NOLINTNEXTLINE(modernize-use-nodiscard)
180 std::function<void()> getNonReplicatedPublisherAsync(std::function<void(std::optional<Ice::ObjectPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
181
182 /// @private
183 void _iceI_getNonReplicatedPublisher(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, const Ice::Context&) const;
184
185 /// Subscribes to this topic.
186 /// @param theQoS The quality of service parameters for this subscription.
187 /// @param subscriber The subscriber's proxy. This proxy cannot be null.
188 /// @param context The request context.
189 /// @return The per-subscriber publisher proxy. This proxy is never null.
190 /// @throws IceStorm::AlreadySubscribed Thrown when @p subscriber is already subscribed.
191 /// @throws IceStorm::BadQoS Thrown when @p theQoS is unavailable or invalid.
192 /// @see #unsubscribe
193 std::optional<Ice::ObjectPrx> subscribeAndGetPublisher(const QoS& theQoS, const std::optional<Ice::ObjectPrx>& subscriber, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
194
195 /// Subscribes to this topic.
196 /// @param theQoS The quality of service parameters for this subscription.
197 /// @param subscriber The subscriber's proxy. This proxy cannot be null.
198 /// @param context The request context.
199 /// @return A future that becomes available when the invocation completes. This future holds:
200 /// - The per-subscriber publisher proxy. This proxy is never null.
201 /// @see #unsubscribe
202 [[nodiscard]] std::future<std::optional<Ice::ObjectPrx>> subscribeAndGetPublisherAsync(const QoS& theQoS, const std::optional<Ice::ObjectPrx>& subscriber, const Ice::Context& context = Ice::noExplicitContext) const;
203
204 /// Subscribes to this topic.
205 /// @param theQoS The quality of service parameters for this subscription.
206 /// @param subscriber The subscriber's proxy. This proxy cannot be null.
207 /// @param response The response callback. It accepts:
208 /// - The per-subscriber publisher proxy. This proxy is never null.
209 /// @param exception The exception callback.
210 /// @param sent The sent callback.
211 /// @param context The request context.
212 /// @return A function that can be called to cancel the invocation locally.
213 /// @see #unsubscribe
214 // NOLINTNEXTLINE(modernize-use-nodiscard)
215 std::function<void()> subscribeAndGetPublisherAsync(const QoS& theQoS, const std::optional<Ice::ObjectPrx>& subscriber, std::function<void(std::optional<Ice::ObjectPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
216
217 /// @private
218 void _iceI_subscribeAndGetPublisher(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<Ice::ObjectPrx>>>&, const QoS&, const std::optional<Ice::ObjectPrx>&, const Ice::Context&) const;
219
220 /// Unsubscribes the provided @p subscriber from this topic.
221 /// @param subscriber A proxy to an existing subscriber. This proxy is never null.
222 /// @param context The request context.
223 /// @see #subscribeAndGetPublisher
224 void unsubscribe(const std::optional<Ice::ObjectPrx>& subscriber, const Ice::Context& context = Ice::noExplicitContext) const;
225
226 /// Unsubscribes the provided @p subscriber from this topic.
227 /// @param subscriber A proxy to an existing subscriber. This proxy is never null.
228 /// @param context The request context.
229 /// @return A future that becomes available when the invocation completes.
230 /// @see #subscribeAndGetPublisher
231 [[nodiscard]] std::future<void> unsubscribeAsync(const std::optional<Ice::ObjectPrx>& subscriber, const Ice::Context& context = Ice::noExplicitContext) const;
232
233 /// Unsubscribes the provided @p subscriber from this topic.
234 /// @param subscriber A proxy to an existing subscriber. This proxy is never null.
235 /// @param response The response callback.
236 /// @param exception The exception callback.
237 /// @param sent The sent callback.
238 /// @param context The request context.
239 /// @return A function that can be called to cancel the invocation locally.
240 /// @see #subscribeAndGetPublisher
241 // NOLINTNEXTLINE(modernize-use-nodiscard)
242 std::function<void()> unsubscribeAsync(const std::optional<Ice::ObjectPrx>& subscriber, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
243
244 /// @private
245 void _iceI_unsubscribe(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const std::optional<Ice::ObjectPrx>&, const Ice::Context&) const;
246
247 /// Creates a link to another topic. All events originating on this topic will also be sent to the other topic.
248 /// @param linkTo The topic to link to. This proxy cannot be null.
249 /// @param cost The cost of the link.
250 /// @param context The request context.
251 /// @throws IceStorm::LinkExists Thrown when a link to @p linkTo already exists.
252 void link(const std::optional<TopicPrx>& linkTo, std::int32_t cost, const Ice::Context& context = Ice::noExplicitContext) const;
253
254 /// Creates a link to another topic. All events originating on this topic will also be sent to the other topic.
255 /// @param linkTo The topic to link to. This proxy cannot be null.
256 /// @param cost The cost of the link.
257 /// @param context The request context.
258 /// @return A future that becomes available when the invocation completes.
259 [[nodiscard]] std::future<void> linkAsync(const std::optional<TopicPrx>& linkTo, std::int32_t cost, const Ice::Context& context = Ice::noExplicitContext) const;
260
261 /// Creates a link to another topic. All events originating on this topic will also be sent to the other topic.
262 /// @param linkTo The topic to link to. This proxy cannot be null.
263 /// @param cost The cost of the link.
264 /// @param response The response callback.
265 /// @param exception The exception callback.
266 /// @param sent The sent callback.
267 /// @param context The request context.
268 /// @return A function that can be called to cancel the invocation locally.
269 // NOLINTNEXTLINE(modernize-use-nodiscard)
270 std::function<void()> linkAsync(const std::optional<TopicPrx>& linkTo, std::int32_t cost, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
271
272 /// @private
273 void _iceI_link(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const std::optional<TopicPrx>&, std::int32_t, const Ice::Context&) const;
274
275 /// Destroys a link from this topic to the provided topic.
276 /// @param linkTo The topic to destroy the link to. This proxy cannot be null.
277 /// @param context The request context.
278 /// @throws IceStorm::NoSuchLink Thrown when a link to @p linkTo does not exist.
279 void unlink(const std::optional<TopicPrx>& linkTo, const Ice::Context& context = Ice::noExplicitContext) const;
280
281 /// Destroys a link from this topic to the provided topic.
282 /// @param linkTo The topic to destroy the link to. This proxy cannot be null.
283 /// @param context The request context.
284 /// @return A future that becomes available when the invocation completes.
285 [[nodiscard]] std::future<void> unlinkAsync(const std::optional<TopicPrx>& linkTo, const Ice::Context& context = Ice::noExplicitContext) const;
286
287 /// Destroys a link from this topic to the provided topic.
288 /// @param linkTo The topic to destroy the link to. This proxy cannot be null.
289 /// @param response The response callback.
290 /// @param exception The exception callback.
291 /// @param sent The sent callback.
292 /// @param context The request context.
293 /// @return A function that can be called to cancel the invocation locally.
294 // NOLINTNEXTLINE(modernize-use-nodiscard)
295 std::function<void()> unlinkAsync(const std::optional<TopicPrx>& linkTo, std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
296
297 /// @private
298 void _iceI_unlink(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const std::optional<TopicPrx>&, const Ice::Context&) const;
299
300 /// Gets information on the current links.
301 /// @param context The request context.
302 /// @return A sequence of LinkInfo objects.
303 LinkInfoSeq getLinkInfoSeq(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
304
305 /// Gets information on the current links.
306 /// @param context The request context.
307 /// @return A future that becomes available when the invocation completes. This future holds:
308 /// - A sequence of LinkInfo objects.
309 [[nodiscard]] std::future<LinkInfoSeq> getLinkInfoSeqAsync(const Ice::Context& context = Ice::noExplicitContext) const;
310
311 /// Gets information on the current links.
312 /// @param response The response callback. It accepts:
313 /// - A sequence of LinkInfo objects.
314 /// @param exception The exception callback.
315 /// @param sent The sent callback.
316 /// @param context The request context.
317 /// @return A function that can be called to cancel the invocation locally.
318 // NOLINTNEXTLINE(modernize-use-nodiscard)
319 std::function<void()> getLinkInfoSeqAsync(std::function<void(::IceStorm::LinkInfoSeq)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
320
321 /// @private
322 void _iceI_getLinkInfoSeq(const std::shared_ptr<IceInternal::OutgoingAsyncT<LinkInfoSeq>>&, const Ice::Context&) const;
323
324 /// Gets the list of subscribers for this topic.
325 /// @param context The request context.
326 /// @return The sequence of Ice identities for the subscriber objects.
327 ::Ice::IdentitySeq getSubscribers(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
328
329 /// Gets the list of subscribers for this topic.
330 /// @param context The request context.
331 /// @return A future that becomes available when the invocation completes. This future holds:
332 /// - The sequence of Ice identities for the subscriber objects.
333 [[nodiscard]] std::future<::Ice::IdentitySeq> getSubscribersAsync(const Ice::Context& context = Ice::noExplicitContext) const;
334
335 /// Gets the list of subscribers for this topic.
336 /// @param response The response callback. It accepts:
337 /// - The sequence of Ice identities for the subscriber objects.
338 /// @param exception The exception callback.
339 /// @param sent The sent callback.
340 /// @param context The request context.
341 /// @return A function that can be called to cancel the invocation locally.
342 // NOLINTNEXTLINE(modernize-use-nodiscard)
343 std::function<void()> getSubscribersAsync(std::function<void(::Ice::IdentitySeq)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
344
345 /// @private
346 void _iceI_getSubscribers(const std::shared_ptr<IceInternal::OutgoingAsyncT<::Ice::IdentitySeq>>&, const Ice::Context&) const;
347
348 /// Destroys this topic.
349 /// @param context The request context.
350 void destroy(const Ice::Context& context = Ice::noExplicitContext) const;
351
352 /// Destroys this topic.
353 /// @param context The request context.
354 /// @return A future that becomes available when the invocation completes.
355 [[nodiscard]] std::future<void> destroyAsync(const Ice::Context& context = Ice::noExplicitContext) const;
356
357 /// Destroys this topic.
358 /// @param response The response callback.
359 /// @param exception The exception callback.
360 /// @param sent The sent callback.
361 /// @param context The request context.
362 /// @return A function that can be called to cancel the invocation locally.
363 // NOLINTNEXTLINE(modernize-use-nodiscard)
364 std::function<void()> destroyAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
365
366 /// @private
367 void _iceI_destroy(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
368
369 /// Gets the type ID of the associated Slice interface.
370 /// @return The string `"::IceStorm::Topic"`.
371 static const char* ice_staticId() noexcept;
372
373 /// @private
374 static TopicPrx _fromReference(IceInternal::ReferencePtr ref) { return TopicPrx{std::move(ref)}; }
375
376 protected:
377 /// @private
378 TopicPrx() = default;
379
380 /// @private
381 explicit TopicPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
382 {
383 }
384 };
385
386 /// Represents an object that manages topics.
387 /// @see Topic
388 /// @headerfile IceStorm/IceStorm.h
389 class ICESTORM_API TopicManagerPrx : public Ice::Proxy<TopicManagerPrx, Ice::ObjectPrx>
390 {
391 public:
392 /// Constructs a proxy from a Communicator and a proxy string.
393 /// @param communicator The communicator of the new proxy.
394 /// @param proxyString The proxy string to parse.
395 TopicManagerPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
396
397 /// Copy constructor. Constructs with a copy of the contents of @p other.
398 /// @param other The proxy to copy from.
399 TopicManagerPrx(const TopicManagerPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
400
401 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
402 /// @param other The proxy to move from.
403 TopicManagerPrx(TopicManagerPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
404
405 ~TopicManagerPrx() override;
406
407 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
408 /// @param rhs The proxy to copy from.
409 /// @return A reference to this proxy.
411 {
412 if (this != &rhs)
413 {
415 }
416 return *this;
417 }
418
419 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
420 /// @param rhs The proxy to move from.
422 {
423 if (this != &rhs)
424 {
425 Ice::ObjectPrx::operator=(std::move(rhs));
426 }
427 return *this;
428 }
429
430 /// Creates a new topic.
431 /// @param name The name of the topic.
432 /// @param context The request context.
433 /// @return A proxy to the new topic object. The returned proxy is never null.
434 /// @throws IceStorm::TopicExists Thrown when a topic with the same @p name already exists.
435 std::optional<TopicPrx> create(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
436
437 /// Creates a new topic.
438 /// @param name The name of the topic.
439 /// @param context The request context.
440 /// @return A future that becomes available when the invocation completes. This future holds:
441 /// - A proxy to the new topic object. The returned proxy is never null.
442 [[nodiscard]] std::future<std::optional<TopicPrx>> createAsync(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const;
443
444 /// Creates a new topic.
445 /// @param name The name of the topic.
446 /// @param response The response callback. It accepts:
447 /// - A proxy to the new topic object. The returned proxy is never null.
448 /// @param exception The exception callback.
449 /// @param sent The sent callback.
450 /// @param context The request context.
451 /// @return A function that can be called to cancel the invocation locally.
452 // NOLINTNEXTLINE(modernize-use-nodiscard)
453 std::function<void()> createAsync(std::string_view name, std::function<void(std::optional<::IceStorm::TopicPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
454
455 /// @private
456 void _iceI_create(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<TopicPrx>>>&, std::string_view, const Ice::Context&) const;
457
458 /// Retrieves a topic by name.
459 /// @param name The name of the topic.
460 /// @param context The request context.
461 /// @return A proxy to the topic object. The returned proxy is never null.
462 /// @throws IceStorm::NoSuchTopic Thrown when there is no topic named @p name.
463 std::optional<TopicPrx> retrieve(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
464
465 /// Retrieves a topic by name.
466 /// @param name The name of the topic.
467 /// @param context The request context.
468 /// @return A future that becomes available when the invocation completes. This future holds:
469 /// - A proxy to the topic object. The returned proxy is never null.
470 [[nodiscard]] std::future<std::optional<TopicPrx>> retrieveAsync(std::string_view name, const Ice::Context& context = Ice::noExplicitContext) const;
471
472 /// Retrieves a topic by name.
473 /// @param name The name of the topic.
474 /// @param response The response callback. It accepts:
475 /// - A proxy to the topic object. The returned proxy is never null.
476 /// @param exception The exception callback.
477 /// @param sent The sent callback.
478 /// @param context The request context.
479 /// @return A function that can be called to cancel the invocation locally.
480 // NOLINTNEXTLINE(modernize-use-nodiscard)
481 std::function<void()> retrieveAsync(std::string_view name, std::function<void(std::optional<::IceStorm::TopicPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
482
483 /// @private
484 void _iceI_retrieve(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<TopicPrx>>>&, std::string_view, const Ice::Context&) const;
485
486 /// Retrieves all topics managed by this topic manager.
487 /// @param context The request context.
488 /// @return A dictionary of string, topic proxy pairs.
489 TopicDict retrieveAll(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
490
491 /// Retrieves all topics managed by this topic manager.
492 /// @param context The request context.
493 /// @return A future that becomes available when the invocation completes. This future holds:
494 /// - A dictionary of string, topic proxy pairs.
495 [[nodiscard]] std::future<TopicDict> retrieveAllAsync(const Ice::Context& context = Ice::noExplicitContext) const;
496
497 /// Retrieves all topics managed by this topic manager.
498 /// @param response The response callback. It accepts:
499 /// - A dictionary of string, topic proxy pairs.
500 /// @param exception The exception callback.
501 /// @param sent The sent callback.
502 /// @param context The request context.
503 /// @return A function that can be called to cancel the invocation locally.
504 // NOLINTNEXTLINE(modernize-use-nodiscard)
505 std::function<void()> retrieveAllAsync(std::function<void(::IceStorm::TopicDict)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
506
507 /// @private
508 void _iceI_retrieveAll(const std::shared_ptr<IceInternal::OutgoingAsyncT<TopicDict>>&, const Ice::Context&) const;
509
510 /// Gets the type ID of the associated Slice interface.
511 /// @return The string `"::IceStorm::TopicManager"`.
512 static const char* ice_staticId() noexcept;
513
514 /// @private
515 static TopicManagerPrx _fromReference(IceInternal::ReferencePtr ref) { return TopicManagerPrx{std::move(ref)}; }
516
517 protected:
518 /// @private
519 TopicManagerPrx() = default;
520
521 /// @private
522 explicit TopicManagerPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
523 {
524 }
525 };
526
527 /// Provides access to a TopicManagerPrx object via a fixed identity.
528 /// An IceStorm Finder is always registered with identity `IceStorm/Finder`. This allows clients to obtain the
529 /// associated TopicManager proxy with just the endpoint information of the object. For example, you can use the
530 /// Finder proxy `IceStorm/Finder:tcp -h somehost -p 4061` to get the TopicManager proxy
531 /// `MyIceStorm/TopicManager:tcp -h somehost -p 4061`.
532 /// @headerfile IceStorm/IceStorm.h
533 class ICESTORM_API FinderPrx : public Ice::Proxy<FinderPrx, Ice::ObjectPrx>
534 {
535 public:
536 /// Constructs a proxy from a Communicator and a proxy string.
537 /// @param communicator The communicator of the new proxy.
538 /// @param proxyString The proxy string to parse.
539 FinderPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
540
541 /// Copy constructor. Constructs with a copy of the contents of @p other.
542 /// @param other The proxy to copy from.
543 FinderPrx(const FinderPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
544
545 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
546 /// @param other The proxy to move from.
547 FinderPrx(FinderPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
548
549 ~FinderPrx() override;
550
551 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
552 /// @param rhs The proxy to copy from.
553 /// @return A reference to this proxy.
554 FinderPrx& operator=(const FinderPrx& rhs) noexcept
555 {
556 if (this != &rhs)
557 {
559 }
560 return *this;
561 }
562
563 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
564 /// @param rhs The proxy to move from.
566 {
567 if (this != &rhs)
568 {
569 Ice::ObjectPrx::operator=(std::move(rhs));
570 }
571 return *this;
572 }
573
574 /// Gets a proxy to the associated ::IceStorm::TopicManagerPrx. The proxy might point to several replicas.
575 /// @param context The request context.
576 /// @return The topic manager proxy. This proxy is never null.
577 std::optional<TopicManagerPrx> getTopicManager(const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
578
579 /// Gets a proxy to the associated ::IceStorm::TopicManagerPrx. The proxy might point to several replicas.
580 /// @param context The request context.
581 /// @return A future that becomes available when the invocation completes. This future holds:
582 /// - The topic manager proxy. This proxy is never null.
583 [[nodiscard]] std::future<std::optional<TopicManagerPrx>> getTopicManagerAsync(const Ice::Context& context = Ice::noExplicitContext) const;
584
585 /// Gets a proxy to the associated ::IceStorm::TopicManagerPrx. The proxy might point to several replicas.
586 /// @param response The response callback. It accepts:
587 /// - The topic manager proxy. This proxy is never null.
588 /// @param exception The exception callback.
589 /// @param sent The sent callback.
590 /// @param context The request context.
591 /// @return A function that can be called to cancel the invocation locally.
592 // NOLINTNEXTLINE(modernize-use-nodiscard)
593 std::function<void()> getTopicManagerAsync(std::function<void(std::optional<::IceStorm::TopicManagerPrx>)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
594
595 /// @private
596 void _iceI_getTopicManager(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::optional<TopicManagerPrx>>>&, const Ice::Context&) const;
597
598 /// Gets the type ID of the associated Slice interface.
599 /// @return The string `"::IceStorm::Finder"`.
600 static const char* ice_staticId() noexcept;
601
602 /// @private
603 static FinderPrx _fromReference(IceInternal::ReferencePtr ref) { return FinderPrx{std::move(ref)}; }
604
605 protected:
606 /// @private
607 FinderPrx() = default;
608
609 /// @private
610 explicit FinderPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
611 {
612 }
613 };
614}
615
616namespace IceStorm
617{
618 /// Information about a topic link.
619 /// @headerfile IceStorm/IceStorm.h
620 struct LinkInfo
621 {
622 /// The linked topic proxy. This proxy is never null.
623 std::optional<::IceStorm::TopicPrx> theTopic;
624
625 /// The name of the linked topic.
626 std::string name;
627
628 /// The cost of traversing this link.
629 std::int32_t cost;
630
631 /// Creates a tuple with all the fields of this struct.
632 /// @return A tuple with all the fields of this struct.
633 [[nodiscard]] std::tuple<const std::optional<::IceStorm::TopicPrx>&, const std::string&, const std::int32_t&> ice_tuple() const
634 {
635 return std::tie(theTopic, name, cost);
636 }
637
638 /// Outputs the name and value of each field of this instance to the stream.
639 /// @param os The output stream.
640 ICESTORM_API void ice_printFields(std::ostream& os) const;
641 };
642
643 /// Outputs the description of a LinkInfo to a stream, including all its fields.
644 /// @param os The output stream.
645 /// @param value The instance to output.
646 /// @return The output stream.
647 ICESTORM_API std::ostream& operator<<(std::ostream& os, const LinkInfo& value);
648
649 /// The exception that is thrown when attempting to create a link that already exists.
650 /// @headerfile IceStorm/IceStorm.h
651 class ICESTORM_API LinkExists : public Ice::UserException
652 {
653 public:
654 /// Default constructor.
655 LinkExists() noexcept = default;
656
657 /// One-shot constructor to initialize all data members.
658 /// @param name The name of the linked topic.
659 LinkExists(std::string name) noexcept :
660 name(std::move(name))
661 {
662 }
663
664 /// Copy constructor.
665 LinkExists(const LinkExists&) noexcept = default;
666
667 /// Creates a tuple with all the fields of this exception.
668 /// @return A tuple with all the fields of this exception.
669 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
670 {
671 return std::tie(name);
672 }
673
674 void ice_printFields(std::ostream& os) const override;
675 /// Gets the type ID of the associated Slice exception.
676 /// @return The string `"::IceStorm::LinkExists"`.
677 static const char* ice_staticId() noexcept;
678
679 [[nodiscard]] const char* ice_id() const noexcept override;
680
681 void ice_throw() const override;
682
683 /// The name of the linked topic.
684 std::string name;
685
686 protected:
687 /// @private
688 void _writeImpl(Ice::OutputStream*) const override;
689
690 /// @private
691 void _readImpl(Ice::InputStream*) override;
692 };
693
694 /// The exception that is thrown when attempting to remove a link that does not exist.
695 /// @headerfile IceStorm/IceStorm.h
696 class ICESTORM_API NoSuchLink : public Ice::UserException
697 {
698 public:
699 /// Default constructor.
700 NoSuchLink() noexcept = default;
701
702 /// One-shot constructor to initialize all data members.
703 /// @param name The name of the link that does not exist.
704 NoSuchLink(std::string name) noexcept :
705 name(std::move(name))
706 {
707 }
708
709 /// Copy constructor.
710 NoSuchLink(const NoSuchLink&) noexcept = default;
711
712 /// Creates a tuple with all the fields of this exception.
713 /// @return A tuple with all the fields of this exception.
714 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
715 {
716 return std::tie(name);
717 }
718
719 void ice_printFields(std::ostream& os) const override;
720 /// Gets the type ID of the associated Slice exception.
721 /// @return The string `"::IceStorm::NoSuchLink"`.
722 static const char* ice_staticId() noexcept;
723
724 [[nodiscard]] const char* ice_id() const noexcept override;
725
726 void ice_throw() const override;
727
728 /// The name of the link that does not exist.
729 std::string name;
730
731 protected:
732 /// @private
733 void _writeImpl(Ice::OutputStream*) const override;
734
735 /// @private
736 void _readImpl(Ice::InputStream*) override;
737 };
738
739 /// The exception that is thrown when attempting to subscribe a proxy for which a subscription already exists.
740 /// @headerfile IceStorm/IceStorm.h
741 class ICESTORM_API AlreadySubscribed : public Ice::UserException
742 {
743 public:
744 /// Gets the type ID of the associated Slice exception.
745 /// @return The string `"::IceStorm::AlreadySubscribed"`.
746 static const char* ice_staticId() noexcept;
747
748 [[nodiscard]] const char* ice_id() const noexcept override;
749
750 void ice_throw() const override;
751
752 protected:
753 /// @private
754 void _writeImpl(Ice::OutputStream*) const override;
755
756 /// @private
757 void _readImpl(Ice::InputStream*) override;
758 };
759
760 /// The exception that is thrown when attempting to subscribe with an invalid QoS.
761 /// @headerfile IceStorm/IceStorm.h
762 class ICESTORM_API BadQoS : public Ice::UserException
763 {
764 public:
765 /// Default constructor.
766 BadQoS() noexcept = default;
767
768 /// One-shot constructor to initialize all data members.
769 /// @param reason The reason for the failure.
770 BadQoS(std::string reason) noexcept :
771 reason(std::move(reason))
772 {
773 }
774
775 /// Copy constructor.
776 BadQoS(const BadQoS&) noexcept = default;
777
778 /// Creates a tuple with all the fields of this exception.
779 /// @return A tuple with all the fields of this exception.
780 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
781 {
782 return std::tie(reason);
783 }
784
785 void ice_printFields(std::ostream& os) const override;
786 /// Gets the type ID of the associated Slice exception.
787 /// @return The string `"::IceStorm::BadQoS"`.
788 static const char* ice_staticId() noexcept;
789
790 [[nodiscard]] const char* ice_id() const noexcept override;
791
792 void ice_throw() const override;
793
794 /// The reason for the failure.
795 std::string reason;
796
797 protected:
798 /// @private
799 void _writeImpl(Ice::OutputStream*) const override;
800
801 /// @private
802 void _readImpl(Ice::InputStream*) override;
803 };
804
805 /// The exception that is thrown when attempting to create a topic that already exists.
806 /// @headerfile IceStorm/IceStorm.h
807 class ICESTORM_API TopicExists : public Ice::UserException
808 {
809 public:
810 /// Default constructor.
811 TopicExists() noexcept = default;
812
813 /// One-shot constructor to initialize all data members.
814 /// @param name The name of the topic that already exists.
815 TopicExists(std::string name) noexcept :
816 name(std::move(name))
817 {
818 }
819
820 /// Copy constructor.
821 TopicExists(const TopicExists&) noexcept = default;
822
823 /// Creates a tuple with all the fields of this exception.
824 /// @return A tuple with all the fields of this exception.
825 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
826 {
827 return std::tie(name);
828 }
829
830 void ice_printFields(std::ostream& os) const override;
831 /// Gets the type ID of the associated Slice exception.
832 /// @return The string `"::IceStorm::TopicExists"`.
833 static const char* ice_staticId() noexcept;
834
835 [[nodiscard]] const char* ice_id() const noexcept override;
836
837 void ice_throw() const override;
838
839 /// The name of the topic that already exists.
840 std::string name;
841
842 protected:
843 /// @private
844 void _writeImpl(Ice::OutputStream*) const override;
845
846 /// @private
847 void _readImpl(Ice::InputStream*) override;
848 };
849
850 /// The exception that is thrown when attempting to retrieve a topic that does not exist.
851 /// @headerfile IceStorm/IceStorm.h
852 class ICESTORM_API NoSuchTopic : public Ice::UserException
853 {
854 public:
855 /// Default constructor.
856 NoSuchTopic() noexcept = default;
857
858 /// One-shot constructor to initialize all data members.
859 /// @param name The name of the topic that does not exist.
860 NoSuchTopic(std::string name) noexcept :
861 name(std::move(name))
862 {
863 }
864
865 /// Copy constructor.
866 NoSuchTopic(const NoSuchTopic&) noexcept = default;
867
868 /// Creates a tuple with all the fields of this exception.
869 /// @return A tuple with all the fields of this exception.
870 [[nodiscard]] std::tuple<const std::string&> ice_tuple() const
871 {
872 return std::tie(name);
873 }
874
875 void ice_printFields(std::ostream& os) const override;
876 /// Gets the type ID of the associated Slice exception.
877 /// @return The string `"::IceStorm::NoSuchTopic"`.
878 static const char* ice_staticId() noexcept;
879
880 [[nodiscard]] const char* ice_id() const noexcept override;
881
882 void ice_throw() const override;
883
884 /// The name of the topic that does not exist.
885 std::string name;
886
887 protected:
888 /// @private
889 void _writeImpl(Ice::OutputStream*) const override;
890
891 /// @private
892 void _readImpl(Ice::InputStream*) override;
893 };
894
895 /// @cond INTERNAL
896 using Ice::Tuple::operator<;
897 using Ice::Tuple::operator<=;
898 using Ice::Tuple::operator>;
899 using Ice::Tuple::operator>=;
900 using Ice::Tuple::operator==;
901 using Ice::Tuple::operator!=;
902 /// @endcond
903}
904
905namespace IceStorm
906{
907 /// Represents an IceStorm topic. Publishers publish data to a topic (via the topic's publisher object), and
908 /// subscribers subscribe to a topic.
909 /// @see TopicManager
910 /// @headerfile IceStorm/IceStorm.h
911 class ICESTORM_API Topic : public virtual Ice::Object
912 {
913 public:
914 /// The associated proxy type.
915 using ProxyType = TopicPrx;
916
917 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
918 /// @param request The incoming request.
919 /// @param sendResponse The callback to send the response.
920 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
921
922 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
923
924 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
925
926 /// Gets the name of this topic.
927 /// @param current The Current object of the incoming request.
928 /// @return The name of the topic.
929 /// @see TopicManager#create
930 [[nodiscard]] virtual std::string getName(const Ice::Current& current) const = 0;
931
932 /// @private
933 void _iceD_getName(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
934
935 /// Gets a proxy to a publisher object for this topic. To publish data to a topic, a publisher calls this
936 /// operation and then creates a proxy with the publisher type from this proxy. If a replicated IceStorm
937 /// deployment is used, this call may return a replicated proxy.
938 /// @param current The Current object of the incoming request.
939 /// @return A proxy to publish data on this topic. This proxy is never null.
940 [[nodiscard]] virtual std::optional<Ice::ObjectPrx> getPublisher(const Ice::Current& current) const = 0;
941
942 /// @private
943 void _iceD_getPublisher(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
944
945 /// Gets a non-replicated proxy to a publisher object for this topic. To publish data to a topic, a publisher
946 /// calls this operation and then creates a proxy with the publisher type from this proxy.
947 /// @param current The Current object of the incoming request.
948 /// @return A proxy to publish data on this topic. This proxy is never null.
949 [[nodiscard]] virtual std::optional<Ice::ObjectPrx> getNonReplicatedPublisher(const Ice::Current& current) const = 0;
950
951 /// @private
952 void _iceD_getNonReplicatedPublisher(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
953
954 /// Subscribes to this topic.
955 /// @param theQoS The quality of service parameters for this subscription.
956 /// @param subscriber The subscriber's proxy. This proxy cannot be null.
957 /// @param current The Current object of the incoming request.
958 /// @return The per-subscriber publisher proxy. This proxy is never null.
959 /// @throws IceStorm::AlreadySubscribed Thrown when @p subscriber is already subscribed.
960 /// @throws IceStorm::BadQoS Thrown when @p theQoS is unavailable or invalid.
961 /// @see #unsubscribe
962 virtual std::optional<Ice::ObjectPrx> subscribeAndGetPublisher(QoS theQoS, std::optional<Ice::ObjectPrx> subscriber, const Ice::Current& current) = 0;
963
964 /// @private
965 void _iceD_subscribeAndGetPublisher(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
966
967 /// Unsubscribes the provided @p subscriber from this topic.
968 /// @param subscriber A proxy to an existing subscriber. This proxy is never null.
969 /// @param current The Current object of the incoming request.
970 /// @see #subscribeAndGetPublisher
971 virtual void unsubscribe(std::optional<Ice::ObjectPrx> subscriber, const Ice::Current& current) = 0;
972
973 /// @private
974 void _iceD_unsubscribe(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
975
976 /// Creates a link to another topic. All events originating on this topic will also be sent to the other topic.
977 /// @param linkTo The topic to link to. This proxy cannot be null.
978 /// @param cost The cost of the link.
979 /// @param current The Current object of the incoming request.
980 /// @throws IceStorm::LinkExists Thrown when a link to @p linkTo already exists.
981 virtual void link(std::optional<TopicPrx> linkTo, std::int32_t cost, const Ice::Current& current) = 0;
982
983 /// @private
984 void _iceD_link(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
985
986 /// Destroys a link from this topic to the provided topic.
987 /// @param linkTo The topic to destroy the link to. This proxy cannot be null.
988 /// @param current The Current object of the incoming request.
989 /// @throws IceStorm::NoSuchLink Thrown when a link to @p linkTo does not exist.
990 virtual void unlink(std::optional<TopicPrx> linkTo, const Ice::Current& current) = 0;
991
992 /// @private
993 void _iceD_unlink(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
994
995 /// Gets information on the current links.
996 /// @param current The Current object of the incoming request.
997 /// @return A sequence of LinkInfo objects.
998 [[nodiscard]] virtual LinkInfoSeq getLinkInfoSeq(const Ice::Current& current) const = 0;
999
1000 /// @private
1001 void _iceD_getLinkInfoSeq(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
1002
1003 /// Gets the list of subscribers for this topic.
1004 /// @param current The Current object of the incoming request.
1005 /// @return The sequence of Ice identities for the subscriber objects.
1006 [[nodiscard]] virtual ::Ice::IdentitySeq getSubscribers(const Ice::Current& current) const = 0;
1007
1008 /// @private
1009 void _iceD_getSubscribers(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>) const;
1010
1011 /// Destroys this topic.
1012 /// @param current The Current object of the incoming request.
1013 virtual void destroy(const Ice::Current& current) = 0;
1014
1015 /// @private
1016 void _iceD_destroy(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1017
1018 /// Gets the type ID of the associated Slice interface.
1019 /// @return The string `"::IceStorm::Topic"`.
1020 static const char* ice_staticId() noexcept;
1021 };
1022
1023 /// A shared pointer to a Topic.
1024 using TopicPtr = std::shared_ptr<Topic>;
1025
1026 /// Represents an object that manages topics.
1027 /// @see Topic
1028 /// @headerfile IceStorm/IceStorm.h
1029 class ICESTORM_API TopicManager : public virtual Ice::Object
1030 {
1031 public:
1032 /// The associated proxy type.
1033 using ProxyType = TopicManagerPrx;
1034
1035 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
1036 /// @param request The incoming request.
1037 /// @param sendResponse The callback to send the response.
1038 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
1039
1040 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
1041
1042 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
1043
1044 /// Creates a new topic.
1045 /// @param name The name of the topic.
1046 /// @param current The Current object of the incoming request.
1047 /// @return A proxy to the new topic object. The returned proxy is never null.
1048 /// @throws IceStorm::TopicExists Thrown when a topic with the same @p name already exists.
1049 virtual std::optional<TopicPrx> create(std::string name, const Ice::Current& current) = 0;
1050
1051 /// @private
1052 void _iceD_create(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1053
1054 /// Retrieves a topic by name.
1055 /// @param name The name of the topic.
1056 /// @param current The Current object of the incoming request.
1057 /// @return A proxy to the topic object. The returned proxy is never null.
1058 /// @throws IceStorm::NoSuchTopic Thrown when there is no topic named @p name.
1059 virtual std::optional<TopicPrx> retrieve(std::string name, const Ice::Current& current) = 0;
1060
1061 /// @private
1062 void _iceD_retrieve(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1063
1064 /// Retrieves all topics managed by this topic manager.
1065 /// @param current The Current object of the incoming request.
1066 /// @return A dictionary of string, topic proxy pairs.
1067 virtual TopicDict retrieveAll(const Ice::Current& current) = 0;
1068
1069 /// @private
1070 void _iceD_retrieveAll(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1071
1072 /// Gets the type ID of the associated Slice interface.
1073 /// @return The string `"::IceStorm::TopicManager"`.
1074 static const char* ice_staticId() noexcept;
1075 };
1076
1077 /// A shared pointer to a TopicManager.
1078 using TopicManagerPtr = std::shared_ptr<TopicManager>;
1079
1080 /// Provides access to a TopicManagerPrx object via a fixed identity.
1081 /// An IceStorm Finder is always registered with identity `IceStorm/Finder`. This allows clients to obtain the
1082 /// associated TopicManager proxy with just the endpoint information of the object. For example, you can use the
1083 /// Finder proxy `IceStorm/Finder:tcp -h somehost -p 4061` to get the TopicManager proxy
1084 /// `MyIceStorm/TopicManager:tcp -h somehost -p 4061`.
1085 /// @headerfile IceStorm/IceStorm.h
1086 class ICESTORM_API Finder : public virtual Ice::Object
1087 {
1088 public:
1089 /// The associated proxy type.
1090 using ProxyType = FinderPrx;
1091
1092 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
1093 /// @param request The incoming request.
1094 /// @param sendResponse The callback to send the response.
1095 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
1096
1097 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
1098
1099 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
1100
1101 /// Gets a proxy to the associated ::IceStorm::TopicManagerPrx. The proxy might point to several replicas.
1102 /// @param current The Current object of the incoming request.
1103 /// @return The topic manager proxy. This proxy is never null.
1104 virtual std::optional<TopicManagerPrx> getTopicManager(const Ice::Current& current) = 0;
1105
1106 /// @private
1107 void _iceD_getTopicManager(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
1108
1109 /// Gets the type ID of the associated Slice interface.
1110 /// @return The string `"::IceStorm::Finder"`.
1111 static const char* ice_staticId() noexcept;
1112 };
1113
1114 /// A shared pointer to a Finder.
1115 using FinderPtr = std::shared_ptr<Finder>;
1116}
1117
1118namespace Ice
1119{
1120 /// @cond INTERNAL
1121 template<>
1122 struct StreamableTraits<::IceStorm::LinkInfo>
1123 {
1124 static constexpr StreamHelperCategory helper = StreamHelperCategoryStruct;
1125 static constexpr int minWireSize = 7;
1126 static constexpr bool fixedLength = false;
1127 };
1128
1129 template<>
1130 struct StreamReader<::IceStorm::LinkInfo>
1131 {
1132 /// Unmarshals a ::IceStorm::LinkInfo from the input stream.
1133 static void read(InputStream* istr, ::IceStorm::LinkInfo& v)
1134 {
1135 istr->readAll(v.theTopic, v.name, v.cost);
1136 }
1137 };
1138 /// @endcond
1139}
1140
1141// NOLINTEND(modernize-concat-nested-namespaces)
1142
1143#include <Ice/PopDisableWarnings.h>
1144#endif
const char * ice_id() const noexcept override
Returns the type ID of this exception.
void ice_throw() const override
Throws this exception.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
The exception that is thrown when attempting to subscribe a proxy for which a subscription already ex...
Definition IceStorm.h:742
std::tuple< const std::string & > ice_tuple() const
Creates a tuple with all the fields of this exception.
Definition IceStorm.h:780
const char * ice_id() const noexcept override
Returns the type ID of this exception.
void ice_throw() const override
Throws this exception.
std::string reason
The reason for the failure.
Definition IceStorm.h:795
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
BadQoS(const BadQoS &) noexcept=default
Copy constructor.
BadQoS() noexcept=default
Default constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
FinderPrx(const FinderPrx &other) noexcept
Copy constructor.
Definition IceStorm.h:543
FinderPrx(FinderPrx &&other) noexcept
Move constructor.
Definition IceStorm.h:547
FinderPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition IceStorm.h:539
std::function< void()> getTopicManagerAsync(std::function< void(std::optional<::IceStorm::TopicManagerPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets a proxy to the associated IceStorm::TopicManagerPrx.
std::future< std::optional< TopicManagerPrx > > getTopicManagerAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets a proxy to the associated IceStorm::TopicManagerPrx.
FinderPrx & operator=(FinderPrx &&rhs) noexcept
Move assignment operator.
Definition IceStorm.h:565
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
FinderPrx & operator=(const FinderPrx &rhs) noexcept
Copy assignment operator.
Definition IceStorm.h:554
std::optional< TopicManagerPrx > getTopicManager(const Ice::Context &context=Ice::noExplicitContext) const
Gets a proxy to the associated IceStorm::TopicManagerPrx.
Provides access to a TopicManagerPrx object via a fixed identity.
Definition IceStorm.h:534
LinkExists() noexcept=default
Default constructor.
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
LinkExists(const LinkExists &) noexcept=default
Copy constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
const char * ice_id() const noexcept override
Returns the type ID of this exception.
std::string name
The name of the linked topic.
Definition IceStorm.h:684
void ice_throw() const override
Throws this exception.
std::tuple< const std::string & > ice_tuple() const
Creates a tuple with all the fields of this exception.
Definition IceStorm.h:669
std::tuple< const std::string & > ice_tuple() const
Creates a tuple with all the fields of this exception.
Definition IceStorm.h:870
void ice_throw() const override
Throws this exception.
std::string name
The name of the topic that does not exist.
Definition IceStorm.h:885
NoSuchTopic(const NoSuchTopic &) noexcept=default
Copy constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
NoSuchTopic() noexcept=default
Default constructor.
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
const char * ice_id() const noexcept override
Returns the type ID of this exception.
const char * ice_id() const noexcept override
Returns the type ID of this exception.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice exception.
void ice_printFields(std::ostream &os) const override
Outputs the name and value of each field of this instance, including inherited fields,...
std::string name
The name of the topic that already exists.
Definition IceStorm.h:840
TopicExists(const TopicExists &) noexcept=default
Copy constructor.
TopicExists() noexcept=default
Default constructor.
void ice_throw() const override
Throws this exception.
std::tuple< const std::string & > ice_tuple() const
Creates a tuple with all the fields of this exception.
Definition IceStorm.h:825
TopicManagerPrx & operator=(const TopicManagerPrx &rhs) noexcept
Copy assignment operator.
Definition IceStorm.h:410
TopicManagerPrx(TopicManagerPrx &&other) noexcept
Move constructor.
Definition IceStorm.h:403
TopicDict retrieveAll(const Ice::Context &context=Ice::noExplicitContext) const
Retrieves all topics managed by this topic manager.
TopicManagerPrx(const TopicManagerPrx &other) noexcept
Copy constructor.
Definition IceStorm.h:399
std::function< void()> createAsync(std::string_view name, std::function< void(std::optional<::IceStorm::TopicPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Creates a new topic.
std::optional< TopicPrx > retrieve(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Retrieves a topic by name.
std::function< void()> retrieveAsync(std::string_view name, std::function< void(std::optional<::IceStorm::TopicPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Retrieves a topic by name.
std::future< TopicDict > retrieveAllAsync(const Ice::Context &context=Ice::noExplicitContext) const
Retrieves all topics managed by this topic manager.
std::function< void()> retrieveAllAsync(std::function< void(::IceStorm::TopicDict)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Retrieves all topics managed by this topic manager.
std::future< std::optional< TopicPrx > > createAsync(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Creates a new topic.
std::optional< TopicPrx > create(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Creates a new topic.
TopicManagerPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition IceStorm.h:395
std::future< std::optional< TopicPrx > > retrieveAsync(std::string_view name, const Ice::Context &context=Ice::noExplicitContext) const
Retrieves a topic by name.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
TopicManagerPrx & operator=(TopicManagerPrx &&rhs) noexcept
Move assignment operator.
Definition IceStorm.h:421
Represents an object that manages topics.
Definition IceStorm.h:390
void link(const std::optional< TopicPrx > &linkTo, std::int32_t cost, const Ice::Context &context=Ice::noExplicitContext) const
Creates a link to another topic.
void unsubscribe(const std::optional< Ice::ObjectPrx > &subscriber, const Ice::Context &context=Ice::noExplicitContext) const
Unsubscribes the provided subscriber from this topic.
std::future< LinkInfoSeq > getLinkInfoSeqAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets information on the current links.
std::function< void()> getNonReplicatedPublisherAsync(std::function< void(std::optional< Ice::ObjectPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets a non-replicated proxy to a publisher object for this topic.
std::function< void()> getSubscribersAsync(std::function< void(::Ice::IdentitySeq)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the list of subscribers for this topic.
TopicPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
Definition IceStorm.h:66
std::optional< Ice::ObjectPrx > subscribeAndGetPublisher(const QoS &theQoS, const std::optional< Ice::ObjectPrx > &subscriber, const Ice::Context &context=Ice::noExplicitContext) const
Subscribes to this topic.
std::future< std::optional< Ice::ObjectPrx > > subscribeAndGetPublisherAsync(const QoS &theQoS, const std::optional< Ice::ObjectPrx > &subscriber, const Ice::Context &context=Ice::noExplicitContext) const
Subscribes to this topic.
std::function< void()> linkAsync(const std::optional< TopicPrx > &linkTo, std::int32_t cost, std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Creates a link to another topic.
std::function< void()> destroyAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Destroys this topic.
TopicPrx(TopicPrx &&other) noexcept
Move constructor.
Definition IceStorm.h:74
TopicPrx & operator=(TopicPrx &&rhs) noexcept
Move assignment operator.
Definition IceStorm.h:92
std::future< void > unsubscribeAsync(const std::optional< Ice::ObjectPrx > &subscriber, const Ice::Context &context=Ice::noExplicitContext) const
Unsubscribes the provided subscriber from this topic.
std::future<::Ice::IdentitySeq > getSubscribersAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets the list of subscribers for this topic.
LinkInfoSeq getLinkInfoSeq(const Ice::Context &context=Ice::noExplicitContext) const
Gets information on the current links.
std::optional< Ice::ObjectPrx > getPublisher(const Ice::Context &context=Ice::noExplicitContext) const
Gets a proxy to a publisher object for this topic.
std::future< void > linkAsync(const std::optional< TopicPrx > &linkTo, std::int32_t cost, const Ice::Context &context=Ice::noExplicitContext) const
Creates a link to another topic.
TopicPrx & operator=(const TopicPrx &rhs) noexcept
Copy assignment operator.
Definition IceStorm.h:81
std::function< void()> getPublisherAsync(std::function< void(std::optional< Ice::ObjectPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets a proxy to a publisher object for this topic.
std::future< void > destroyAsync(const Ice::Context &context=Ice::noExplicitContext) const
Destroys this topic.
std::function< void()> getLinkInfoSeqAsync(std::function< void(::IceStorm::LinkInfoSeq)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets information on the current links.
std::function< void()> unsubscribeAsync(const std::optional< Ice::ObjectPrx > &subscriber, std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Unsubscribes the provided subscriber from this topic.
std::optional< Ice::ObjectPrx > getNonReplicatedPublisher(const Ice::Context &context=Ice::noExplicitContext) const
Gets a non-replicated proxy to a publisher object for this topic.
std::function< void()> subscribeAndGetPublisherAsync(const QoS &theQoS, const std::optional< Ice::ObjectPrx > &subscriber, std::function< void(std::optional< Ice::ObjectPrx >)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Subscribes to this topic.
std::future< std::optional< Ice::ObjectPrx > > getNonReplicatedPublisherAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets a non-replicated proxy to a publisher object for this topic.
void destroy(const Ice::Context &context=Ice::noExplicitContext) const
Destroys this topic.
std::function< void()> unlinkAsync(const std::optional< TopicPrx > &linkTo, std::function< void()> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Destroys a link from this topic to the provided topic.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::function< void()> getNameAsync(std::function< void(std::string)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Gets the name of this topic.
std::future< void > unlinkAsync(const std::optional< TopicPrx > &linkTo, const Ice::Context &context=Ice::noExplicitContext) const
Destroys a link from this topic to the provided topic.
std::string getName(const Ice::Context &context=Ice::noExplicitContext) const
Gets the name of this topic.
::Ice::IdentitySeq getSubscribers(const Ice::Context &context=Ice::noExplicitContext) const
Gets the list of subscribers for this topic.
std::future< std::string > getNameAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets the name of this topic.
TopicPrx(const TopicPrx &other) noexcept
Copy constructor.
Definition IceStorm.h:70
std::future< std::optional< Ice::ObjectPrx > > getPublisherAsync(const Ice::Context &context=Ice::noExplicitContext) const
Gets a proxy to a publisher object for this topic.
void unlink(const std::optional< TopicPrx > &linkTo, const Ice::Context &context=Ice::noExplicitContext) const
Destroys a link from this topic to the provided topic.
Represents an IceStorm topic.
Definition IceStorm.h:61
Represents a request received by a connection.
ObjectPrx & operator=(const ObjectPrx &rhs) noexcept=default
Copy assignment operator.
The base class for all Ice proxies.
Definition Proxy.h:232
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:45
Abstract base class for all Ice exceptions defined in Slice.
std::shared_ptr< TopicManager > TopicManagerPtr
A shared pointer to a TopicManager.
Definition IceStorm.h:1078
std::map< std::string, std::optional< TopicPrx > > TopicDict
A dictionary of topic name to topic proxy.
Definition IceStorm.h:47
std::vector< LinkInfo > LinkInfoSeq
A sequence of LinkInfo objects.
Definition IceStorm.h:40
std::shared_ptr< Topic > TopicPtr
A shared pointer to a Topic.
Definition IceStorm.h:1024
std::shared_ptr< Finder > FinderPtr
A shared pointer to a Finder.
Definition IceStorm.h:1115
std::map< std::string, std::string > QoS
Quality of service parameters.
Definition IceStorm.h:44
std::ostream & operator<<(std::ostream &os, const LinkInfo &value)
Outputs the description of a LinkInfo to a stream, including all its fields.
Lightweight publish/subscribe framework, available for all Ice language mappings.
Definition IceStorm.h:34
std::vector< Identity > IdentitySeq
A sequence of identities.
Definition Identity.h:31
std::shared_ptr< Communicator > CommunicatorPtr
A shared pointer to a Communicator.
const Context noExplicitContext
Marker value used to indicate that no explicit request context was passed to a proxy invocation.
std::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:28
The Ice RPC framework.
Definition SampleEvent.h:59
std::int32_t cost
The cost of traversing this link.
Definition IceStorm.h:629
void ice_printFields(std::ostream &os) const
Outputs the name and value of each field of this instance to the stream.
std::optional<::IceStorm::TopicPrx > theTopic
The linked topic proxy. This proxy is never null.
Definition IceStorm.h:623
std::tuple< const std::optional<::IceStorm::TopicPrx > &, const std::string &, const std::int32_t & > ice_tuple() const
Creates a tuple with all the fields of this struct.
Definition IceStorm.h:633
std::string name
The name of the linked topic.
Definition IceStorm.h:626
Information about a topic link.
Definition IceStorm.h:621
Provides information about an incoming request being dispatched.
Definition Current.h:18