Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
ServiceManager.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0
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 < 0
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.
108 /// @param exception The exception callback.
109 /// @param sent The sent callback.
110 /// @param context The request context.
111 /// @return A function that can be called to cancel the invocation locally.
112 // NOLINTNEXTLINE(modernize-use-nodiscard)
113 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;
114
115 /// @private
116 void _iceI_servicesStarted(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::StringSeq&, const Ice::Context&) const;
117
118 /// Receives the names of the services that were stopped.
119 /// @param services The names of the services that were stopped.
120 /// @param context The request context.
121 void servicesStopped(const ::Ice::StringSeq& services, const Ice::Context& context = Ice::noExplicitContext) const;
122
123 /// Receives the names of the services that were stopped.
124 /// @param services The names of the services that were stopped.
125 /// @param context The request context.
126 /// @return A future that becomes available when the invocation completes.
127 [[nodiscard]] std::future<void> servicesStoppedAsync(const ::Ice::StringSeq& services, const Ice::Context& context = Ice::noExplicitContext) const;
128
129 /// Receives the names of the services that were stopped.
130 /// @param services The names of the services that were stopped.
131 /// @param response The response callback.
132 /// @param exception The exception callback.
133 /// @param sent The sent callback.
134 /// @param context The request context.
135 /// @return A function that can be called to cancel the invocation locally.
136 // NOLINTNEXTLINE(modernize-use-nodiscard)
137 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;
138
139 /// @private
140 void _iceI_servicesStopped(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const ::Ice::StringSeq&, const Ice::Context&) const;
141
142 /// Gets the type ID of the associated Slice interface.
143 /// @return The string `"::IceBox::ServiceObserver"`.
144 static const char* ice_staticId() noexcept;
145
146 /// @private
147 static ServiceObserverPrx _fromReference(IceInternal::ReferencePtr ref) { return ServiceObserverPrx{std::move(ref)}; }
148
149 protected:
150 /// @private
151 ServiceObserverPrx() = default;
152
153 /// @private
154 explicit ServiceObserverPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
155 {
156 }
157 };
158
159 /// Administers the services of an IceBox server.
160 /// @remarks The Slice compiler generated this proxy class from Slice interface `::IceBox::ServiceManager`.
161 /// @headerfile IceBox/IceBox.h
162 class ICEBOX_API ServiceManagerPrx : public Ice::Proxy<ServiceManagerPrx, Ice::ObjectPrx>
163 {
164 public:
165 /// Constructs a proxy from a Communicator and a proxy string.
166 /// @param communicator The communicator of the new proxy.
167 /// @param proxyString The proxy string to parse.
168 ServiceManagerPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
169
170 /// Copy constructor. Constructs with a copy of the contents of @p other.
171 /// @param other The proxy to copy from.
172 ServiceManagerPrx(const ServiceManagerPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
173
174 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
175 /// @param other The proxy to move from.
176 ServiceManagerPrx(ServiceManagerPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
177
178 ~ServiceManagerPrx() override;
179
180 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
181 /// @param rhs The proxy to copy from.
182 /// @return A reference to this proxy.
184 {
185 if (this != &rhs)
186 {
188 }
189 return *this;
190 }
191
192 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
193 /// @param rhs The proxy to move from.
195 {
196 if (this != &rhs)
197 {
198 Ice::ObjectPrx::operator=(std::move(rhs));
199 }
200 return *this;
201 }
202
203 /// Starts a service.
204 /// @param service The service name.
205 /// @param context The request context.
206 /// @throws IceBox::AlreadyStartedException Thrown when the service is already running.
207 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
208 void startService(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
209
210 /// Starts a service.
211 /// @param service The service name.
212 /// @param context The request context.
213 /// @return A future that becomes available when the invocation completes.
214 [[nodiscard]] std::future<void> startServiceAsync(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
215
216 /// Starts a service.
217 /// @param service The service name.
218 /// @param response The response callback.
219 /// @param exception The exception callback.
220 /// @param sent The sent callback.
221 /// @param context The request context.
222 /// @return A function that can be called to cancel the invocation locally.
223 // NOLINTNEXTLINE(modernize-use-nodiscard)
224 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;
225
226 /// @private
227 void _iceI_startService(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const Ice::Context&) const;
228
229 /// Stops a service.
230 /// @param service The service name.
231 /// @param context The request context.
232 /// @throws IceBox::AlreadyStoppedException Thrown when the service is already stopped.
233 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
234 void stopService(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
235
236 /// Stops 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> stopServiceAsync(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
241
242 /// Stops a service.
243 /// @param service The service name.
244 /// @param response The response callback.
245 /// @param exception The exception callback.
246 /// @param sent The sent callback.
247 /// @param context The request context.
248 /// @return A function that can be called to cancel the invocation locally.
249 // NOLINTNEXTLINE(modernize-use-nodiscard)
250 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;
251
252 /// @private
253 void _iceI_stopService(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const Ice::Context&) const;
254
255 /// Returns whether a service is running.
256 /// @param service The name of the service to check.
257 /// @param context The request context.
258 /// @return `true` if the service was started and not stopped; otherwise `false`.
259 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
260 bool isServiceRunning(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
261
262 /// Returns whether a service is running.
263 /// @param service The name of the service to check.
264 /// @param context The request context.
265 /// @return A future that becomes available when the invocation completes. This future holds:
266 /// - `true` if the service was started and not stopped; otherwise `false`.
267 [[nodiscard]] std::future<bool> isServiceRunningAsync(std::string_view service, const Ice::Context& context = Ice::noExplicitContext) const;
268
269 /// Returns whether a service is running.
270 /// @param service The name of the service to check.
271 /// @param response The response callback. It accepts:
272 /// - `true` if the service was started and not stopped; otherwise `false`.
273 /// @param exception The exception callback.
274 /// @param sent The sent callback.
275 /// @param context The request context.
276 /// @return A function that can be called to cancel the invocation locally.
277 // NOLINTNEXTLINE(modernize-use-nodiscard)
278 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;
279
280 /// @private
281 void _iceI_isServiceRunning(const std::shared_ptr<IceInternal::OutgoingAsyncT<bool>>&, std::string_view, const Ice::Context&) const;
282
283 /// Registers a new observer with this service manager.
284 /// @param observer The new observer.
285 /// @param context The request context.
286 void addObserver(const std::optional<ServiceObserverPrx>& observer, const Ice::Context& context = Ice::noExplicitContext) const;
287
288 /// Registers a new observer with this service manager.
289 /// @param observer The new observer.
290 /// @param context The request context.
291 /// @return A future that becomes available when the invocation completes.
292 [[nodiscard]] std::future<void> addObserverAsync(const std::optional<ServiceObserverPrx>& observer, const Ice::Context& context = Ice::noExplicitContext) const;
293
294 /// Registers a new observer with this service manager.
295 /// @param observer The new observer.
296 /// @param response The response callback.
297 /// @param exception The exception callback.
298 /// @param sent The sent callback.
299 /// @param context The request context.
300 /// @return A function that can be called to cancel the invocation locally.
301 // NOLINTNEXTLINE(modernize-use-nodiscard)
302 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;
303
304 /// @private
305 void _iceI_addObserver(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const std::optional<ServiceObserverPrx>&, const Ice::Context&) const;
306
307 /// Shuts down all services.
308 /// @param context The request context.
309 void shutdown(const Ice::Context& context = Ice::noExplicitContext) const;
310
311 /// Shuts down all services.
312 /// @param context The request context.
313 /// @return A future that becomes available when the invocation completes.
314 [[nodiscard]] std::future<void> shutdownAsync(const Ice::Context& context = Ice::noExplicitContext) const;
315
316 /// Shuts down all services.
317 /// @param response The response callback.
318 /// @param exception The exception callback.
319 /// @param sent The sent callback.
320 /// @param context The request context.
321 /// @return A function that can be called to cancel the invocation locally.
322 // NOLINTNEXTLINE(modernize-use-nodiscard)
323 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;
324
325 /// @private
326 void _iceI_shutdown(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const Ice::Context&) const;
327
328 /// Gets the type ID of the associated Slice interface.
329 /// @return The string `"::IceBox::ServiceManager"`.
330 static const char* ice_staticId() noexcept;
331
332 /// @private
333 static ServiceManagerPrx _fromReference(IceInternal::ReferencePtr ref) { return ServiceManagerPrx{std::move(ref)}; }
334
335 protected:
336 /// @private
337 ServiceManagerPrx() = default;
338
339 /// @private
340 explicit ServiceManagerPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
341 {
342 }
343 };
344}
345
346namespace IceBox
347{
348 /// The exception that is thrown when attempting to start a service that is already running.
349 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceBox::AlreadyStartedException`.
350 /// @headerfile IceBox/IceBox.h
352 {
353 public:
354 /// Gets the type ID of the associated Slice exception.
355 /// @return The string `"::IceBox::AlreadyStartedException"`.
356 static const char* ice_staticId() noexcept;
357
358 [[nodiscard]] const char* ice_id() const noexcept override;
359
360 void ice_throw() const override;
361
362 protected:
363 /// @private
364 void _writeImpl(Ice::OutputStream*) const override;
365
366 /// @private
367 void _readImpl(Ice::InputStream*) override;
368 };
369
370 /// The exception that is thrown when attempting to stop a service that is already stopped.
371 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceBox::AlreadyStoppedException`.
372 /// @headerfile IceBox/IceBox.h
373 class ICEBOX_API AlreadyStoppedException : public Ice::UserException
374 {
375 public:
376 /// Gets the type ID of the associated Slice exception.
377 /// @return The string `"::IceBox::AlreadyStoppedException"`.
378 static const char* ice_staticId() noexcept;
379
380 [[nodiscard]] const char* ice_id() const noexcept override;
381
382 void ice_throw() const override;
383
384 protected:
385 /// @private
386 void _writeImpl(Ice::OutputStream*) const override;
387
388 /// @private
389 void _readImpl(Ice::InputStream*) override;
390 };
391
392 /// The exception that is thrown when a service name does not refer to a known service.
393 /// @remarks The Slice compiler generated this exception class from Slice exception `::IceBox::NoSuchServiceException`.
394 /// @headerfile IceBox/IceBox.h
395 class ICEBOX_API NoSuchServiceException : public Ice::UserException
396 {
397 public:
398 /// Gets the type ID of the associated Slice exception.
399 /// @return The string `"::IceBox::NoSuchServiceException"`.
400 static const char* ice_staticId() noexcept;
401
402 [[nodiscard]] const char* ice_id() const noexcept override;
403
404 void ice_throw() const override;
405
406 protected:
407 /// @private
408 void _writeImpl(Ice::OutputStream*) const override;
409
410 /// @private
411 void _readImpl(Ice::InputStream*) override;
412 };
413}
414
415namespace IceBox
416{
417 /// Observes the status of services in an IceBox server.
418 /// @remarks This interface is implemented by admin tools that monitor the IceBox server.
419 ///
420 /// The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceObserver`.
421 /// @see ServiceManagerPrx::addObserver
422 /// @headerfile IceBox/IceBox.h
423 class ICEBOX_API ServiceObserver : public virtual Ice::Object
424 {
425 public:
426 /// The associated proxy type.
428
429 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
430 /// @param request The incoming request.
431 /// @param sendResponse The callback to send the response.
432 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
433
434 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
435
436 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
437
438 /// Receives the names of the services that were started.
439 /// @param services The names of the services that were started.
440 /// @param current The Current object of the incoming request.
441 virtual void servicesStarted(::Ice::StringSeq services, const Ice::Current& current) = 0;
442
443 /// @private
444 void _iceD_servicesStarted(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
445
446 /// Receives the names of the services that were stopped.
447 /// @param services The names of the services that were stopped.
448 /// @param current The Current object of the incoming request.
449 virtual void servicesStopped(::Ice::StringSeq services, const Ice::Current& current) = 0;
450
451 /// @private
452 void _iceD_servicesStopped(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
453
454 /// Gets the type ID of the associated Slice interface.
455 /// @return The string `"::IceBox::ServiceObserver"`.
456 static const char* ice_staticId() noexcept;
457 };
458
459 /// A shared pointer to a ServiceObserver.
460 using ServiceObserverPtr = std::shared_ptr<ServiceObserver>;
461
462 /// Administers the services of an IceBox server.
463 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceManager`.
464 /// @headerfile IceBox/IceBox.h
465 class ICEBOX_API ServiceManager : public virtual Ice::Object
466 {
467 public:
468 /// The associated proxy type.
469 using ProxyType = ServiceManagerPrx;
470
471 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
472 /// @param request The incoming request.
473 /// @param sendResponse The callback to send the response.
474 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
475
476 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
477
478 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
479
480 /// Starts a service.
481 /// @param service The service name.
482 /// @param current The Current object of the incoming request.
483 /// @throws IceBox::AlreadyStartedException Thrown when the service is already running.
484 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
485 virtual void startService(std::string service, const Ice::Current& current) = 0;
486
487 /// @private
488 void _iceD_startService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
489
490 /// Stops a service.
491 /// @param service The service name.
492 /// @param current The Current object of the incoming request.
493 /// @throws IceBox::AlreadyStoppedException Thrown when the service is already stopped.
494 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
495 virtual void stopService(std::string service, const Ice::Current& current) = 0;
496
497 /// @private
498 void _iceD_stopService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
499
500 /// Returns whether a service is running.
501 /// @param service The name of the service to check.
502 /// @param current The Current object of the incoming request.
503 /// @return `true` if the service was started and not stopped; otherwise `false`.
504 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
505 virtual bool isServiceRunning(std::string service, const Ice::Current& current) = 0;
506
507 /// @private
508 void _iceD_isServiceRunning(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
509
510 /// Registers a new observer with this service manager.
511 /// @param observer The new observer.
512 /// @param current The Current object of the incoming request.
513 virtual void addObserver(std::optional<ServiceObserverPrx> observer, const Ice::Current& current) = 0;
514
515 /// @private
516 void _iceD_addObserver(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
517
518 /// Shuts down all services.
519 /// @param current The Current object of the incoming request.
520 virtual void shutdown(const Ice::Current& current) = 0;
521
522 /// @private
523 void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
524
525 /// Gets the type ID of the associated Slice interface.
526 /// @return The string `"::IceBox::ServiceManager"`.
527 static const char* ice_staticId() noexcept;
528 };
529
530 /// A shared pointer to a ServiceManager.
531 using ServiceManagerPtr = std::shared_ptr<ServiceManager>;
532}
533
534namespace IceBox
535{
536 /// Observes the status of services in an IceBox server.
537 /// @remarks This interface is implemented by admin tools that monitor the IceBox server.
538 ///
539 /// The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceObserver`.
540 /// @see ServiceManagerPrx::addObserver
541 /// @headerfile IceBox/IceBox.h
542 class ICEBOX_API AsyncServiceObserver : public virtual Ice::Object
543 {
544 public:
545 /// The associated proxy type.
547
548 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
549 /// @param request The incoming request.
550 /// @param sendResponse The callback to send the response.
551 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
552
553 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
554
555 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
556
557 /// Receives the names of the services that were started.
558 /// @param services The names of the services that were started.
559 /// @param response The response callback.
560 /// @param exception The exception callback.
561 /// @param current The Current object of the incoming request.
562 virtual void servicesStartedAsync(::Ice::StringSeq services, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
563
564 /// @private
565 void _iceD_servicesStarted(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
566
567 /// Receives the names of the services that were stopped.
568 /// @param services The names of the services that were stopped.
569 /// @param response The response callback.
570 /// @param exception The exception callback.
571 /// @param current The Current object of the incoming request.
572 virtual void servicesStoppedAsync(::Ice::StringSeq services, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
573
574 /// @private
575 void _iceD_servicesStopped(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
576
577 /// Gets the type ID of the associated Slice interface.
578 /// @return The string `"::IceBox::ServiceObserver"`.
579 static const char* ice_staticId() noexcept;
580 };
581
582 /// A shared pointer to an AsyncServiceObserver.
584
585 /// Administers the services of an IceBox server.
586 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::IceBox::ServiceManager`.
587 /// @headerfile IceBox/IceBox.h
588 class ICEBOX_API AsyncServiceManager : public virtual Ice::Object
589 {
590 public:
591 /// The associated proxy type.
593
594 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
595 /// @param request The incoming request.
596 /// @param sendResponse The callback to send the response.
597 void dispatch(Ice::IncomingRequest& request, std::function<void(Ice::OutgoingResponse)> sendResponse) override;
598
599 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
600
601 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
602
603 /// Starts a service.
604 /// @param service The service name.
605 /// @param response The response callback.
606 /// @param exception The exception callback.
607 /// @param current The Current object of the incoming request.
608 /// @throws IceBox::AlreadyStartedException Thrown when the service is already running.
609 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
610 virtual void startServiceAsync(std::string service, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
611
612 /// @private
613 void _iceD_startService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
614
615 /// Stops a service.
616 /// @param service The service name.
617 /// @param response The response callback.
618 /// @param exception The exception callback.
619 /// @param current The Current object of the incoming request.
620 /// @throws IceBox::AlreadyStoppedException Thrown when the service is already stopped.
621 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
622 virtual void stopServiceAsync(std::string service, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
623
624 /// @private
625 void _iceD_stopService(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
626
627 /// Returns whether a service is running.
628 /// @param service The name of the service to check.
629 /// @param response The response callback. It accepts:
630 /// - `true` if the service was started and not stopped; otherwise `false`.
631 /// @param exception The exception callback.
632 /// @param current The Current object of the incoming request.
633 /// @throws IceBox::NoSuchServiceException Thrown when IceBox does not know a service named @p service.
634 virtual void isServiceRunningAsync(std::string service, std::function<void(bool returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
635
636 /// @private
637 void _iceD_isServiceRunning(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
638
639 /// Registers a new observer with this service manager.
640 /// @param observer The new observer.
641 /// @param response The response callback.
642 /// @param exception The exception callback.
643 /// @param current The Current object of the incoming request.
644 virtual void addObserverAsync(std::optional<ServiceObserverPrx> observer, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
645
646 /// @private
647 void _iceD_addObserver(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
648
649 /// Shuts down all services.
650 /// @param response The response callback.
651 /// @param exception The exception callback.
652 /// @param current The Current object of the incoming request.
653 virtual void shutdownAsync(std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
654
655 /// @private
656 void _iceD_shutdown(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
657
658 /// Gets the type ID of the associated Slice interface.
659 /// @return The string `"::IceBox::ServiceManager"`.
660 static const char* ice_staticId() noexcept;
661 };
662
663 /// A shared pointer to an AsyncServiceManager.
665}
666
667// NOLINTEND(modernize-concat-nested-namespaces)
668
669#include <Ice/PopDisableWarnings.h>
670#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:232
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:45
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