class LogBatchIterator
Defined at line 34 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
LogBatchIterator wraps a fuchsia::diagnostics::BatchIterator and maintains the necessary state
(MessageParser) to decode log messages from it.
This class is thread-hostile; the same restrictions as InterfacePtr
(see the comment for InterfacePtr at sdk/lib/fidl/hlcpp/include/lib/fidl/cpp/interface_ptr.h)
apply to this class. In short, all calls to this class (including the destructor) should
be made from the thread to which the interface was bound.
Public Methods
void ~LogBatchIterator ()
Defined at line 38 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
void LogBatchIterator (const LogBatchIterator & )
Non-copyable, but movable.
Defined at line 41 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
LogBatchIterator & operator= (const LogBatchIterator & )
Defined at line 42 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
void LogBatchIterator (LogBatchIterator && )
Defined at line 43 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
LogBatchIterator & operator= (LogBatchIterator && )
Defined at line 44 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
void Unbind ()
Defined at line 81 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
void set_error_handler (fit::function<void (zx_status_t)> handler)
Defined at line 83 of file ../../src/lib/diagnostics/accessor2logger/log_message.h
void LogBatchIterator (fuchsia::diagnostics::BatchIteratorPtr iterator, fuchsia::diagnostics::Format format)
Defined at line 360 of file ../../src/lib/diagnostics/accessor2logger/log_message.cc
void GetNext (GetNextCallback callback)
Calls GetNext on the underlying BatchIterator and converts the results.
This is an asynchronous operation. The method returns immediately, and the
provided `callback` will be invoked later when a batch of messages is retrieved
or an error occurs.
Callback details:
- Threading: The callback is invoked on the thread running the dispatcher
associated with the underlying FIDL client (`iterator_`), which is typically
the default dispatcher of the thread where the `LogBatchIterator` was created.
- Execution: Since `GetNextCallback` is a `fit::callback`, it will be invoked
at most once.
- Lifetime/Cancellation: If the `LogBatchIterator` is destroyed or unbound
(via `Unbind()`) before the callback is run, the pending FIDL callback
will be discarded and the callback will *never* be called. Therefore,
any references or captures within the callback must remain valid until either the
callback is invoked or the `LogBatchIterator` is destroyed/unbound.
Defined at line 364 of file ../../src/lib/diagnostics/accessor2logger/log_message.cc