cpp-common/bt2: add `bt2::SelfMessageIterator`
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Sat, 4 Nov 2023 17:40:43 +0000 (13:40 -0400)
committerSimon Marchi <simon.marchi@efficios.com>
Thu, 14 Dec 2023 15:57:04 +0000 (10:57 -0500)
commit73b3ea14767ddf80489a501b242bdfe6d7e763be
tree203f63ae87c893af091d11898769528137dbe595
parentb6f09a6bc2b3728aabe45508a43a1c303ae39537
cpp-common/bt2: add `bt2::SelfMessageIterator`

This patch introduces `bt2::SelfMessageIterator` which wraps
`bt_self_message_iterator`.

This is the last piece of C++ binding needed to write a complete
component class in C++, immediately wrapping the component class and
message iterator class methods parameters.

`bt2::SelfMessageIterator` offers:

createMessageIterator():
    Create a message iterator from this message iterator:

        auto msgIter = selfMsgIter.createMessageIterator(
                           selfMsgIter.component().inputPorts()["in"]);

component():
    Borrow the parent self component.

    This is usually used to retrieve some component data:

        selfMsgIter.component().data<MyComponentData>();

port():
    Borrow the output port from which this message iterator operates.

isInterrupted():
    Whether or not this message iterator is interrupted.

data():
    Get and set user data.

Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: I02747ffb7a31743a310bdeff120f1d1042bf11e6
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11237
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
CI-Build: Simon Marchi <simon.marchi@efficios.com>
src/Makefile.am
src/cpp-common/bt2/self-message-iterator.hpp [new file with mode: 0644]
This page took 0.023854 seconds and 4 git commands to generate.