cpp-common/bt2: add `bt2::Self*Component` and `bt2::SelfComponent*Port`
This new file is an adaptation of `component-port.hpp` and works the
same way.
That being said, I didn't bother:
* Making equivalent objects in `component-port.hpp` accept the "self"
versions.
In theory, you could build a `bt2::ConstSourceComponent` from a
`bt2::SelfSourceComponent`, for example, but I believe we won't do
that often, if ever.
Therefore you'll need to use the asConstComponent() and asConstPort()
methods explicitly.
However, I added aliases in the new classes to avoid going calling
those in most situations. For example,
bt2::SelfFilterComponent::name() calls bt2::SelfComponent::name()
which calls bt2::ConstComponent::name().
* Implementing the constant versions of the new classes, for example
`bt2::ConstSelfComponent`.
For example, a method which would benefit this is
bt2::SelfSinkComponent::isInterrupted().
Again, I don't think we'll need this. The "self" wrappers are for the
component class author, and she rarely needs a constant view of its
own object.
Add a port to a self component with the addInputPort() or
addOutputPort() methods, which return a borrowed reference of the
created and added port. Those methods have an overload which accepts
user data to store into the returned port.
Create a message iterator from a self sink component with
bt2::SelfSinkComponent::createMessageIterator().
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Change-Id: Id6bcbfcea4a562780eee0700cee507431c4e5661
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11235
CI-Build: Simon Marchi <simon.marchi@efficios.com>
Reviewed-by: Simon Marchi <simon.marchi@efficios.com>
Tested-by: jenkins <jenkins@lttng.org>
This page took 0.024646 seconds and 4 git commands to generate.