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