Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
ServiceManager.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.3
4// <auto-generated>Generated from Slice file 'ServiceManager.ice'.</auto-generated>
5// clang-format off
6
7#ifndef IceBox_ServiceManager_h_
8#define IceBox_ServiceManager_h_
9
11#include <Ice/Ice.h>
12#include <Ice/BuiltinSequences.h>
13#include <IceBox/Config.h>
14
15#ifndef ICE_DISABLE_VERSION
16# if ICE_INT_VERSION / 100 != 308
17# error Ice version mismatch!
18# endif
19# if ICE_INT_VERSION % 100 >= 50
20# error Beta header file detected
21# endif
22# if ICE_INT_VERSION % 100 < 3
23# error Ice patch level mismatch!
24# endif
25#endif
26
27#ifndef ICEBOX_API
28# if defined(ICEBOX_API_EXPORTS)
29# define ICEBOX_API ICE_DECLSPEC_EXPORT
30# else
31# define ICEBOX_API ICE_DECLSPEC_IMPORT
32# endif
33#endif
34
35// NOLINTBEGIN(modernize-concat-nested-namespaces)
36
37/// Host multiple independent services in the same Ice server.
38namespace IceBox
39{
41
43}
44
45namespace IceBox
46{
47 /// Observes the status of services in an IceBox server.
48 /// @remarks This interface is implemented by admin tools that monitor the IceBox server.
49 ///
50 /// The Slice compiler generated this proxy class from Slice interface `::IceBox::ServiceObserver`.
51 /// @see ServiceManagerPrx::addObserver
52 /// @headerfile IceBox/IceBox.h
53 class ICEBOX_API ServiceObserverPrx : public Ice::Proxy<ServiceObserverPrx, Ice::ObjectPrx>
54 {
55 public:
56 /// Constructs a proxy from a Communicator and a proxy string.
57 /// @param communicator The communicator of the new proxy.
58 /// @param proxyString The proxy string to parse.
59 ServiceObserverPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
60
61 /// Copy constructor. Constructs with a copy of the contents of @p other.
62 /// @param other The proxy to copy from.
63 ServiceObserverPrx(const ServiceObserverPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
64
65 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
66 /// @param other The proxy to move from.
67 ServiceObserverPrx(ServiceObserverPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
68
69 ~ServiceObserverPrx() override;
70
71 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
72 /// @param rhs The proxy to copy from.
73 /// @return A reference to this proxy.
75 {
76 if (this != &rhs)
77 {
79 }
80 return *this;
81 }
82
83 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
84 /// @param rhs The proxy to move from.
86 {
87 if (this != &rhs)
88 {
89 Ice::ObjectPrx::operator=(std::move(rhs));
90 }
91 return *this;
92 }
93
94 /// Receives the names of the services that were started.
95 /// @param services The names of the services that were started.
96 /// @param context The request context.
97 void servicesStarted(const ::Ice::StringSeq& services, const Ice::Context& context = Ice::noExplicitContext) const;
98
99 /// Receives the names of the services that were started.
100 /// @param services The names of the services that were started.
101 /// @param context The request context.
102 /// @return A future that becomes available when the invocation completes.
103 [[nodiscard]] std::future<void> servicesStartedAsync(const ::Ice::StringSeq& services, const Ice::Context& context = Ice::noExplicitContext) const;
104
105 /// Receives the names of the services that were started.
106 /// @param services The names of the services that were started.
107 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
108 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
109 /// function.
110 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
111 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
112 /// function.
113 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
114 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
115 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
116 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
117 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
118 /// asynchronous case.
119 /// @param context The request context.
120 /// @return A function that can be called to cancel the invocation locally.
121 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
122 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
123 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
124 /// callbacks, and the request is sent later, by a flush.
125 // NOLINTNEXTLINE(modernize-use-nodiscard)
126 std::function<void()> servicesStartedAsync(const ::Ice::StringSeq& services, 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;
127
128 /// @private
129 void _iceI_servicesStarted(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::StringSeq&, const Ice::Context&) const;
130
131 /// Receives the names of the services that were stopped.
132 /// @param services The names of the services that were stopped.
133 /// @param context The request context.
134 void servicesStopped(const ::Ice::StringSeq& services, const Ice::Context& context = Ice::noExplicitContext) const;
135
136 /// Receives the names of the services that were stopped.
137 /// @param services The names of the services that were stopped.
138 /// @param context The request context.
139 /// @return A future that becomes available when the invocation completes.
140 [[nodiscard]] std::future<void> servicesStoppedAsync(const ::Ice::StringSeq& services, const Ice::Context& context = Ice::noExplicitContext) const;
141
142 /// Receives the names of the services that were stopped.
143 /// @param services The names of the services that were stopped.
144 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
145 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
146 /// function.
147 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
148 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
149 /// function.
150 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
151 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
152 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
153 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
154 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
155 /// asynchronous case.
156 /// @param context The request context.
157 /// @return A function that can be called to cancel the invocation locally.
158 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
159 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
160 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
161 /// callbacks, and the request is sent later, by a flush.
162 // NOLINTNEXTLINE(modernize-use-nodiscard)
163 std::function<void()> servicesStoppedAsync(const ::Ice::StringSeq& services, 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;
164
165 /// @private
166 void _iceI_servicesStopped(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::StringSeq&, const Ice::Context&) const;
167
168 /// Gets the type ID of the associated Slice interface.
169 /// @return The string `"::IceBox::ServiceObserver"`.
170 static const char* ice_staticId() noexcept;
171
172 /// @private
173 static ServiceObserverPrx _fromReference(IceInternal::ReferencePtr ref) { return ServiceObserverPrx{std::move(ref)}; }
174
175 protected:
176 /// @private
177 ServiceObserverPrx() = default;
178
179 /// @private
180 explicit ServiceObserverPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
181 {
182 }
183 };
184
185 /// Administers the services of an IceBox server.
186 /// @remarks The Slice compiler generated this proxy class from Slice interface `::IceBox::ServiceManager`.
187 /// @headerfile IceBox/IceBox.h
188 class ICEBOX_API ServiceManagerPrx : public Ice::Proxy<ServiceManagerPrx, Ice::ObjectPrx>
189 {
190 public:
191 /// Constructs a proxy from a Communicator and a proxy string.
192 /// @param communicator The communicator of the new proxy.
193 /// @param proxyString The proxy string to parse.
194 ServiceManagerPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
195
196 /// Copy constructor. Constructs with a copy of the contents of @p other.
197 /// @param other The proxy to copy from.
198 ServiceManagerPrx(const ServiceManagerPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
199
200 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
201 /// @param other The proxy to move from.
202 ServiceManagerPrx(ServiceManagerPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
203
204 ~ServiceManagerPrx() override;
205
206 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
207 /// @param rhs The proxy to copy from.
208 /// @return A reference to this proxy.
210 {
211 if (this != &rhs)
212 {
214 }
215 return *this;
216 }
217
218 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
219 /// @param rhs The proxy to move from.
221 {
222 if (this != &rhs)
223 {
224 Ice::ObjectPrx::operator=(std::move(rhs));
225 }
226 return *this;
227 }
228
229 /// Starts a service.
230 /// @param service The service name.
231 /// @param context The request context.
232 /// @throws IceBox::AlreadyStartedException Thrown when the service is already running.
233 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
234 void startService(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
235
236 /// Starts a service.
237 /// @param service The service name.
238 /// @param context The request context.
239 /// @return A future that becomes available when the invocation completes.
240 [[nodiscard]] std::future<void> startServiceAsync(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
241
242 /// Starts a service.
243 /// @param service The service name.
244 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
245 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
246 /// function.
247 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
248 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
249 /// function.
250 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
251 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
252 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
253 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
254 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
255 /// asynchronous case.
256 /// @param context The request context.
257 /// @return A function that can be called to cancel the invocation locally.
258 // NOLINTNEXTLINE(modernize-use-nodiscard)
259 std::function<void()> startServiceAsync(std::string_view service, 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;
260
261 /// @private
262 void _iceI_startService(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const Ice::Context&) const;
263
264 /// Stops a service.
265 /// @param service The service name.
266 /// @param context The request context.
267 /// @throws IceBox::AlreadyStoppedException Thrown when the service is already stopped.
268 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
269 void stopService(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
270
271 /// Stops a service.
272 /// @param service The service name.
273 /// @param context The request context.
274 /// @return A future that becomes available when the invocation completes.
275 [[nodiscard]] std::future<void> stopServiceAsync(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
276
277 /// Stops a service.
278 /// @param service The service name.
279 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
280 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
281 /// function.
282 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
283 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
284 /// function.
285 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
286 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
287 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
288 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
289 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
290 /// asynchronous case.
291 /// @param context The request context.
292 /// @return A function that can be called to cancel the invocation locally.
293 // NOLINTNEXTLINE(modernize-use-nodiscard)
294 std::function<void()> stopServiceAsync(std::string_view service, 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;
295
296 /// @private
297 void _iceI_stopService(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const Ice::Context&) const;
298
299 /// Returns whether a service is running.
300 /// @param service The name of the service to check.
301 /// @param context The request context.
302 /// @return `true` if the service was started and not stopped; otherwise `false`.
303 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
304 bool isServiceRunning(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
305
306 /// Returns whether a service is running.
307 /// @param service The name of the service to check.
308 /// @param context The request context.
309 /// @return A future that becomes available when the invocation completes. This future holds:
310 /// - `true` if the service was started and not stopped; otherwise `false`.
311 [[nodiscard]] std::future<bool> isServiceRunningAsync(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
312
313 /// Returns whether a service is running.
314 /// @param service The name of the service to check.
315 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
316 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
317 /// function. It accepts:
318 /// - `true` if the service was started and not stopped; otherwise `false`.
319 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
320 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
321 /// function.
322 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
323 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
324 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
325 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
326 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
327 /// asynchronous case.
328 /// @param context The request context.
329 /// @return A function that can be called to cancel the invocation locally.
330 // NOLINTNEXTLINE(modernize-use-nodiscard)
331 std::function<void()> isServiceRunningAsync(std::string_view service, std::function<void(bool)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
332
333 /// @private
334 void _iceI_isServiceRunning(const std::shared_ptr<IceInternal::OutgoingAsyncT<bool>>&, std::string_view, const Ice::Context&) const;
335
336 /// Registers a new observer with this service manager.
337 /// @param observer The new observer.
338 /// @param context The request context.
339 void addObserver(const std::optional<ServiceObserverPrx>& observer, const Ice::Context& context = Ice::noExplicitContext) const;
340
341 /// Registers a new observer with this service manager.
342 /// @param observer The new observer.
343 /// @param context The request context.
344 /// @return A future that becomes available when the invocation completes.
345 [[nodiscard]] std::future<void> addObserverAsync(const std::optional<ServiceObserverPrx>& observer, const Ice::Context& context = Ice::noExplicitContext) const;
346
347 /// Registers a new observer with this service manager.
348 /// @param observer The new observer.
349 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
350 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
351 /// function.
352 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
353 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
354 /// function.
355 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
356 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
357 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
358 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
359 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
360 /// asynchronous case.
361 /// @param context The request context.
362 /// @return A function that can be called to cancel the invocation locally.
363 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
364 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
365 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
366 /// callbacks, and the request is sent later, by a flush.
367 // NOLINTNEXTLINE(modernize-use-nodiscard)
368 std::function<void()> addObserverAsync(const std::optional<ServiceObserverPrx>& observer, 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;
369
370 /// @private
371 void _iceI_addObserver(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const std::optional<ServiceObserverPrx>&, const Ice::Context&) const;
372
373 /// Shuts down all services.
374 /// @param context The request context.
375 void shutdown(const Ice::Context& context = Ice::noExplicitContext) const;
376
377 /// Shuts down all services.
378 /// @param context The request context.
379 /// @return A future that becomes available when the invocation completes.
380 [[nodiscard]] std::future<void> shutdownAsync(const Ice::Context& context = Ice::noExplicitContext) const;
381
382 /// Shuts down all services.
383 /// @param response The response callback. The Ice runtime calls this function from an Ice thread pool
384 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
385 /// function.
386 /// @param exception The exception callback. The Ice runtime calls this function from an Ice thread pool
387 /// thread. If you set Ice::InitializationData::executor, the executor determines the thread that executes this
388 /// function.
389 /// @param sent The sent callback. The Ice runtime calls this function when the request is accepted by the
390 /// transport. When the request is accepted synchronously, the Ice runtime calls this function from the current
391 /// thread and passes `true` as argument. When the request is accepted asynchronously, the Ice runtime calls
392 /// this function from an Ice thread pool thread and passes `false` as argument. If you set
393 /// Ice::InitializationData::executor, the executor determines the thread that executes this function in the
394 /// asynchronous case.
395 /// @param context The request context.
396 /// @return A function that can be called to cancel the invocation locally.
397 /// @remark When this proxy is a oneway or datagram proxy, the Ice runtime does not call the response
398 /// callback: a successful invocation completes with the sent callback. When this proxy is a batch
399 /// proxy, this function only adds the request to the batch: the Ice runtime calls none of the
400 /// callbacks, and the request is sent later, by a flush.
401 // NOLINTNEXTLINE(modernize-use-nodiscard)
402 std::function<void()> shutdownAsync(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;
403
404 /// @private
405 void _iceI_shutdown(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
406
407 /// Gets the type ID of the associated Slice interface.
408 /// @return The string `"::IceBox::ServiceManager"`.
409 static const char* ice_staticId() noexcept;
410
411 /// @private
412 static ServiceManagerPrx _fromReference(IceInternal::ReferencePtr ref) { return ServiceManagerPrx{std::move(ref)}; }
413
414 protected:
415 /// @private
416 ServiceManagerPrx() = default;
417
418 /// @private
419 explicit ServiceManagerPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
420 {
421 }
422 };
423}
424
425namespace IceBox
426{
427 /// The exception that is thrown when attempting to start a service that is already running.
428 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceBox::AlreadyStartedException`.
429 /// @headerfile IceBox/IceBox.h
431 {
432 public:
433 /// Gets the type ID of the associated Slice exception.
434 /// @return The string `"::IceBox::AlreadyStartedException"`.
435 static const char* ice_staticId() noexcept;
436
437 [[nodiscard]] const char* ice_id() const noexcept override;
438
439 void ice_throw() const override;
440
441 protected:
442 /// @private
443 void _writeImpl(Ice::OutputStream*) const override;
444
445 /// @private
446 void _readImpl(Ice::InputStream*) override;
447 };
448
449 /// The exception that is thrown when attempting to stop a service that is already stopped.
450 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceBox::AlreadyStoppedException`.
451 /// @headerfile IceBox/IceBox.h
452 class ICEBOX_API AlreadyStoppedException : public Ice::UserException
453 {
454 public:
455 /// Gets the type ID of the associated Slice exception.
456 /// @return The string `"::IceBox::AlreadyStoppedException"`.
457 static const char* ice_staticId() noexcept;
458
459 [[nodiscard]] const char* ice_id() const noexcept override;
460
461 void ice_throw() const override;
462
463 protected:
464 /// @private
465 void _writeImpl(Ice::OutputStream*) const override;
466
467 /// @private
468 void _readImpl(Ice::InputStream*) override;
469 };
470
471 /// The exception that is thrown when a service name does not refer to a known service.
472 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceBox::NoSuchServiceException`.
473 /// @headerfile IceBox/IceBox.h
474 class ICEBOX_API NoSuchServiceException : public Ice::UserException
475 {
476 public:
477 /// Gets the type ID of the associated Slice exception.
478 /// @return The string `"::IceBox::NoSuchServiceException"`.
479 static const char* ice_staticId() noexcept;
480
481 [[nodiscard]] const char* ice_id() const noexcept override;
482
483 void ice_throw() const override;
484
485 protected:
486 /// @private
487 void _writeImpl(Ice::OutputStream*) const override;
488
489 /// @private
490 void _readImpl(Ice::InputStream*) override;
491 };
492}
493
494namespace IceBox
495{
496 /// Observes the status of services in an IceBox server.
497 /// @remarks This interface is implemented by admin tools that monitor the IceBox server.
498 ///
499 /// The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceObserver`.
500 /// @see ServiceManagerPrx::addObserver
501 /// @headerfile IceBox/IceBox.h
502 class ICEBOX_API ServiceObserver : public virtual Ice::Object
503 {
504 public:
505 /// The associated proxy type.
507
508 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
509 /// @param request The incoming request.
510 /// @param sendResponse The callback to send the response.
511 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
512
513 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
514
515 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
516
517 /// Receives the names of the services that were started.
518 /// @param services The names of the services that were started.
519 /// @param current The Current object of the incoming request.
520 virtual void servicesStarted(::Ice::StringSeq services, const Ice::Current& current) = 0;
521
522 /// @private
523 void _iceD_servicesStarted(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
524
525 /// Receives the names of the services that were stopped.
526 /// @param services The names of the services that were stopped.
527 /// @param current The Current object of the incoming request.
528 virtual void servicesStopped(::Ice::StringSeq services, const Ice::Current& current) = 0;
529
530 /// @private
531 void _iceD_servicesStopped(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
532
533 /// Gets the type ID of the associated Slice interface.
534 /// @return The string `"::IceBox::ServiceObserver"`.
535 static const char* ice_staticId() noexcept;
536 };
537
538 /// A shared pointer to a ServiceObserver.
539 using ServiceObserverPtr = std::shared_ptr<ServiceObserver>;
540
541 /// Administers the services of an IceBox server.
542 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceManager`.
543 /// @headerfile IceBox/IceBox.h
544 class ICEBOX_API ServiceManager : public virtual Ice::Object
545 {
546 public:
547 /// The associated proxy type.
548 using ProxyType = ServiceManagerPrx;
549
550 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
551 /// @param request The incoming request.
552 /// @param sendResponse The callback to send the response.
553 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
554
555 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
556
557 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
558
559 /// Starts a service.
560 /// @param service The service name.
561 /// @param current The Current object of the incoming request.
562 /// @throws IceBox::AlreadyStartedException Thrown when the service is already running.
563 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
564 virtual void startService(std::string service, const Ice::Current& current) = 0;
565
566 /// @private
567 void _iceD_startService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
568
569 /// Stops a service.
570 /// @param service The service name.
571 /// @param current The Current object of the incoming request.
572 /// @throws IceBox::AlreadyStoppedException Thrown when the service is already stopped.
573 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
574 virtual void stopService(std::string service, const Ice::Current& current) = 0;
575
576 /// @private
577 void _iceD_stopService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
578
579 /// Returns whether a service is running.
580 /// @param service The name of the service to check.
581 /// @param current The Current object of the incoming request.
582 /// @return `true` if the service was started and not stopped; otherwise `false`.
583 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
584 virtual bool isServiceRunning(std::string service, const Ice::Current& current) = 0;
585
586 /// @private
587 void _iceD_isServiceRunning(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
588
589 /// Registers a new observer with this service manager.
590 /// @param observer The new observer.
591 /// @param current The Current object of the incoming request.
592 virtual void addObserver(std::optional<ServiceObserverPrx> observer, const Ice::Current& current) = 0;
593
594 /// @private
595 void _iceD_addObserver(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
596
597 /// Shuts down all services.
598 /// @param current The Current object of the incoming request.
599 virtual void shutdown(const Ice::Current& current) = 0;
600
601 /// @private
602 void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
603
604 /// Gets the type ID of the associated Slice interface.
605 /// @return The string `"::IceBox::ServiceManager"`.
606 static const char* ice_staticId() noexcept;
607 };
608
609 /// A shared pointer to a ServiceManager.
610 using ServiceManagerPtr = std::shared_ptr<ServiceManager>;
611}
612
613namespace IceBox
614{
615 /// Observes the status of services in an IceBox server.
616 /// @remarks This interface is implemented by admin tools that monitor the IceBox server.
617 ///
618 /// The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceObserver`.
619 /// @see ServiceManagerPrx::addObserver
620 /// @headerfile IceBox/IceBox.h
621 class ICEBOX_API AsyncServiceObserver : public virtual Ice::Object
622 {
623 public:
624 /// The associated proxy type.
626
627 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
628 /// @param request The incoming request.
629 /// @param sendResponse The callback to send the response.
630 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
631
632 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
633
634 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
635
636 /// Receives the names of the services that were started.
637 /// @param services The names of the services that were started.
638 /// @param response The response callback.
639 /// @param exception The exception callback.
640 /// @param current The Current object of the incoming request.
641 virtual void servicesStartedAsync(::Ice::StringSeq services, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
642
643 /// @private
644 void _iceD_servicesStarted(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
645
646 /// Receives the names of the services that were stopped.
647 /// @param services The names of the services that were stopped.
648 /// @param response The response callback.
649 /// @param exception The exception callback.
650 /// @param current The Current object of the incoming request.
651 virtual void servicesStoppedAsync(::Ice::StringSeq services, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
652
653 /// @private
654 void _iceD_servicesStopped(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
655
656 /// Gets the type ID of the associated Slice interface.
657 /// @return The string `"::IceBox::ServiceObserver"`.
658 static const char* ice_staticId() noexcept;
659 };
660
661 /// A shared pointer to an AsyncServiceObserver.
663
664 /// Administers the services of an IceBox server.
665 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceManager`.
666 /// @headerfile IceBox/IceBox.h
667 class ICEBOX_API AsyncServiceManager : public virtual Ice::Object
668 {
669 public:
670 /// The associated proxy type.
672
673 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
674 /// @param request The incoming request.
675 /// @param sendResponse The callback to send the response.
676 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
677
678 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
679
680 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
681
682 /// Starts a service.
683 /// @param service The service name.
684 /// @param response The response callback.
685 /// @param exception The exception callback.
686 /// @param current The Current object of the incoming request.
687 /// @throws IceBox::AlreadyStartedException Thrown when the service is already running.
688 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
689 virtual void startServiceAsync(std::string service, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
690
691 /// @private
692 void _iceD_startService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
693
694 /// Stops a service.
695 /// @param service The service name.
696 /// @param response The response callback.
697 /// @param exception The exception callback.
698 /// @param current The Current object of the incoming request.
699 /// @throws IceBox::AlreadyStoppedException Thrown when the service is already stopped.
700 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
701 virtual void stopServiceAsync(std::string service, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
702
703 /// @private
704 void _iceD_stopService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
705
706 /// Returns whether a service is running.
707 /// @param service The name of the service to check.
708 /// @param response The response callback. It accepts:
709 /// - `true` if the service was started and not stopped; otherwise `false`.
710 /// @param exception The exception callback.
711 /// @param current The Current object of the incoming request.
712 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
713 virtual void isServiceRunningAsync(std::string service, std::function<void(bool returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
714
715 /// @private
716 void _iceD_isServiceRunning(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
717
718 /// Registers a new observer with this service manager.
719 /// @param observer The new observer.
720 /// @param response The response callback.
721 /// @param exception The exception callback.
722 /// @param current The Current object of the incoming request.
723 virtual void addObserverAsync(std::optional<ServiceObserverPrx> observer, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
724
725 /// @private
726 void _iceD_addObserver(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
727
728 /// Shuts down all services.
729 /// @param response The response callback.
730 /// @param exception The exception callback.
731 /// @param current The Current object of the incoming request.
732 virtual void shutdownAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
733
734 /// @private
735 void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
736
737 /// Gets the type ID of the associated Slice interface.
738 /// @return The string `"::IceBox::ServiceManager"`.
739 static const char* ice_staticId() noexcept;
740 };
741
742 /// A shared pointer to an AsyncServiceManager.
744}
745
746// NOLINTEND(modernize-concat-nested-namespaces)
747
748#include <Ice/PopDisableWarnings.h>
749#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 start a service that is already running.
void ice_throw() const override
Throws 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.
The exception that is thrown when attempting to stop a service that is already stopped.
virtual void startServiceAsync(std::string service, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Starts a service.
virtual void shutdownAsync(std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Shuts down all services.
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
virtual void addObserverAsync(std::optional< ServiceObserverPrx > observer, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Registers a new observer with this service manager.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
virtual void stopServiceAsync(std::string service, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Stops a service.
ServiceManagerPrx ProxyType
The associated proxy type.
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
virtual void isServiceRunningAsync(std::string service, std::function< void(bool returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Returns whether a service is running.
Administers the services of an IceBox server.
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
virtual void servicesStoppedAsync(::Ice::StringSeq services, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Receives the names of the services that were stopped.
ServiceObserverPrx ProxyType
The associated proxy type.
virtual void servicesStartedAsync(::Ice::StringSeq services, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Receives the names of the services that were started.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
Observes the status of services in an IceBox server.
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 a service name does not refer to a known service.
std::function< void()> addObserverAsync(const std::optional< ServiceObserverPrx > &observer, 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
Registers a new observer with this service manager.
void stopService(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Stops a service.
std::function< void()> stopServiceAsync(std::string_view service, 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
Stops a service.
ServiceManagerPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
std::future< bool > isServiceRunningAsync(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Returns whether a service is running.
ServiceManagerPrx & operator=(const ServiceManagerPrx &rhs) noexcept
Copy assignment operator.
void shutdown(const Ice::Context &context=Ice::noExplicitContext) const
Shuts down all services.
std::future< void > shutdownAsync(const Ice::Context &context=Ice::noExplicitContext) const
Shuts down all services.
std::function< void()> startServiceAsync(std::string_view service, 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
Starts a service.
std::future< void > startServiceAsync(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Starts a service.
ServiceManagerPrx(const ServiceManagerPrx &other) noexcept
Copy constructor.
std::function< void()> shutdownAsync(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
Shuts down all services.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
bool isServiceRunning(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Returns whether a service is running.
void startService(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Starts a service.
void addObserver(const std::optional< ServiceObserverPrx > &observer, const Ice::Context &context=Ice::noExplicitContext) const
Registers a new observer with this service manager.
std::future< void > stopServiceAsync(std::string_view service, const Ice::Context &context=Ice::noExplicitContext) const
Stops a service.
std::function< void()> isServiceRunningAsync(std::string_view service, std::function< void(bool)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Returns whether a service is running.
std::future< void > addObserverAsync(const std::optional< ServiceObserverPrx > &observer, const Ice::Context &context=Ice::noExplicitContext) const
Registers a new observer with this service manager.
ServiceManagerPrx & operator=(ServiceManagerPrx &&rhs) noexcept
Move assignment operator.
ServiceManagerPrx(ServiceManagerPrx &&other) noexcept
Move constructor.
Administers the services of an IceBox server.
std::future< void > servicesStoppedAsync(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were stopped.
std::future< void > servicesStartedAsync(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were started.
ServiceObserverPrx(ServiceObserverPrx &&other) noexcept
Move constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
ServiceObserverPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
void servicesStopped(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were stopped.
ServiceObserverPrx & operator=(ServiceObserverPrx &&rhs) noexcept
Move assignment operator.
ServiceObserverPrx(const ServiceObserverPrx &other) noexcept
Copy constructor.
std::function< void()> servicesStoppedAsync(const ::Ice::StringSeq &services, 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
Receives the names of the services that were stopped.
std::function< void()> servicesStartedAsync(const ::Ice::StringSeq &services, 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
Receives the names of the services that were started.
void servicesStarted(const ::Ice::StringSeq &services, const Ice::Context &context=Ice::noExplicitContext) const
Receives the names of the services that were started.
ServiceObserverPrx & operator=(const ServiceObserverPrx &rhs) noexcept
Copy assignment operator.
Observes the status of services in an IceBox server.
virtual void servicesStarted(::Ice::StringSeq services, const Ice::Current &current)=0
Receives the names of the services that were started.
virtual void servicesStopped(::Ice::StringSeq services, const Ice::Current &current)=0
Receives the names of the services that were stopped.
std::vector< std::string > ice_ids(const Ice::Current &current) const override
Gets the Slice interfaces supported by this object as a list of Slice type IDs.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
void dispatch(Ice::IncomingRequest &request, std::function< void(Ice::OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
ServiceObserverPrx ProxyType
The associated proxy type.
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
Observes the status of services in an IceBox server.
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:265
Object() noexcept=default
Default constructor.
The base class for servants.
Definition Object.h:21
Represents the response to an incoming request.
Provides typed proxy functions.
Definition Proxy.h:48
Abstract base class for all exceptions defined in Slice.
std::shared_ptr< AsyncServiceManager > AsyncServiceManagerPtr
A shared pointer to an AsyncServiceManager.
std::shared_ptr< ServiceManager > ServiceManagerPtr
A shared pointer to a ServiceManager.
std::shared_ptr< ServiceObserver > ServiceObserverPtr
A shared pointer to a ServiceObserver.
std::shared_ptr< AsyncServiceObserver > AsyncServiceObserverPtr
A shared pointer to an AsyncServiceObserver.
Host multiple independent services in the same Ice server.
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::vector< std::string > StringSeq
A sequence of strings.
std::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:34
The Ice RPC framework.
Definition SampleEvent.h:66
Provides information about an incoming request being dispatched.
Definition Current.h:18