cpp-common/bt2: add `bt2::MessageIterator`
This patch adds `bt2::MessageIterator` to wrap `bt_message_iterator`
objects.
`bt2::MessageIterator` offers:
component():
Borrows the parent component of the message iterator.
next():
Returns the next batch of messages.
This method returns an optional message array: set if there are
messages (`BT_MESSAGE_ITERATOR_NEXT_STATUS_OK`), or not set on end
of iteration (`BT_MESSAGE_ITERATOR_NEXT_STATUS_END`).
Throws otherwise.
Example:
if (const auto msgs = myMsgIter.next()) {
for (const auto msg : *msgs) {
if (msg.isEvent()) {
// ...
}
}
} else {
// This is the end, my only friend, the end
}
canSeekBeginning():
Wraps bt_message_iterator_can_seek_beginning().
seekBeginning():
Wraps bt_message_iterator_seek_beginning().
canSeekNsFromOrigin():
Wraps bt_message_iterator_can_seek_ns_from_origin().
seekNsFromOrigin():
Wraps bt_message_iterator_seek_ns_from_origin().
canSeekForward():
Wraps bt_message_iterator_can_seek_forward().
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Ifd16546ad56b237d62491fd17dd6cb180ca3edba
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11194
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
This page took 0.025833 seconds and 4 git commands to generate.