return fc;
}
-static void trigger_fc_int_set_field_value_range_n_0(bt_self_component *self_comp)
+static void trigger_fc_int_set_field_value_range_n_0(const bt2::SelfComponent self)
{
- bt_field_class_integer_set_field_value_range(get_uint_fc(self_comp), 0);
+ bt_field_class_integer_set_field_value_range(get_uint_fc(self.libObjPtr()), 0);
}
-static void trigger_fc_int_set_field_value_range_n_gt_64(bt_self_component *self_comp)
+static void trigger_fc_int_set_field_value_range_n_gt_64(const bt2::SelfComponent self)
{
- bt_field_class_integer_set_field_value_range(get_uint_fc(self_comp), 65);
+ bt_field_class_integer_set_field_value_range(get_uint_fc(self.libObjPtr()), 65);
}
-static void trigger_fc_int_set_field_value_range_null(bt_self_component *)
+static void trigger_fc_int_set_field_value_range_null(bt2::SelfComponent)
{
bt_field_class_integer_set_field_value_range(NULL, 23);
}
#include <babeltrace2/babeltrace.h>
+#include "cpp-common/bt2/self-component-port.hpp"
+
enum cond_trigger_func_type
{
COND_TRIGGER_FUNC_TYPE_BASIC,
};
typedef void (*cond_trigger_basic_func)(void);
-typedef void (*cond_trigger_run_in_comp_cls_init_func)(bt_self_component *);
+typedef void (*cond_trigger_run_in_comp_cls_init_func)(bt2::SelfComponent);
struct cond_trigger
{
static void test_string_clear()
{
- runInMsgIterClsInit([](bt_self_message_iterator * const self) {
+ runInMsgIterClsInit([](const bt2::SelfMessageIterator self) {
/* Boilerplate to get a string field */
const auto traceCls =
- bt_trace_class_create(bt_self_message_iterator_borrow_component(self));
+ bt_trace_class_create(bt_self_message_iterator_borrow_component(self.libObjPtr()));
const auto streamCls = bt_stream_class_create(traceCls);
const auto eventCls = bt_event_class_create(streamCls);
const auto payloadCls = bt_field_class_structure_create(traceCls);
const auto trace = bt_trace_create(traceCls);
const auto stream = bt_stream_create(streamCls, trace);
- const auto msg = bt_message_event_create(self, eventCls, stream);
+ const auto msg = bt_message_event_create(self.libObjPtr(), eventCls, stream);
const auto field = bt_field_structure_borrow_member_field_by_name(
bt_event_borrow_payload_field(bt_message_event_borrow_event(msg)), "str");
#include <utility>
#include "common/assert.h"
+#include "cpp-common/bt2/wrap.hpp"
#include "run-in.hpp"
auto& data = runInDataFromMethodData(initMethodData);
if (data.compCtxFunc) {
- data.compCtxFunc(bt_self_component_source_as_self_component(selfComp));
+ data.compCtxFunc(bt2::wrap(bt_self_component_source_as_self_component(selfComp)));
}
return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK;
auto& data = runInDataFromMethodData(methodData);
if (data.compClsCtxFunc) {
- data.compClsCtxFunc(bt_self_component_class_source_as_self_component_class(selfCompCls));
+ data.compClsCtxFunc(
+ bt2::wrap(bt_self_component_class_source_as_self_component_class(selfCompCls)));
}
*result = bt_value_null;
bt_self_component_port_output_as_self_component_port(port)));
if (data.msgIterCtxFunc) {
- data.msgIterCtxFunc(selfMsgIter);
+ data.msgIterCtxFunc(bt2::wrap(selfMsgIter));
}
return BT_MESSAGE_ITERATOR_CLASS_INITIALIZE_METHOD_STATUS_OK;
#include <babeltrace2/babeltrace.h>
-using RunInCompClsQueryFunc = std::function<void(bt_self_component_class *)>;
-using RunInCompClsInitFunc = std::function<void(bt_self_component *)>;
-using RunInMsgIterClsInitFunc = std::function<void(bt_self_message_iterator *)>;
+#include "cpp-common/bt2/self-component-class.hpp"
+#include "cpp-common/bt2/self-component-port.hpp"
+#include "cpp-common/bt2/self-message-iterator.hpp"
+
+using RunInCompClsQueryFunc = std::function<void(bt2::SelfComponentClass)>;
+using RunInCompClsInitFunc = std::function<void(bt2::SelfComponent)>;
+using RunInMsgIterClsInitFunc = std::function<void(bt2::SelfMessageIterator)>;
/*
* Runs: