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