Ice 3.8
C++ API Reference
Loading...
Searching...
No Matches
RemoteLogger.h
1// Copyright (c) ZeroC, Inc.
2
3// slice2cpp version 3.8.0
4// <auto-generated>Generated from Slice file 'RemoteLogger.ice'.</auto-generated>
5// clang-format off
6
7#ifndef Ice_RemoteLogger_h_
8#define Ice_RemoteLogger_h_
9
11#include <Ice/Ice.h>
12#include "BuiltinSequences.h"
13#include <list>
14
15#ifndef ICE_DISABLE_VERSION
16# if ICE_INT_VERSION / 100 != 308
17# error Ice version mismatch!
18# endif
19# if ICE_INT_VERSION % 100 >= 50
20# error Beta header file detected
21# endif
22# if ICE_INT_VERSION % 100 < 0
23# error Ice patch level mismatch!
24# endif
25#endif
26
27// NOLINTBEGIN(modernize-concat-nested-namespaces)
28
29namespace Ice
30{
31 /// Represents the different types of log messages.
32 /// @remarks The Slice compiler generated this enum class from Slice enumeration `::Ice::LogMessageType`.
33 enum class LogMessageType : std::uint8_t
34 {
35 /// The ::Ice::RemoteLoggerPrx received a print message.
37
38 /// The ::Ice::RemoteLoggerPrx received a trace message.
40
41 /// The ::Ice::RemoteLoggerPrx received a warning message.
43
44 /// The ::Ice::RemoteLoggerPrx received an error message.
46 };
47
48 /// Outputs the enumerator name or underlying value of a LogMessageType to a stream.
49 /// @param os The output stream.
50 /// @param value The value to output.
51 /// @return The output stream.
52 ICE_API std::ostream& operator<<(std::ostream& os, LogMessageType value);
53
54 /// A sequence of #LogMessageType.
55 using LogMessageTypeSeq = std::vector<LogMessageType>;
56
57 struct LogMessage;
58
59 /// A sequence of LogMessage.
60 using LogMessageSeq = std::list<LogMessage>;
61
62 class RemoteLoggerPrx;
63
64 class LoggerAdminPrx;
65}
66
67namespace Ice
68{
69 /// Represents an Ice object that accepts log messages. It's called by the implementation of LoggerAdminPrx.
70 /// @remarks The Slice compiler generated this proxy class from Slice interface `::Ice::RemoteLogger`.
71 /// @headerfile Ice/Ice.h
72 class ICE_API RemoteLoggerPrx : public Ice::Proxy<RemoteLoggerPrx, Ice::ObjectPrx>
73 {
74 public:
75 /// Constructs a proxy from a Communicator and a proxy string.
76 /// @param communicator The communicator of the new proxy.
77 /// @param proxyString The proxy string to parse.
78 RemoteLoggerPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
79
80 /// Copy constructor. Constructs with a copy of the contents of @p other.
81 /// @param other The proxy to copy from.
82 RemoteLoggerPrx(const RemoteLoggerPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
83
84 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
85 /// @param other The proxy to move from.
86 RemoteLoggerPrx(RemoteLoggerPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
87
88 ~RemoteLoggerPrx() override;
89
90 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
91 /// @param rhs The proxy to copy from.
92 /// @return A reference to this proxy.
94 {
95 if (this != &rhs)
96 {
98 }
99 return *this;
100 }
101
102 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
103 /// @param rhs The proxy to move from.
105 {
106 if (this != &rhs)
107 {
108 Ice::ObjectPrx::operator=(std::move(rhs));
109 }
110 return *this;
111 }
112
113 /// Attaches a remote logger to the local logger.
114 /// @param prefix The prefix of the associated local Logger.
115 /// @param logMessages Old log messages generated before "now".
116 /// @param context The request context.
117 void init(std::string_view prefix, const LogMessageSeq& logMessages, const Ice::Context& context = Ice::noExplicitContext) const;
118
119 /// Attaches a remote logger to the local logger.
120 /// @param prefix The prefix of the associated local Logger.
121 /// @param logMessages Old log messages generated before "now".
122 /// @param context The request context.
123 /// @return A future that becomes available when the invocation completes.
124 [[nodiscard]] std::future<void> initAsync(std::string_view prefix, const LogMessageSeq& logMessages, const Ice::Context& context = Ice::noExplicitContext) const;
125
126 /// Attaches a remote logger to the local logger.
127 /// @param prefix The prefix of the associated local Logger.
128 /// @param logMessages Old log messages generated before "now".
129 /// @param response The response callback.
130 /// @param exception The exception callback.
131 /// @param sent The sent callback.
132 /// @param context The request context.
133 /// @return A function that can be called to cancel the invocation locally.
134 // NOLINTNEXTLINE(modernize-use-nodiscard)
135 std::function<void()> initAsync(std::string_view prefix, const LogMessageSeq& logMessages, 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;
136
137 /// @private
138 void _iceI_init(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const LogMessageSeq&, const Ice::Context&) const;
139
140 /// Logs a LogMessage.
141 /// @param message The message to log.
142 /// @param context The request context.
143 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
144 void log(const LogMessage& message, const Ice::Context& context = Ice::noExplicitContext) const;
145
146 /// Logs a LogMessage.
147 /// @param message The message to log.
148 /// @param context The request context.
149 /// @return A future that becomes available when the invocation completes.
150 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
151 [[nodiscard]] std::future<void> logAsync(const LogMessage& message, const Ice::Context& context = Ice::noExplicitContext) const;
152
153 /// Logs a LogMessage.
154 /// @param message The message to log.
155 /// @param response The response callback.
156 /// @param exception The exception callback.
157 /// @param sent The sent callback.
158 /// @param context The request context.
159 /// @return A function that can be called to cancel the invocation locally.
160 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
161 // NOLINTNEXTLINE(modernize-use-nodiscard)
162 std::function<void()> logAsync(const LogMessage& message, 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;
163
164 /// @private
165 void _iceI_log(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const LogMessage&, const Ice::Context&) const;
166
167 /// Gets the type ID of the associated Slice interface.
168 /// @return The string `"::Ice::RemoteLogger"`.
169 static const char* ice_staticId() noexcept;
170
171 /// @private
172 static RemoteLoggerPrx _fromReference(IceInternal::ReferencePtr ref) { return RemoteLoggerPrx{std::move(ref)}; }
173
174 protected:
175 /// @private
176 RemoteLoggerPrx() = default;
177
178 /// @private
179 explicit RemoteLoggerPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
180 {
181 }
182 };
183
184 /// Represents the admin facet that allows an Ice application to attach its RemoteLoggerPrx to the local
185 /// logger of an Ice communicator.
186 /// @remarks The Slice compiler generated this proxy class from Slice interface `::Ice::LoggerAdmin`.
187 /// @headerfile Ice/Ice.h
188 class ICE_API LoggerAdminPrx : public Ice::Proxy<LoggerAdminPrx, Ice::ObjectPrx>
189 {
190 public:
191 /// Constructs a proxy from a Communicator and a proxy string.
192 /// @param communicator The communicator of the new proxy.
193 /// @param proxyString The proxy string to parse.
194 LoggerAdminPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
195
196 /// Copy constructor. Constructs with a copy of the contents of @p other.
197 /// @param other The proxy to copy from.
198 LoggerAdminPrx(const LoggerAdminPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
199
200 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
201 /// @param other The proxy to move from.
202 LoggerAdminPrx(LoggerAdminPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
203
204 ~LoggerAdminPrx() override;
205
206 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
207 /// @param rhs The proxy to copy from.
208 /// @return A reference to this proxy.
210 {
211 if (this != &rhs)
212 {
214 }
215 return *this;
216 }
217
218 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
219 /// @param rhs The proxy to move from.
221 {
222 if (this != &rhs)
223 {
224 Ice::ObjectPrx::operator=(std::move(rhs));
225 }
226 return *this;
227 }
228
229 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
230 /// on @p prx.
231 /// @param prx A proxy to the remote logger.
232 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
233 /// no filtering (send all message types).
234 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
235 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
236 /// (send all trace categories).
237 /// @param messageMax The maximum number of log messages (of all types) to be provided to
238 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
239 /// @param context The request context.
240 /// @throws Ice::RemoteLoggerAlreadyAttachedException Thrown if this remote logger is already attached to this admin
241 /// object.
242 void attachRemoteLogger(const std::optional<RemoteLoggerPrx>& prx, const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, const Ice::Context& context = Ice::noExplicitContext) const;
243
244 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
245 /// on @p prx.
246 /// @param prx A proxy to the remote logger.
247 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
248 /// no filtering (send all message types).
249 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
250 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
251 /// (send all trace categories).
252 /// @param messageMax The maximum number of log messages (of all types) to be provided to
253 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
254 /// @param context The request context.
255 /// @return A future that becomes available when the invocation completes.
256 [[nodiscard]] std::future<void> attachRemoteLoggerAsync(const std::optional<RemoteLoggerPrx>& prx, const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, const Ice::Context& context = Ice::noExplicitContext) const;
257
258 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
259 /// on @p prx.
260 /// @param prx A proxy to the remote logger.
261 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
262 /// no filtering (send all message types).
263 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
264 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
265 /// (send all trace categories).
266 /// @param messageMax The maximum number of log messages (of all types) to be provided to
267 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
268 /// @param response The response callback.
269 /// @param exception The exception callback.
270 /// @param sent The sent callback.
271 /// @param context The request context.
272 /// @return A function that can be called to cancel the invocation locally.
273 // NOLINTNEXTLINE(modernize-use-nodiscard)
274 std::function<void()> attachRemoteLoggerAsync(const std::optional<RemoteLoggerPrx>& prx, const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, 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;
275
276 /// @private
277 void _iceI_attachRemoteLogger(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const std::optional<RemoteLoggerPrx>&, const LogMessageTypeSeq&, const StringSeq&, std::int32_t, const Ice::Context&) const;
278
279 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
280 /// @param prx A proxy to the remote logger.
281 /// @param context The request context.
282 /// @return `true` if the provided remote logger proxy was detached, and `false` otherwise.
283 bool detachRemoteLogger(const std::optional<RemoteLoggerPrx>& prx, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
284
285 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
286 /// @param prx A proxy to the remote logger.
287 /// @param context The request context.
288 /// @return A future that becomes available when the invocation completes. This future holds:
289 /// - `true` if the provided remote logger proxy was detached, and `false` otherwise.
290 [[nodiscard]] std::future<bool> detachRemoteLoggerAsync(const std::optional<RemoteLoggerPrx>& prx, const Ice::Context& context = Ice::noExplicitContext) const;
291
292 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
293 /// @param prx A proxy to the remote logger.
294 /// @param response The response callback. It accepts:
295 /// - `true` if the provided remote logger proxy was detached, and `false` otherwise.
296 /// @param exception The exception callback.
297 /// @param sent The sent callback.
298 /// @param context The request context.
299 /// @return A function that can be called to cancel the invocation locally.
300 // NOLINTNEXTLINE(modernize-use-nodiscard)
301 std::function<void()> detachRemoteLoggerAsync(const std::optional<RemoteLoggerPrx>& prx, 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;
302
303 /// @private
304 void _iceI_detachRemoteLogger(const std::shared_ptr<IceInternal::OutgoingAsyncT<bool>>&, const std::optional<RemoteLoggerPrx>&, const Ice::Context&) const;
305
306 /// Retrieves recently logged log messages.
307 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
308 /// filtering (send all message types).
309 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
310 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
311 /// categories).
312 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
313 /// requests all messages available.
314 /// @param[out] prefix The prefix of the associated local logger.
315 /// @param context The request context.
316 /// @return The Log messages.
317 LogMessageSeq getLog(const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, std::string& prefix, const Ice::Context& context = Ice::noExplicitContext) const;
318
319 /// Retrieves recently logged log messages.
320 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
321 /// filtering (send all message types).
322 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
323 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
324 /// categories).
325 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
326 /// requests all messages available.
327 /// @param context The request context.
328 /// @return A future that becomes available when the invocation completes. This future holds:
329 /// - `returnValue` The Log messages.
330 /// - `prefix` The prefix of the associated local logger.
331 [[nodiscard]] std::future<std::tuple<LogMessageSeq, std::string>> getLogAsync(const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, const Ice::Context& context = Ice::noExplicitContext) const;
332
333 /// Retrieves recently logged log messages.
334 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
335 /// filtering (send all message types).
336 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
337 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
338 /// categories).
339 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
340 /// requests all messages available.
341 /// @param response The response callback. It accepts:
342 /// - `returnValue` The Log messages.
343 /// - `prefix` The prefix of the associated local logger.
344 /// @param exception The exception callback.
345 /// @param sent The sent callback.
346 /// @param context The request context.
347 /// @return A function that can be called to cancel the invocation locally.
348 // NOLINTNEXTLINE(modernize-use-nodiscard)
349 std::function<void()> getLogAsync(const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, std::function<void(::Ice::LogMessageSeq, std::string)> response, std::function<void(std::exception_ptr)> exception = nullptr, std::function<void(bool)> sent = nullptr, const Ice::Context& context = Ice::noExplicitContext) const;
350
351 /// @private
352 void _iceI_getLog(const std::shared_ptr<IceInternal::OutgoingAsyncT<std::tuple<LogMessageSeq, std::string>>>&, const LogMessageTypeSeq&, const StringSeq&, std::int32_t, const Ice::Context&) const;
353
354 /// Gets the type ID of the associated Slice interface.
355 /// @return The string `"::Ice::LoggerAdmin"`.
356 static const char* ice_staticId() noexcept;
357
358 /// @private
359 static LoggerAdminPrx _fromReference(IceInternal::ReferencePtr ref) { return LoggerAdminPrx{std::move(ref)}; }
360
361 protected:
362 /// @private
363 LoggerAdminPrx() = default;
364
365 /// @private
366 explicit LoggerAdminPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
367 {
368 }
369 };
370}
371
372namespace Ice
373{
374 /// Represents a full log message.
375 /// @remarks The Slice compiler generated this struct from Slice struct `::Ice::LogMessage`.
376 /// @headerfile Ice/Ice.h
378 {
379 /// The type of message sent to the ::Ice::RemoteLoggerPrx.
381
382 /// The date and time when the ::Ice::RemoteLoggerPrx received this message, expressed as the number of
383 /// microseconds since the Unix Epoch (00:00:00 UTC on 1 January 1970).
384 std::int64_t timestamp;
385
386 /// For a message of type 'trace', the trace category of this log message; otherwise, the empty string.
387 std::string traceCategory;
388
389 /// The log message itself.
390 std::string message;
391
392 /// Creates a tuple with all the fields of this struct.
393 /// @return A tuple with all the fields of this struct.
394 [[nodiscard]] std::tuple<const ::Ice::LogMessageType&, const std::int64_t&, const std::string&, const std::string&> ice_tuple() const
395 {
396 return std::tie(type, timestamp, traceCategory, message);
397 }
398
399 /// Outputs the name and value of each field of this instance to the stream.
400 /// @param os The output stream.
401 ICE_API void ice_printFields(std::ostream& os) const;
402 };
403
404 /// Outputs the description of a LogMessage to a stream, including all its fields.
405 /// @param os The output stream.
406 /// @param value The instance to output.
407 /// @return The output stream.
408 ICE_API std::ostream& operator<<(std::ostream& os, const LogMessage& value);
409
410 /// Thrown when the provided RemoteLoggerPrx was previously attached to a LoggerAdminPrx.
411 /// @remarks The Slice compiler generated this exception class from Slice exception `::Ice::RemoteLoggerAlreadyAttachedException`.
412 /// @headerfile Ice/Ice.h
414 {
415 public:
416 /// Gets the type ID of the associated Slice exception.
417 /// @return The string `"::Ice::RemoteLoggerAlreadyAttachedException"`.
418 static const char* ice_staticId() noexcept;
419
420 [[nodiscard]] const char* ice_id() const noexcept override;
421
422 void ice_throw() const override;
423
424 protected:
425 /// @private
426 void _writeImpl(Ice::OutputStream*) const override;
427
428 /// @private
429 void _readImpl(Ice::InputStream*) override;
430 };
431
432 /// @cond INTERNAL
433 using Ice::Tuple::operator<;
434 using Ice::Tuple::operator<=;
435 using Ice::Tuple::operator>;
436 using Ice::Tuple::operator>=;
437 using Ice::Tuple::operator==;
438 using Ice::Tuple::operator!=;
439 /// @endcond
440}
441
442namespace Ice
443{
444 /// Represents an Ice object that accepts log messages. It's called by the implementation of LoggerAdminPrx.
445 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::RemoteLogger`.
446 /// @headerfile Ice/Ice.h
447 class ICE_API RemoteLogger : public virtual Ice::Object
448 {
449 public:
450 /// The associated proxy type.
452
453 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
454 /// @param request The incoming request.
455 /// @param sendResponse The callback to send the response.
456 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
457
458 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
459
460 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
461
462 /// Attaches a remote logger to the local logger.
463 /// @param prefix The prefix of the associated local Logger.
464 /// @param logMessages Old log messages generated before "now".
465 /// @param current The Current object of the incoming request.
466 virtual void init(std::string prefix, LogMessageSeq logMessages, const Ice::Current& current) = 0;
467
468 /// @private
469 void _iceD_init(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
470
471 /// Logs a LogMessage.
472 /// @param message The message to log.
473 /// @param current The Current object of the incoming request.
474 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
475 virtual void log(LogMessage message, const Ice::Current& current) = 0;
476
477 /// @private
478 void _iceD_log(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
479
480 /// Gets the type ID of the associated Slice interface.
481 /// @return The string `"::Ice::RemoteLogger"`.
482 static const char* ice_staticId() noexcept;
483 };
484
485 /// A shared pointer to a RemoteLogger.
486 using RemoteLoggerPtr = std::shared_ptr<RemoteLogger>;
487
488 /// Represents the admin facet that allows an Ice application to attach its RemoteLoggerPrx to the local
489 /// logger of an Ice communicator.
490 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::LoggerAdmin`.
491 /// @headerfile Ice/Ice.h
492 class ICE_API LoggerAdmin : public virtual Ice::Object
493 {
494 public:
495 /// The associated proxy type.
496 using ProxyType = LoggerAdminPrx;
497
498 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
499 /// @param request The incoming request.
500 /// @param sendResponse The callback to send the response.
501 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
502
503 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
504
505 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
506
507 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
508 /// on @p prx.
509 /// @param prx A proxy to the remote logger.
510 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
511 /// no filtering (send all message types).
512 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
513 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
514 /// (send all trace categories).
515 /// @param messageMax The maximum number of log messages (of all types) to be provided to
516 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
517 /// @param current The Current object of the incoming request.
518 /// @throws Ice::RemoteLoggerAlreadyAttachedException Thrown if this remote logger is already attached to this admin
519 /// object.
520 virtual void attachRemoteLogger(std::optional<RemoteLoggerPrx> prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, const Ice::Current& current) = 0;
521
522 /// @private
523 void _iceD_attachRemoteLogger(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
524
525 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
526 /// @param prx A proxy to the remote logger.
527 /// @param current The Current object of the incoming request.
528 /// @return `true` if the provided remote logger proxy was detached, and `false` otherwise.
529 virtual bool detachRemoteLogger(std::optional<RemoteLoggerPrx> prx, const Ice::Current& current) = 0;
530
531 /// @private
532 void _iceD_detachRemoteLogger(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
533
534 /// Retrieves recently logged log messages.
535 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
536 /// filtering (send all message types).
537 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
538 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
539 /// categories).
540 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
541 /// requests all messages available.
542 /// @param[out] prefix The prefix of the associated local logger.
543 /// @param current The Current object of the incoming request.
544 /// @return The Log messages.
545 virtual LogMessageSeq getLog(LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, std::string& prefix, const Ice::Current& current) = 0;
546
547 /// @private
548 void _iceD_getLog(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
549
550 /// Gets the type ID of the associated Slice interface.
551 /// @return The string `"::Ice::LoggerAdmin"`.
552 static const char* ice_staticId() noexcept;
553 };
554
555 /// A shared pointer to a LoggerAdmin.
556 using LoggerAdminPtr = std::shared_ptr<LoggerAdmin>;
557}
558
559namespace Ice
560{
561 /// Represents an Ice object that accepts log messages. It's called by the implementation of LoggerAdminPrx.
562 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::RemoteLogger`.
563 /// @headerfile Ice/Ice.h
564 class ICE_API AsyncRemoteLogger : public virtual Ice::Object
565 {
566 public:
567 /// The associated proxy type.
569
570 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
571 /// @param request The incoming request.
572 /// @param sendResponse The callback to send the response.
573 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
574
575 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
576
577 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
578
579 /// Attaches a remote logger to the local logger.
580 /// @param prefix The prefix of the associated local Logger.
581 /// @param logMessages Old log messages generated before "now".
582 /// @param response The response callback.
583 /// @param exception The exception callback.
584 /// @param current The Current object of the incoming request.
585 virtual void initAsync(std::string prefix, LogMessageSeq logMessages, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
586
587 /// @private
588 void _iceD_init(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
589
590 /// Logs a LogMessage.
591 /// @param message The message to log.
592 /// @param response The response callback.
593 /// @param exception The exception callback.
594 /// @param current The Current object of the incoming request.
595 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
596 virtual void logAsync(LogMessage message, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
597
598 /// @private
599 void _iceD_log(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
600
601 /// Gets the type ID of the associated Slice interface.
602 /// @return The string `"::Ice::RemoteLogger"`.
603 static const char* ice_staticId() noexcept;
604 };
605
606 /// A shared pointer to an AsyncRemoteLogger.
607 using AsyncRemoteLoggerPtr = std::shared_ptr<AsyncRemoteLogger>;
608
609 /// Represents the admin facet that allows an Ice application to attach its RemoteLoggerPrx to the local
610 /// logger of an Ice communicator.
611 /// @remarks The Slice compiler generated this skeleton class from Slice interface `::Ice::LoggerAdmin`.
612 /// @headerfile Ice/Ice.h
613 class ICE_API AsyncLoggerAdmin : public virtual Ice::Object
614 {
615 public:
616 /// The associated proxy type.
618
619 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
620 /// @param request The incoming request.
621 /// @param sendResponse The callback to send the response.
622 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
623
624 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
625
626 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
627
628 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
629 /// on @p prx.
630 /// @param prx A proxy to the remote logger.
631 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
632 /// no filtering (send all message types).
633 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
634 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
635 /// (send all trace categories).
636 /// @param messageMax The maximum number of log messages (of all types) to be provided to
637 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
638 /// @param response The response callback.
639 /// @param exception The exception callback.
640 /// @param current The Current object of the incoming request.
641 /// @throws Ice::RemoteLoggerAlreadyAttachedException Thrown if this remote logger is already attached to this admin
642 /// object.
643 virtual void attachRemoteLoggerAsync(std::optional<RemoteLoggerPrx> prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, std::function<void()> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
644
645 /// @private
646 void _iceD_attachRemoteLogger(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
647
648 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
649 /// @param prx A proxy to the remote logger.
650 /// @param response The response callback. It accepts:
651 /// - `true` if the provided remote logger proxy was detached, and `false` otherwise.
652 /// @param exception The exception callback.
653 /// @param current The Current object of the incoming request.
654 virtual void detachRemoteLoggerAsync(std::optional<RemoteLoggerPrx> prx, std::function<void(bool returnValue)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
655
656 /// @private
657 void _iceD_detachRemoteLogger(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
658
659 /// Retrieves recently logged log messages.
660 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
661 /// filtering (send all message types).
662 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
663 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
664 /// categories).
665 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
666 /// requests all messages available.
667 /// @param response The response callback. It accepts:
668 /// - `returnValue` The Log messages.
669 /// - `prefix` The prefix of the associated local logger.
670 /// @param exception The exception callback.
671 /// @param current The Current object of the incoming request.
672 virtual void getLogAsync(LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, std::function<void(const LogMessageSeq& returnValue, std::string_view prefix)> response, std::function<void(std::exception_ptr)> exception, const Ice::Current& current) = 0;
673
674 /// @private
675 void _iceD_getLog(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
676
677 /// Gets the type ID of the associated Slice interface.
678 /// @return The string `"::Ice::LoggerAdmin"`.
679 static const char* ice_staticId() noexcept;
680 };
681
682 /// A shared pointer to an AsyncLoggerAdmin.
683 using AsyncLoggerAdminPtr = std::shared_ptr<AsyncLoggerAdmin>;
684}
685
686namespace Ice
687{
688 /// @cond INTERNAL
689 template<>
691 {
692 static constexpr StreamHelperCategory helper = StreamHelperCategoryEnum;
693 static constexpr int minValue = 0;
694 static constexpr int maxValue = 3;
695 static constexpr int minWireSize = 1;
696 static constexpr bool fixedLength = false;
697 };
698 /// @endcond
699
700 /// @cond INTERNAL
701 template<>
703 {
704 static constexpr StreamHelperCategory helper = StreamHelperCategoryStruct;
705 static constexpr int minWireSize = 11;
706 static constexpr bool fixedLength = false;
707 };
708
709 template<>
710 struct StreamReader<::Ice::LogMessage>
711 {
712 /// Unmarshals a ::Ice::LogMessage from the input stream.
713 static void read(InputStream* istr, ::Ice::LogMessage& v)
714 {
715 istr->readAll(v.type, v.timestamp, v.traceCategory, v.message);
716 }
717 };
718 /// @endcond
719}
720
721// NOLINTEND(modernize-concat-nested-namespaces)
722
724#endif
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
void dispatch(IncomingRequest &request, std::function< void(OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
LoggerAdminPrx ProxyType
The associated proxy type.
virtual void getLogAsync(LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, std::function< void(const LogMessageSeq &returnValue, std::string_view prefix)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Retrieves recently logged log messages.
virtual void attachRemoteLoggerAsync(std::optional< RemoteLoggerPrx > prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Attaches a Ice::RemoteLoggerPrx object to the local logger.
virtual void detachRemoteLoggerAsync(std::optional< RemoteLoggerPrx > prx, std::function< void(bool returnValue)> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Detaches a Ice::RemoteLoggerPrx object from the local logger.
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.
Represents the admin facet that allows an Ice application to attach its RemoteLoggerPrx to the local ...
RemoteLoggerPrx ProxyType
The associated proxy type.
virtual void logAsync(LogMessage message, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Logs a LogMessage.
void dispatch(IncomingRequest &request, std::function< void(OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
std::string ice_id(const Ice::Current &current) const override
Gets the type ID of the most-derived Slice interface supported by this object.
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.
virtual void initAsync(std::string prefix, LogMessageSeq logMessages, std::function< void()> response, std::function< void(std::exception_ptr)> exception, const Ice::Current &current)=0
Attaches a remote logger to the local logger.
Represents an Ice object that accepts log messages.
Represents a request received by a connection.
void readAll(T &v)
Reads a value (single element list) from the stream.
Represents a byte buffer used for unmarshaling data encoded using the Slice encoding.
Definition InputStream.h:50
LoggerAdminPrx(const LoggerAdminPrx &other) noexcept
Copy constructor.
bool detachRemoteLogger(const std::optional< RemoteLoggerPrx > &prx, const Ice::Context &context=Ice::noExplicitContext) const
Detaches a Ice::RemoteLoggerPrx object from the local logger.
std::function< void()> detachRemoteLoggerAsync(const std::optional< RemoteLoggerPrx > &prx, 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
Detaches a Ice::RemoteLoggerPrx object from the local logger.
LoggerAdminPrx & operator=(const LoggerAdminPrx &rhs) noexcept
Copy assignment operator.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::future< void > attachRemoteLoggerAsync(const std::optional< RemoteLoggerPrx > &prx, const LogMessageTypeSeq &messageTypes, const StringSeq &traceCategories, std::int32_t messageMax, const Ice::Context &context=Ice::noExplicitContext) const
Attaches a Ice::RemoteLoggerPrx object to the local logger.
LoggerAdminPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
std::function< void()> attachRemoteLoggerAsync(const std::optional< RemoteLoggerPrx > &prx, const LogMessageTypeSeq &messageTypes, const StringSeq &traceCategories, std::int32_t messageMax, 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
Attaches a Ice::RemoteLoggerPrx object to the local logger.
LogMessageSeq getLog(const LogMessageTypeSeq &messageTypes, const StringSeq &traceCategories, std::int32_t messageMax, std::string &prefix, const Ice::Context &context=Ice::noExplicitContext) const
Retrieves recently logged log messages.
LoggerAdminPrx(LoggerAdminPrx &&other) noexcept
Move constructor.
LoggerAdminPrx & operator=(LoggerAdminPrx &&rhs) noexcept
Move assignment operator.
void attachRemoteLogger(const std::optional< RemoteLoggerPrx > &prx, const LogMessageTypeSeq &messageTypes, const StringSeq &traceCategories, std::int32_t messageMax, const Ice::Context &context=Ice::noExplicitContext) const
Attaches a Ice::RemoteLoggerPrx object to the local logger.
std::future< bool > detachRemoteLoggerAsync(const std::optional< RemoteLoggerPrx > &prx, const Ice::Context &context=Ice::noExplicitContext) const
Detaches a Ice::RemoteLoggerPrx object from the local logger.
std::future< std::tuple< LogMessageSeq, std::string > > getLogAsync(const LogMessageTypeSeq &messageTypes, const StringSeq &traceCategories, std::int32_t messageMax, const Ice::Context &context=Ice::noExplicitContext) const
Retrieves recently logged log messages.
std::function< void()> getLogAsync(const LogMessageTypeSeq &messageTypes, const StringSeq &traceCategories, std::int32_t messageMax, std::function< void(::Ice::LogMessageSeq, std::string)> response, std::function< void(std::exception_ptr)> exception=nullptr, std::function< void(bool)> sent=nullptr, const Ice::Context &context=Ice::noExplicitContext) const
Retrieves recently logged log messages.
Represents the admin facet that allows an Ice application to attach its RemoteLoggerPrx to the local ...
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.
Represents a byte buffer used for marshaling data using the Slice encoding.
Provides typed proxy functions.
Definition Proxy.h:45
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.
Thrown when the provided RemoteLoggerPrx was previously attached to a LoggerAdminPrx.
RemoteLoggerPrx(const Ice::CommunicatorPtr &communicator, std::string_view proxyString)
Constructs a proxy from a Communicator and a proxy string.
void log(const LogMessage &message, const Ice::Context &context=Ice::noExplicitContext) const
Logs a LogMessage.
std::function< void()> initAsync(std::string_view prefix, const LogMessageSeq &logMessages, 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
Attaches a remote logger to the local logger.
RemoteLoggerPrx & operator=(RemoteLoggerPrx &&rhs) noexcept
Move assignment operator.
RemoteLoggerPrx(RemoteLoggerPrx &&other) noexcept
Move constructor.
RemoteLoggerPrx & operator=(const RemoteLoggerPrx &rhs) noexcept
Copy assignment operator.
std::future< void > logAsync(const LogMessage &message, const Ice::Context &context=Ice::noExplicitContext) const
Logs a LogMessage.
void init(std::string_view prefix, const LogMessageSeq &logMessages, const Ice::Context &context=Ice::noExplicitContext) const
Attaches a remote logger to the local logger.
std::function< void()> logAsync(const LogMessage &message, 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
Logs a LogMessage.
RemoteLoggerPrx(const RemoteLoggerPrx &other) noexcept
Copy constructor.
static const char * ice_staticId() noexcept
Gets the type ID of the associated Slice interface.
std::future< void > initAsync(std::string_view prefix, const LogMessageSeq &logMessages, const Ice::Context &context=Ice::noExplicitContext) const
Attaches a remote logger to the local logger.
Represents an Ice object that accepts log messages.
virtual void log(LogMessage message, const Ice::Current &current)=0
Logs a LogMessage.
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.
RemoteLoggerPrx ProxyType
The associated proxy type.
void dispatch(IncomingRequest &request, std::function< void(OutgoingResponse)> sendResponse) override
Dispatches an incoming request to one of the member functions of this generated class,...
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.
virtual void init(std::string prefix, LogMessageSeq logMessages, const Ice::Current &current)=0
Attaches a remote logger to the local logger.
Represents an Ice object that accepts log messages.
Abstract base class for all exceptions defined in Slice.
Relational operators for generated structs.
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::list< LogMessage > LogMessageSeq
A sequence of LogMessage.
std::shared_ptr< LoggerAdmin > LoggerAdminPtr
A shared pointer to a LoggerAdmin.
LogMessageType
Represents the different types of log messages.
@ TraceMessage
The Ice::RemoteLoggerPrx received a trace message.
@ PrintMessage
The Ice::RemoteLoggerPrx received a print message.
@ ErrorMessage
The Ice::RemoteLoggerPrx received an error message.
@ WarningMessage
The Ice::RemoteLoggerPrx received a warning message.
constexpr StreamHelperCategory StreamHelperCategoryEnum
Generated enum types.
int StreamHelperCategory
The stream helper category allows to select a StreamHelper specialization for a specific category of ...
std::vector< std::string > StringSeq
A sequence of strings.
constexpr StreamHelperCategory StreamHelperCategoryStruct
Generated struct types.
std::vector< LogMessageType > LogMessageTypeSeq
A sequence of LogMessageType.
std::ostream & operator<<(std::ostream &os, const Identity &value)
Outputs the description of an Identity to a stream, including all its fields.
std::shared_ptr< AsyncLoggerAdmin > AsyncLoggerAdminPtr
A shared pointer to an AsyncLoggerAdmin.
std::shared_ptr< RemoteLogger > RemoteLoggerPtr
A shared pointer to a RemoteLogger.
std::map< std::string, std::string, std::less<> > Context
Represents additional information carried by an Ice request.
Definition Context.h:34
std::shared_ptr< AsyncRemoteLogger > AsyncRemoteLoggerPtr
A shared pointer to an AsyncRemoteLogger.
The Ice RPC framework.
Definition SampleEvent.h:66
Provides information about an incoming request being dispatched.
Definition Current.h:18
std::tuple< const ::Ice::LogMessageType &, const std::int64_t &, const std::string &, const std::string & > ice_tuple() const
Creates a tuple with all the fields of this struct.
std::string message
The log message itself.
::Ice::LogMessageType type
The type of message sent to the Ice::RemoteLoggerPrx.
void ice_printFields(std::ostream &os) const
Outputs the name and value of each field of this instance to the stream.
std::string traceCategory
For a message of type 'trace', the trace category of this log message; otherwise, the empty string.
std::int64_t timestamp
The date and time when the Ice::RemoteLoggerPrx received this message, expressed as the number of mic...
Represents a full log message.
Provides traits for a type that can be marshaled or unmarshaled to/from a stream of bytes using the S...