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