`SinkCompClsBridge::userCompFromLibSelfCompPtr` needs to be public for
`CompClsBridgeWithInputPorts::inputPortConnected` to access it, for
instance.
Here's the error I got when trying to use `SinkCompClsBridge` in a
following patch, which lead to this fix:
CXX utils/run-in.lo
In file included from /home/smarchi/src/babeltrace/src/cpp-common/bt2/component-class.hpp:12,
from /home/smarchi/src/babeltrace/tests/lib/utils/run-in.cpp:10:
/home/smarchi/src/babeltrace/src/cpp-common/bt2/plugin-dev.hpp: In instantiation of 'static bt_component_class_port_connected_method_status bt2::internal::CompClsBridgeWithInputPorts<SpecCompClsBridgeT, LibTypesT>::inputPortConnected(typename LibTypesT::SelfComp*, bt_self_component_port_input*, const bt_port_output*) [with SpecCompClsBridgeT = bt2::internal::SinkCompClsBridge<{anonymous}::DummySink>; LibTypesT = bt2::internal::SinkCompClsLibTypes; bt_component_class_port_connected_method_status = bt_component_class_port_connected_method_status; typename LibTypesT::SelfComp = bt_self_component_sink; bt_self_component_port_input = bt_self_component_port_input; bt_port_output = bt_port_output]':
/home/smarchi/src/babeltrace/src/cpp-common/bt2/component-class.hpp:477:88: required from 'static bt2::internal::CommonSinkComponentClass<LibObjT>::Shared bt2::internal::CommonSinkComponentClass<LibObjT>::create() [with UserCompClsT = {anonymous}::DummySink; LibObjT = bt_component_class_sink; Shared = bt2::SharedObject<bt2::internal::CommonSinkComponentClass<bt_component_class_sink>, bt_component_class_sink, bt2::internal::SinkComponentClassRefFuncs>]'
/home/smarchi/src/babeltrace/tests/lib/utils/run-in.cpp:141:72: required from here
/home/smarchi/src/babeltrace/src/cpp-common/bt2/plugin-dev.hpp:160:59: error: 'static UserCompClsT& bt2::internal::CompClsBridge<UserCompClsT, LibTypesT>::userCompFromLibSelfCompPtr(_LibSelfCompPtr) [with UserCompClsT = {anonymous}::DummySink; LibTypesT = bt2::internal::SinkCompClsLibTypes; _LibSelfCompPtr = bt_self_component_sink*]' is inaccessible within this context
160 | SpecCompClsBridgeT::userCompFromLibSelfCompPtr(libSelfCompPtr)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
/home/smarchi/src/babeltrace/src/cpp-common/bt2/plugin-dev.hpp:62:26: note: declared here
62 | static UserCompClsT& userCompFromLibSelfCompPtr(const _LibSelfCompPtr libSelfCompPtr) noexcept
| ^~~~~~~~~~~~~~~~~~~~~~~~~~
Change-Id: If7dabf6280f3d861854dd21fa92f785f7176bd5e
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/11804
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
public CompClsBridge<UserCompClsT, SinkCompClsLibTypes>,
public CompClsBridgeWithInputPorts<SinkCompClsBridge<UserCompClsT>, SinkCompClsLibTypes>
{
public CompClsBridge<UserCompClsT, SinkCompClsLibTypes>,
public CompClsBridgeWithInputPorts<SinkCompClsBridge<UserCompClsT>, SinkCompClsLibTypes>
{
using CompClsBridge<UserCompClsT, SinkCompClsLibTypes>::userCompFromLibSelfCompPtr;
using CompClsBridge<UserCompClsT, SinkCompClsLibTypes>::userCompFromLibSelfCompPtr;
static bt_component_class_sink_consume_method_status
consume(bt_self_component_sink * const libSelfCompPtr) noexcept
{
static bt_component_class_sink_consume_method_status
consume(bt_self_component_sink * const libSelfCompPtr) noexcept
{