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 enum class LogMessageType : std::uint8_t
27 {
28 /// The ::Ice::RemoteLoggerPrx received a print message.
30
31 /// The ::Ice::RemoteLoggerPrx received a trace message.
33
34 /// The ::Ice::RemoteLoggerPrx received a warning message.
36
37 /// The ::Ice::RemoteLoggerPrx received an error message.
39 };
40
41 /// Outputs the enumerator name or underlying value of a LogMessageType to a stream.
42 /// @param os The output stream.
43 /// @param value The value to output.
44 /// @return The output stream.
45 ICE_API std::ostream& operator<<(std::ostream& os, LogMessageType value);
46
47 /// A sequence of #LogMessageType.
48 using LogMessageTypeSeq = std::vector<LogMessageType>;
49
50 struct LogMessage;
51
52 /// A sequence of LogMessage.
53 using LogMessageSeq = std::list<LogMessage>;
54
55 class RemoteLoggerPrx;
56
57 class LoggerAdminPrx;
58}
59
60namespace Ice
61{
62 /// Represents an Ice object that accepts log messages. It's called by the implementation of LoggerAdminPrx.
63 /// @headerfile Ice/Ice.h
64 class ICE_API RemoteLoggerPrx : public Ice::Proxy<RemoteLoggerPrx, Ice::ObjectPrx>
65 {
66 public:
67 /// Constructs a proxy from a Communicator and a proxy string.
68 /// @param communicator The communicator of the new proxy.
69 /// @param proxyString The proxy string to parse.
70 RemoteLoggerPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
71
72 /// Copy constructor. Constructs with a copy of the contents of @p other.
73 /// @param other The proxy to copy from.
74 RemoteLoggerPrx(const RemoteLoggerPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
75
76 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
77 /// @param other The proxy to move from.
78 RemoteLoggerPrx(RemoteLoggerPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
79
80 ~RemoteLoggerPrx() override;
81
82 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
83 /// @param rhs The proxy to copy from.
84 /// @return A reference to this proxy.
86 {
87 if (this != &rhs)
88 {
90 }
91 return *this;
92 }
93
94 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
95 /// @param rhs The proxy to move from.
97 {
98 if (this != &rhs)
99 {
100 Ice::ObjectPrx::operator=(std::move(rhs));
101 }
102 return *this;
103 }
104
105 /// Attaches a remote logger to the local logger.
106 /// @param prefix The prefix of the associated local Logger.
107 /// @param logMessages Old log messages generated before "now".
108 /// @param context The request context.
109 void init(std::string_view prefix, const LogMessageSeq& logMessages, const Ice::Context& context = Ice::noExplicitContext) const;
110
111 /// Attaches a remote logger to the local logger.
112 /// @param prefix The prefix of the associated local Logger.
113 /// @param logMessages Old log messages generated before "now".
114 /// @param context The request context.
115 /// @return A future that becomes available when the invocation completes.
116 [[nodiscard]] std::future<void> initAsync(std::string_view prefix, const LogMessageSeq& logMessages, const Ice::Context& context = Ice::noExplicitContext) const;
117
118 /// Attaches a remote logger to the local logger.
119 /// @param prefix The prefix of the associated local Logger.
120 /// @param logMessages Old log messages generated before "now".
121 /// @param response The response callback.
122 /// @param exception The exception callback.
123 /// @param sent The sent callback.
124 /// @param context The request context.
125 /// @return A function that can be called to cancel the invocation locally.
126 // NOLINTNEXTLINE(modernize-use-nodiscard)
127 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;
128
129 /// @private
130 void _iceI_init(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, std::string_view, const LogMessageSeq&, const Ice::Context&) const;
131
132 /// Logs a LogMessage.
133 /// @param message The message to log.
134 /// @param context The request context.
135 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
136 void log(const LogMessage& message, const Ice::Context& context = Ice::noExplicitContext) const;
137
138 /// Logs a LogMessage.
139 /// @param message The message to log.
140 /// @param context The request context.
141 /// @return A future that becomes available when the invocation completes.
142 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
143 [[nodiscard]] std::future<void> logAsync(const LogMessage& message, const Ice::Context& context = Ice::noExplicitContext) const;
144
145 /// Logs a LogMessage.
146 /// @param message The message to log.
147 /// @param response The response callback.
148 /// @param exception The exception callback.
149 /// @param sent The sent callback.
150 /// @param context The request context.
151 /// @return A function that can be called to cancel the invocation locally.
152 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
153 // NOLINTNEXTLINE(modernize-use-nodiscard)
154 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;
155
156 /// @private
157 void _iceI_log(const std::shared_ptr<IceInternal::OutgoingAsyncT<void>>&, const LogMessage&, const Ice::Context&) const;
158
159 /// Gets the type ID of the associated Slice interface.
160 /// @return The string `"::Ice::RemoteLogger"`.
161 static const char* ice_staticId() noexcept;
162
163 /// @private
164 static RemoteLoggerPrx _fromReference(IceInternal::ReferencePtr ref) { return RemoteLoggerPrx{std::move(ref)}; }
165
166 protected:
167 /// @private
168 RemoteLoggerPrx() = default;
169
170 /// @private
171 explicit RemoteLoggerPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
172 {
173 }
174 };
175
176 /// Represents the admin facet that allows an Ice application to attach its RemoteLoggerPrx to the local
177 /// logger of an Ice communicator.
178 /// @headerfile Ice/Ice.h
179 class ICE_API LoggerAdminPrx : public Ice::Proxy<LoggerAdminPrx, Ice::ObjectPrx>
180 {
181 public:
182 /// Constructs a proxy from a Communicator and a proxy string.
183 /// @param communicator The communicator of the new proxy.
184 /// @param proxyString The proxy string to parse.
185 LoggerAdminPrx(const Ice::CommunicatorPtr& communicator, std::string_view proxyString) : Ice::ObjectPrx{communicator, proxyString} {} // NOLINT(modernize-use-equals-default)
186
187 /// Copy constructor. Constructs with a copy of the contents of @p other.
188 /// @param other The proxy to copy from.
189 LoggerAdminPrx(const LoggerAdminPrx& other) noexcept : Ice::ObjectPrx{other} {} // NOLINT(modernize-use-equals-default)
190
191 /// Move constructor. Constructs a proxy with the contents of @p other using move semantics.
192 /// @param other The proxy to move from.
193 LoggerAdminPrx(LoggerAdminPrx&& other) noexcept : Ice::ObjectPrx{std::move(other)} {} // NOLINT(modernize-use-equals-default)
194
195 ~LoggerAdminPrx() override;
196
197 /// Copy assignment operator. Replaces the contents of this proxy with a copy of the contents of @p rhs.
198 /// @param rhs The proxy to copy from.
199 /// @return A reference to this proxy.
201 {
202 if (this != &rhs)
203 {
205 }
206 return *this;
207 }
208
209 /// Move assignment operator. Replaces the contents of this proxy with the contents of @p rhs using move semantics.
210 /// @param rhs The proxy to move from.
212 {
213 if (this != &rhs)
214 {
215 Ice::ObjectPrx::operator=(std::move(rhs));
216 }
217 return *this;
218 }
219
220 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
221 /// on @p prx.
222 /// @param prx A proxy to the remote logger.
223 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
224 /// no filtering (send all message types).
225 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
226 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
227 /// (send all trace categories).
228 /// @param messageMax The maximum number of log messages (of all types) to be provided to
229 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
230 /// @param context The request context.
231 /// @throws Ice::RemoteLoggerAlreadyAttachedException Thrown if this remote logger is already attached to this admin
232 /// object.
233 void attachRemoteLogger(const std::optional<RemoteLoggerPrx>& prx, const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, const Ice::Context& context = Ice::noExplicitContext) const;
234
235 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
236 /// on @p prx.
237 /// @param prx A proxy to the remote logger.
238 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
239 /// no filtering (send all message types).
240 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
241 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
242 /// (send all trace categories).
243 /// @param messageMax The maximum number of log messages (of all types) to be provided to
244 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
245 /// @param context The request context.
246 /// @return A future that becomes available when the invocation completes.
247 [[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;
248
249 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
250 /// on @p prx.
251 /// @param prx A proxy to the remote logger.
252 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
253 /// no filtering (send all message types).
254 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
255 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
256 /// (send all trace categories).
257 /// @param messageMax The maximum number of log messages (of all types) to be provided to
258 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
259 /// @param response The response callback.
260 /// @param exception The exception callback.
261 /// @param sent The sent callback.
262 /// @param context The request context.
263 /// @return A function that can be called to cancel the invocation locally.
264 // NOLINTNEXTLINE(modernize-use-nodiscard)
265 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;
266
267 /// @private
268 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;
269
270 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
271 /// @param prx A proxy to the remote logger.
272 /// @param context The request context.
273 /// @return `true` if the provided remote logger proxy was detached, and `false` otherwise.
274 bool detachRemoteLogger(const std::optional<RemoteLoggerPrx>& prx, const Ice::Context& context = Ice::noExplicitContext) const; // NOLINT(modernize-use-nodiscard)
275
276 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
277 /// @param prx A proxy to the remote logger.
278 /// @param context The request context.
279 /// @return A future that becomes available when the invocation completes. This future holds:
280 /// - `true` if the provided remote logger proxy was detached, and `false` otherwise.
281 [[nodiscard]] std::future<bool> detachRemoteLoggerAsync(const std::optional<RemoteLoggerPrx>& prx, const Ice::Context& context = Ice::noExplicitContext) const;
282
283 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
284 /// @param prx A proxy to the remote logger.
285 /// @param response The response callback. It accepts:
286 /// - `true` if the provided remote logger proxy was detached, and `false` otherwise.
287 /// @param exception The exception callback.
288 /// @param sent The sent callback.
289 /// @param context The request context.
290 /// @return A function that can be called to cancel the invocation locally.
291 // NOLINTNEXTLINE(modernize-use-nodiscard)
292 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;
293
294 /// @private
295 void _iceI_detachRemoteLogger(const std::shared_ptr<IceInternal::OutgoingAsyncT<bool>>&, const std::optional<RemoteLoggerPrx>&, const Ice::Context&) const;
296
297 /// Retrieves recently logged log messages.
298 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
299 /// filtering (send all message types).
300 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
301 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
302 /// categories).
303 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
304 /// requests all messages available.
305 /// @param[out] prefix The prefix of the associated local logger.
306 /// @param context The request context.
307 /// @return The Log messages.
308 LogMessageSeq getLog(const LogMessageTypeSeq& messageTypes, const StringSeq& traceCategories, std::int32_t messageMax, std::string& prefix, const Ice::Context& context = Ice::noExplicitContext) const;
309
310 /// Retrieves recently logged log messages.
311 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
312 /// filtering (send all message types).
313 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
314 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
315 /// categories).
316 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
317 /// requests all messages available.
318 /// @param context The request context.
319 /// @return A future that becomes available when the invocation completes. This future holds:
320 /// - `returnValue` The Log messages.
321 /// - `prefix` The prefix of the associated local logger.
322 [[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;
323
324 /// Retrieves recently logged log messages.
325 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
326 /// filtering (send all message types).
327 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
328 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
329 /// categories).
330 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
331 /// requests all messages available.
332 /// @param response The response callback. It accepts:
333 /// - `returnValue` The Log messages.
334 /// - `prefix` The prefix of the associated local logger.
335 /// @param exception The exception callback.
336 /// @param sent The sent callback.
337 /// @param context The request context.
338 /// @return A function that can be called to cancel the invocation locally.
339 // NOLINTNEXTLINE(modernize-use-nodiscard)
340 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;
341
342 /// @private
343 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;
344
345 /// Gets the type ID of the associated Slice interface.
346 /// @return The string `"::Ice::LoggerAdmin"`.
347 static const char* ice_staticId() noexcept;
348
349 /// @private
350 static LoggerAdminPrx _fromReference(IceInternal::ReferencePtr ref) { return LoggerAdminPrx{std::move(ref)}; }
351
352 protected:
353 /// @private
354 LoggerAdminPrx() = default;
355
356 /// @private
357 explicit LoggerAdminPrx(IceInternal::ReferencePtr&& ref) : Ice::ObjectPrx{std::move(ref)}
358 {
359 }
360 };
361}
362
363namespace Ice
364{
365 /// Represents a full log message.
366 /// @headerfile Ice/Ice.h
368 {
369 /// The type of message sent to the ::Ice::RemoteLoggerPrx.
371
372 /// The date and time when the ::Ice::RemoteLoggerPrx received this message, expressed as the number of
373 /// microseconds since the Unix Epoch (00:00:00 UTC on 1 January 1970).
374 std::int64_t timestamp;
375
376 /// For a message of type 'trace', the trace category of this log message; otherwise, the empty string.
377 std::string traceCategory;
378
379 /// The log message itself.
380 std::string message;
381
382 /// Creates a tuple with all the fields of this struct.
383 /// @return A tuple with all the fields of this struct.
384 [[nodiscard]] std::tuple<const ::Ice::LogMessageType&, const std::int64_t&, const std::string&, const std::string&> ice_tuple() const
385 {
386 return std::tie(type, timestamp, traceCategory, message);
387 }
388
389 /// Outputs the name and value of each field of this instance to the stream.
390 /// @param os The output stream.
391 ICE_API void ice_printFields(std::ostream& os) const;
392 };
393
394 /// Outputs the description of a LogMessage to a stream, including all its fields.
395 /// @param os The output stream.
396 /// @param value The instance to output.
397 /// @return The output stream.
398 ICE_API std::ostream& operator<<(std::ostream& os, const LogMessage& value);
399
400 /// Thrown when the provided RemoteLoggerPrx was previously attached to a LoggerAdminPrx.
401 /// @headerfile Ice/Ice.h
403 {
404 public:
405 /// Gets the type ID of the associated Slice exception.
406 /// @return The string `"::Ice::RemoteLoggerAlreadyAttachedException"`.
407 static const char* ice_staticId() noexcept;
408
409 [[nodiscard]] const char* ice_id() const noexcept override;
410
411 void ice_throw() const override;
412
413 protected:
414 /// @private
415 void _writeImpl(Ice::OutputStream*) const override;
416
417 /// @private
418 void _readImpl(Ice::InputStream*) override;
419 };
420
421 /// @cond INTERNAL
422 using Ice::Tuple::operator<;
423 using Ice::Tuple::operator<=;
424 using Ice::Tuple::operator>;
425 using Ice::Tuple::operator>=;
426 using Ice::Tuple::operator==;
427 using Ice::Tuple::operator!=;
428 /// @endcond
429}
430
431namespace Ice
432{
433 /// Represents an Ice object that accepts log messages. It's called by the implementation of LoggerAdminPrx.
434 /// @headerfile Ice/Ice.h
435 class ICE_API RemoteLogger : public virtual Ice::Object
436 {
437 public:
438 /// The associated proxy type.
440
441 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
442 /// @param request The incoming request.
443 /// @param sendResponse The callback to send the response.
444 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
445
446 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
447
448 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
449
450 /// Attaches a remote logger to the local logger.
451 /// @param prefix The prefix of the associated local Logger.
452 /// @param logMessages Old log messages generated before "now".
453 /// @param current The Current object of the incoming request.
454 virtual void init(std::string prefix, LogMessageSeq logMessages, const Ice::Current& current) = 0;
455
456 /// @private
457 void _iceD_init(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
458
459 /// Logs a LogMessage.
460 /// @param message The message to log.
461 /// @param current The Current object of the incoming request.
462 /// @remarks ::Ice::RemoteLoggerPrx::log may be called by ::Ice::LoggerAdminPrx before ::Ice::RemoteLoggerPrx::init.
463 virtual void log(LogMessage message, const Ice::Current& current) = 0;
464
465 /// @private
466 void _iceD_log(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
467
468 /// Gets the type ID of the associated Slice interface.
469 /// @return The string `"::Ice::RemoteLogger"`.
470 static const char* ice_staticId() noexcept;
471 };
472
473 /// A shared pointer to a RemoteLogger.
474 using RemoteLoggerPtr = std::shared_ptr<RemoteLogger>;
475
476 /// Represents the admin facet that allows an Ice application to attach its RemoteLoggerPrx to the local
477 /// logger of an Ice communicator.
478 /// @headerfile Ice/Ice.h
479 class ICE_API LoggerAdmin : public virtual Ice::Object
480 {
481 public:
482 /// The associated proxy type.
483 using ProxyType = LoggerAdminPrx;
484
485 /// Dispatches an incoming request to one of the member functions of this generated class, based on the operation name carried by the request.
486 /// @param request The incoming request.
487 /// @param sendResponse The callback to send the response.
488 void dispatch(IncomingRequest& request, std::function<void(OutgoingResponse)> sendResponse) override;
489
490 [[nodiscard]] std::vector<std::string> ice_ids(const Ice::Current& current) const override;
491
492 [[nodiscard]] std::string ice_id(const Ice::Current& current) const override;
493
494 /// Attaches a ::Ice::RemoteLoggerPrx object to the local logger. This operation calls ::Ice::RemoteLoggerPrx::init
495 /// on @p prx.
496 /// @param prx A proxy to the remote logger.
497 /// @param messageTypes The list of message types that the remote logger wishes to receive. An empty list means
498 /// no filtering (send all message types).
499 /// @param traceCategories The categories of traces that the remote logger wishes to receive. This parameter is
500 /// ignored if @p messageTypes is not empty and does not include trace. An empty list means no filtering
501 /// (send all trace categories).
502 /// @param messageMax The maximum number of log messages (of all types) to be provided to
503 /// ::Ice::RemoteLoggerPrx::init. A negative value requests all messages available.
504 /// @param current The Current object of the incoming request.
505 /// @throws Ice::RemoteLoggerAlreadyAttachedException Thrown if this remote logger is already attached to this admin
506 /// object.
507 virtual void attachRemoteLogger(std::optional<RemoteLoggerPrx> prx, LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, const Ice::Current& current) = 0;
508
509 /// @private
510 void _iceD_attachRemoteLogger(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
511
512 /// Detaches a ::Ice::RemoteLoggerPrx object from the local logger.
513 /// @param prx A proxy to the remote logger.
514 /// @param current The Current object of the incoming request.
515 /// @return `true` if the provided remote logger proxy was detached, and `false` otherwise.
516 virtual bool detachRemoteLogger(std::optional<RemoteLoggerPrx> prx, const Ice::Current& current) = 0;
517
518 /// @private
519 void _iceD_detachRemoteLogger(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
520
521 /// Retrieves recently logged log messages.
522 /// @param messageTypes The list of message types that the caller wishes to receive. An empty list means no
523 /// filtering (send all message types).
524 /// @param traceCategories The categories of traces that caller wish to receive. This parameter is ignored if
525 /// @p messageTypes is not empty and does not include trace. An empty list means no filtering (send all trace
526 /// categories).
527 /// @param messageMax The maximum number of log messages (of all types) to be returned. A negative value
528 /// requests all messages available.
529 /// @param[out] prefix The prefix of the associated local logger.
530 /// @param current The Current object of the incoming request.
531 /// @return The Log messages.
532 virtual LogMessageSeq getLog(LogMessageTypeSeq messageTypes, StringSeq traceCategories, std::int32_t messageMax, std::string& prefix, const Ice::Current& current) = 0;
533
534 /// @private
535 void _iceD_getLog(Ice::IncomingRequest&, std::function<void(Ice::OutgoingResponse)>);
536
537 /// Gets the type ID of the associated Slice interface.
538 /// @return The string `"::Ice::LoggerAdmin"`.
539 static const char* ice_staticId() noexcept;
540 };
541
542 /// A shared pointer to a LoggerAdmin.
543 using LoggerAdminPtr = std::shared_ptr<LoggerAdmin>;
544}
545
546namespace Ice
547{
548 /// @cond INTERNAL
549 template<>
550 struct StreamableTraits<::Ice::LogMessageType>
551 {
553 static constexpr int minValue = 0;
554 static constexpr int maxValue = 3;
555 static constexpr int minWireSize = 1;
556 static constexpr bool fixedLength = false;
557 };
558 /// @endcond
559
560 /// @cond INTERNAL
561 template<>
562 struct StreamableTraits<::Ice::LogMessage>
563 {
565 static constexpr int minWireSize = 11;
566 static constexpr bool fixedLength = false;
567 };
568
569 template<>
570 struct StreamReader<::Ice::LogMessage>
571 {
572 /// Unmarshals a ::Ice::LogMessage from the input stream.
573 static void read(InputStream* istr, ::Ice::LogMessage& v)
574 {
575 istr->readAll(v.type, v.timestamp, v.traceCategory, v.message);
576 }
577 };
578 /// @endcond
579}
580
581// NOLINTEND(modernize-concat-nested-namespaces)
582
584#endif
Represents a request received by a connection.
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
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 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 Ice 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< 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
The Ice RPC framework.
Definition SampleEvent.h:59
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.
static constexpr bool fixedLength
Indicates if the type is always encoded on a fixed number of bytes.
static constexpr int minWireSize
The minimum number of bytes needed to marshal this type.
static constexpr StreamHelperCategory helper
The category trait, used for selecting the appropriate StreamHelper.
Provides traits for a type that can be marshaled or unmarshaled to/from a stream of bytes using the S...