return CommonClockClass<const bt_clock_class> {*this};
}
- void frequency(const std::uint64_t frequency) const noexcept
+ CommonClockClass frequency(const std::uint64_t frequency) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
bt_clock_class_set_frequency(this->libObjPtr(), frequency);
+ return *this;
}
std::uint64_t frequency() const noexcept
return bt_clock_class_get_frequency(this->libObjPtr());
}
- void offsetFromOrigin(const ClockOffset& offsetFromOrigin) const noexcept
+ CommonClockClass offsetFromOrigin(const ClockOffset& offsetFromOrigin) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
bt_clock_class_set_offset(this->libObjPtr(), offsetFromOrigin.seconds(),
offsetFromOrigin.cycles());
+ return *this;
}
ClockOffset offsetFromOrigin() const noexcept
return ClockOffset {seconds, cycles};
}
- void precision(const std::uint64_t precision) const noexcept
+ CommonClockClass precision(const std::uint64_t precision) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
bt_clock_class_set_precision(this->libObjPtr(), precision);
+ return *this;
}
std::uint64_t precision() const noexcept
return bt_clock_class_get_precision(this->libObjPtr());
}
- void originIsUnixEpoch(const bool originIsUnixEpoch) const noexcept
+ CommonClockClass originIsUnixEpoch(const bool originIsUnixEpoch) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
bt_clock_class_set_origin_is_unix_epoch(this->libObjPtr(),
static_cast<bt_bool>(originIsUnixEpoch));
+ return *this;
}
bool originIsUnixEpoch() const noexcept
return static_cast<bool>(bt_clock_class_origin_is_unix_epoch(this->libObjPtr()));
}
- void name(const bt2c::CStringView name) const
+ CommonClockClass name(const bt2c::CStringView name) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
if (status == BT_CLOCK_CLASS_SET_NAME_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
bt2c::CStringView name() const noexcept
return bt_clock_class_get_name(this->libObjPtr());
}
- void description(const bt2c::CStringView description) const
+ CommonClockClass description(const bt2c::CStringView description) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
if (status == BT_CLOCK_CLASS_SET_DESCRIPTION_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
bt2c::CStringView description() const noexcept
return bt_clock_class_get_description(this->libObjPtr());
}
- void uuid(const std::uint8_t * const uuid) const noexcept
+ CommonClockClass uuid(const std::uint8_t * const uuid) const noexcept
{
bt_clock_class_set_uuid(this->libObjPtr(), uuid);
+ return *this;
}
bt2s::optional<bt2c::UuidView> uuid() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonClockClass userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
bt_clock_class_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
asVariantWithSignedIntegerSelector() const noexcept;
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonFieldClass userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstFieldClass`.");
bt_field_class_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
return CommonIntegerFieldClass<const bt_field_class> {*this};
}
- void fieldValueRange(const std::uint64_t n) const noexcept
+ CommonIntegerFieldClass fieldValueRange(const std::uint64_t n) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstIntegerFieldClass`.");
bt_field_class_integer_set_field_value_range(this->libObjPtr(), n);
+ return *this;
}
std::uint64_t fieldValueRange() const noexcept
return bt_field_class_integer_get_field_value_range(this->libObjPtr());
}
- void preferredDisplayBase(const DisplayBase base) const noexcept
+ CommonIntegerFieldClass preferredDisplayBase(const DisplayBase base) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstIntegerFieldClass`.");
bt_field_class_integer_set_preferred_display_base(
this->libObjPtr(), static_cast<bt_field_class_integer_preferred_display_base>(base));
+ return *this;
}
DisplayBase preferredDisplayBase() const noexcept
this->libObjPtr(), label);
}
- void addMapping(const bt2c::CStringView label, const typename Mapping::RangeSet ranges) const
+ CommonEnumerationFieldClass addMapping(const bt2c::CStringView label,
+ const typename Mapping::RangeSet ranges) const
{
const auto status = internal::CommonEnumerationFieldClassSpec<MappingT>::addMapping(
this->libObjPtr(), label, ranges.libObjPtr());
if (status == BT_FIELD_CLASS_ENUMERATION_ADD_MAPPING_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
Iterator begin() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonStructureFieldClassMember
+ userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStructureFieldClassMember`.");
bt_field_class_structure_member_set_user_attributes(this->libObjPtr(),
userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
return CommonStructureFieldClass<const bt_field_class> {*this};
}
- void appendMember(const bt2c::CStringView name, const FieldClass fc) const
+ CommonStructureFieldClass appendMember(const bt2c::CStringView name, const FieldClass fc) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStructureFieldClass`.");
if (status == BT_FIELD_CLASS_STRUCTURE_APPEND_MEMBER_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
std::uint64_t length() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonVariantFieldClassOption
+ userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstVariantFieldClassOption`.");
bt_field_class_variant_option_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
return CommonVariantWithoutSelectorFieldClass<const bt_field_class> {*this};
}
- void appendOption(const char * const name, const FieldClass fc) const
+ CommonVariantWithoutSelectorFieldClass appendOption(const char * const name,
+ const FieldClass fc) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstVariantWithoutSelectorFieldClass`.");
BT_FIELD_CLASS_VARIANT_WITHOUT_SELECTOR_FIELD_APPEND_OPTION_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
- void appendOption(const bt2c::CStringView name, const FieldClass fc) const
+ CommonVariantWithoutSelectorFieldClass appendOption(const bt2c::CStringView name,
+ const FieldClass fc) const
{
return this->appendOption(name.data(), fc);
}
- void appendOption(const bt2s::optional<std::string>& name, const FieldClass fc) const
+ CommonVariantWithoutSelectorFieldClass appendOption(const bt2s::optional<std::string>& name,
+ const FieldClass fc) const
{
- this->appendOption(name ? name->data() : nullptr, fc);
+ return this->appendOption(name ? name->data() : nullptr, fc);
}
Shared shared() const noexcept
return _Spec::optionByName(this->libObjPtr(), name);
}
- void appendOption(const char * const name, const FieldClass fc,
- const typename Option::RangeSet ranges) const
+ CommonVariantWithIntegerSelectorFieldClass
+ appendOption(const char * const name, const FieldClass fc,
+ const typename Option::RangeSet ranges) const
{
static_assert(
!std::is_const<LibObjT>::value,
BT_FIELD_CLASS_VARIANT_WITH_SELECTOR_FIELD_APPEND_OPTION_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
- void appendOption(const bt2c::CStringView name, const FieldClass fc,
- const typename Option::RangeSet ranges) const
+ CommonVariantWithIntegerSelectorFieldClass
+ appendOption(const bt2c::CStringView name, const FieldClass fc,
+ const typename Option::RangeSet ranges) const
{
return this->appendOption(name.data(), fc, ranges);
}
- void appendOption(const bt2s::optional<std::string>& name, const FieldClass fc,
- const typename Option::RangeSet ranges) const
+ CommonVariantWithIntegerSelectorFieldClass
+ appendOption(const bt2s::optional<std::string>& name, const FieldClass fc,
+ const typename Option::RangeSet ranges) const
{
- this->appendOption(name ? name->data() : nullptr, fc, ranges);
+ return this->appendOption(name ? name->data() : nullptr, fc, ranges);
}
Iterator begin() const noexcept
return RawValueProxy<CommonBoolField> {*this};
}
- void value(const Value val) const noexcept
+ CommonBoolField value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstBoolField`.");
bt_field_bool_set_value(this->libObjPtr(), static_cast<bt_bool>(val));
+ return *this;
}
Value value() const noexcept
return Class {internal::CommonFieldSpec<LibObjT>::cls(this->libObjPtr())};
}
- void valueAsInteger(const std::uint64_t bits) const noexcept
+ CommonBitArrayField valueAsInteger(const std::uint64_t bits) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstBitArrayField`.");
bt_field_bit_array_set_value_as_integer(this->libObjPtr(), bits);
+ return *this;
}
std::uint64_t valueAsInteger() const noexcept
return RawValueProxy<CommonUnsignedIntegerField> {*this};
}
- void value(const Value val) const noexcept
+ CommonUnsignedIntegerField value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstUnsignedIntegerField`.");
bt_field_integer_unsigned_set_value(this->libObjPtr(), val);
+ return *this;
}
Value value() const noexcept
return RawValueProxy<CommonSignedIntegerField> {*this};
}
- void value(const Value val) const noexcept
+ CommonSignedIntegerField value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstSignedIntegerField`.");
bt_field_integer_signed_set_value(this->libObjPtr(), val);
+ return *this;
}
Value value() const noexcept
return RawValueProxy<CommonSinglePrecisionRealField> {*this};
}
- void value(const Value val) const noexcept
+ CommonSinglePrecisionRealField value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstSinglePrecisionRealField`.");
bt_field_real_single_precision_set_value(this->libObjPtr(), val);
+ return *this;
}
Value value() const noexcept
return RawValueProxy<CommonDoublePrecisionRealField> {*this};
}
- void value(const Value val) const noexcept
+ CommonDoublePrecisionRealField value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstDoublePrecisionRealField`.");
bt_field_real_double_precision_set_value(this->libObjPtr(), val);
+ return *this;
}
Value value() const noexcept
return RawValueProxy<CommonStringField> {*this};
}
- void value(const Value val) const
+ CommonStringField value(const Value val) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStringField`.");
if (status == BT_FIELD_STRING_SET_VALUE_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
- void append(const bt2c::CStringView begin, const std::uint64_t len) const
+ CommonStringField append(const bt2c::CStringView begin, const std::uint64_t len) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStringField`.");
if (status == BT_FIELD_STRING_APPEND_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
- void append(const bt2c::CStringView val) const
+ CommonStringField append(const bt2c::CStringView val) const
{
- this->append(val, std::strlen(val));
+ return this->append(val, std::strlen(val));
}
- void append(const std::string& val) const
+ CommonStringField append(const std::string& val) const
{
- this->append(val.data(), val.size());
+ return this->append(val.data(), val.size());
}
- void clear() const noexcept
+ CommonStringField clear() const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStringField`.");
bt_field_string_clear(this->libObjPtr());
+ return *this;
}
Value value() const noexcept
return _ThisCommonArrayField::length();
}
- void length(const std::uint64_t length) const
+ CommonDynamicArrayField length(const std::uint64_t length) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstDynamicArrayField`.");
if (status == BT_FIELD_DYNAMIC_ARRAY_SET_LENGTH_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
};
return Class {internal::CommonFieldSpec<LibObjT>::cls(this->libObjPtr())};
}
- void hasField(const bool hasField) const noexcept
+ CommonOptionField hasField(const bool hasField) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstOptionField`.");
bt_field_option_set_has_field(this->libObjPtr(), static_cast<bt_bool>(hasField));
+ return *this;
}
bool hasField() const noexcept
return Class {internal::CommonFieldSpec<LibObjT>::cls(this->libObjPtr())};
}
- void selectOption(const std::uint64_t index) const noexcept
+ CommonVariantField selectOption(const std::uint64_t index) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstVariantField`.");
const auto status = bt_field_variant_select_option_by_index(this->libObjPtr(), index);
BT_ASSERT_DBG(status == BT_FIELD_VARIANT_SELECT_OPTION_STATUS_OK);
+ return *this;
}
CommonField<LibObjT> selectedOptionField() const noexcept
bt_graph_add_sink_component_with_initialize_method_data);
}
- void connectPorts(const ConstOutputPort outputPort, const ConstInputPort inputPort) const
+ Graph connectPorts(const ConstOutputPort outputPort, const ConstInputPort inputPort) const
{
const auto status = bt_graph_connect_ports(this->libObjPtr(), outputPort.libObjPtr(),
inputPort.libObjPtr(), nullptr);
} else if (status == BT_GRAPH_CONNECT_PORTS_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
- void runOnce() const
+ Graph runOnce() const
{
const auto status = bt_graph_run_once(this->libObjPtr());
} else if (status == BT_GRAPH_RUN_ONCE_STATUS_AGAIN) {
throw TryAgain {};
}
+
+ return *this;
}
- void run() const
+ Graph run() const
{
const auto status = bt_graph_run(this->libObjPtr());
} else if (status == BT_GRAPH_RUN_STATUS_AGAIN) {
throw TryAgain {};
}
+
+ return *this;
}
private:
return !(*this == other);
}
- void addRange(const Value lower, const Value upper) const
+ CommonIntegerRangeSet addRange(const Value lower, const Value upper) const
{
static_assert(
!std::is_const<LibObjT>::value,
if (status == BT_INTEGER_RANGE_SET_ADD_RANGE_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
std::uint64_t length() const noexcept
return _mLen == _mCap;
}
- void append(ConstMessage::Shared message) noexcept
+ ConstMessageArray& append(ConstMessage::Shared message) noexcept
{
BT_ASSERT_DBG(!this->isFull());
/* Move reference to underlying array */
_mLibArrayPtr[_mLen] = message.release().libObjPtr();
++_mLen;
+ return *this;
}
/*
}
}
- void seekBeginning() const
+ MessageIterator seekBeginning() const
{
const auto status = bt_message_iterator_seek_beginning(this->libObjPtr());
switch (status) {
case BT_MESSAGE_ITERATOR_SEEK_BEGINNING_STATUS_OK:
- return;
+ break;
case BT_MESSAGE_ITERATOR_SEEK_BEGINNING_STATUS_AGAIN:
throw TryAgain {};
case BT_MESSAGE_ITERATOR_SEEK_BEGINNING_STATUS_MEMORY_ERROR:
default:
bt_common_abort();
}
+
+ return *this;
}
bool canSeekNsFromOrigin(const std::int64_t nsFromOrigin) const
}
}
- void seekNsFromOrigin(const std::int64_t nsFromOrigin) const
+ MessageIterator seekNsFromOrigin(const std::int64_t nsFromOrigin) const
{
const auto status =
bt_message_iterator_seek_ns_from_origin(this->libObjPtr(), nsFromOrigin);
switch (status) {
case BT_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_STATUS_OK:
- return;
+ break;
case BT_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_STATUS_AGAIN:
throw TryAgain {};
case BT_MESSAGE_ITERATOR_SEEK_NS_FROM_ORIGIN_STATUS_MEMORY_ERROR:
default:
bt_common_abort();
}
+
+ return *this;
}
bool canSeekForward() const noexcept
internal::CommonStreamBeginningMessageSpec<LibObjT>::stream(this->libObjPtr())};
}
- void defaultClockSnapshot(const std::uint64_t val) const noexcept
+ CommonStreamBeginningMessage defaultClockSnapshot(const std::uint64_t val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamBeginningMessage`.");
bt_message_stream_beginning_set_default_clock_snapshot(this->libObjPtr(), val);
+ return *this;
}
OptionalBorrowedObject<ConstClockSnapshot> defaultClockSnapshot() const noexcept
return _Stream {internal::CommonStreamEndMessageSpec<LibObjT>::stream(this->libObjPtr())};
}
- void defaultClockSnapshot(const std::uint64_t val) const noexcept
+ CommonStreamEndMessage defaultClockSnapshot(const std::uint64_t val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamEndMessage`.");
bt_message_stream_end_set_default_clock_snapshot(this->libObjPtr(), val);
+ return *this;
}
OptionalBorrowedObject<ConstClockSnapshot> defaultClockSnapshot() const noexcept
internal::CommonPacketBeginningMessageSpec<LibObjT>::packet(this->libObjPtr())};
}
- void defaultClockSnapshot(const std::uint64_t val) const noexcept
+ CommonPacketBeginningMessage defaultClockSnapshot(const std::uint64_t val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstPacketBeginningMessage`.");
bt_message_packet_beginning_set_default_clock_snapshot(this->libObjPtr(), val);
+ return *this;
}
ConstClockSnapshot defaultClockSnapshot() const noexcept
return _Packet {internal::CommonPacketEndMessageSpec<LibObjT>::packet(this->libObjPtr())};
}
- void defaultClockSnapshot(const std::uint64_t val) const noexcept
+ CommonPacketEndMessage defaultClockSnapshot(const std::uint64_t val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstPacketEndMessage`.");
bt_message_packet_end_set_default_clock_snapshot(this->libObjPtr(), val);
+ return *this;
}
ConstClockSnapshot defaultClockSnapshot() const noexcept
return ConstClockSnapshot {libObjPtr};
}
- void count(const std::uint64_t count) const noexcept
+ CommonDiscardedEventsMessage count(const std::uint64_t count) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstDiscardedEventsMessage`.");
bt_message_discarded_events_set_count(this->libObjPtr(), count);
+ return *this;
}
bt2s::optional<std::uint64_t> count() const noexcept
return ConstClockSnapshot {libObjPtr};
}
- void count(const std::uint64_t count) const noexcept
+ CommonDiscardedPacketsMessage count(const std::uint64_t count) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstDiscardedPacketsMessage`.");
bt_message_discarded_packets_set_count(this->libObjPtr(), count);
+ return *this;
}
bt2s::optional<std::uint64_t> count() const noexcept
}
template <typename T>
- void data(T& obj) const noexcept
+ SelfComponent data(T& obj) const noexcept
{
bt_self_component_set_data(this->libObjPtr(),
const_cast<void *>(static_cast<const void *>(&obj)));
+ return *this;
}
bt2::TraceClass::Shared createTraceClass() const
return this->_selfComponent().template data<T>();
}
- template <typename T>
- void data(T& obj) const noexcept
- {
- this->_selfComponent().data(obj);
- }
-
-private:
+protected:
SelfComponent _selfComponent() const noexcept
{
return SelfComponent {this->libObjPtr()};
class SelfSourceComponent final : public internal::SelfSpecificComponent<bt_self_component_source>
{
+ using _ThisSelfSpecificComponent = internal::SelfSpecificComponent<bt_self_component_source>;
+
public:
using OutputPorts = SelfComponentPorts<bt_self_component_source, bt_self_component_port_output,
const bt_port_output>;
bt_self_component_source_as_component_source(this->libObjPtr())};
}
+ using _ThisSelfSpecificComponent::data;
+
+ template <typename T>
+ SelfSourceComponent data(T& obj) const noexcept
+ {
+ this->_selfComponent().data(obj);
+ return *this;
+ }
+
template <typename DataT>
OutputPorts::Port addOutputPort(bt2c::CStringView name, DataT& data) const;
class SelfFilterComponent final : public internal::SelfSpecificComponent<bt_self_component_filter>
{
+ using _ThisSelfSpecificComponent = internal::SelfSpecificComponent<bt_self_component_filter>;
+
public:
using InputPorts = SelfComponentPorts<bt_self_component_filter, bt_self_component_port_input,
const bt_port_input>;
bt_self_component_filter_as_component_filter(this->libObjPtr())};
}
+ using _ThisSelfSpecificComponent::data;
+
+ template <typename T>
+ SelfFilterComponent data(T& obj) const noexcept
+ {
+ this->_selfComponent().data(obj);
+ return *this;
+ }
+
template <typename DataT>
InputPorts::Port addInputPort(bt2c::CStringView name, DataT& data) const;
class SelfSinkComponent final : public internal::SelfSpecificComponent<bt_self_component_sink>
{
+ using _ThisSelfSpecificComponent = internal::SelfSpecificComponent<bt_self_component_sink>;
+
public:
using InputPorts = SelfComponentPorts<bt_self_component_sink, bt_self_component_port_input,
const bt_port_input>;
return ConstSinkComponent {bt_self_component_sink_as_component_sink(this->libObjPtr())};
}
+ using _ThisSelfSpecificComponent::data;
+
+ template <typename T>
+ SelfSinkComponent data(T& obj) const noexcept
+ {
+ this->_selfComponent().data(obj);
+ return *this;
+ }
+
MessageIterator::Shared createMessageIterator(InputPorts::Port port) const;
bool isInterrupted() const noexcept
{
}
- void canSeekForward(const bool canSeekForward) const noexcept
+ SelfMessageIteratorConfiguration canSeekForward(const bool canSeekForward) const noexcept
{
bt_self_message_iterator_configuration_set_can_seek_forward(
this->libObjPtr(), static_cast<bt_bool>(canSeekForward));
+ return *this;
}
};
}
template <typename T>
- void data(T& obj) const noexcept
+ SelfMessageIterator data(T& obj) const noexcept
{
bt_self_message_iterator_set_data(this->libObjPtr(),
const_cast<void *>(static_cast<const void *>(&obj)));
+ return *this;
}
bt2::StreamBeginningMessage::Shared
return bt_stream_get_id(this->libObjPtr());
}
- void name(const bt2c::CStringView name) const
+ CommonStream name(const bt2c::CStringView name) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstStream`.");
if (status == BT_STREAM_SET_NAME_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
bt2c::CStringView name() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonStream userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstStream`.");
bt_stream_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
Class cls() const noexcept;
- void name(const bt2c::CStringView name) const
+ CommonTrace name(const bt2c::CStringView name) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTrace`.");
if (status == BT_TRACE_SET_NAME_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
bt2c::CStringView name() const noexcept
return bt_trace_get_name(this->libObjPtr());
}
- void uuid(const bt2c::UuidView& uuid) const noexcept
+ CommonTrace uuid(const bt2c::UuidView& uuid) const noexcept
{
bt_trace_set_uuid(this->libObjPtr(), uuid.begin());
+ return *this;
}
bt2s::optional<bt2c::UuidView> uuid() const noexcept
return _Spec::streamById(this->libObjPtr(), id);
}
- void environmentEntry(const bt2c::CStringView name, const std::int64_t val) const
+ CommonTrace environmentEntry(const bt2c::CStringView name, const std::int64_t val) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTrace`.");
if (status == BT_TRACE_SET_ENVIRONMENT_ENTRY_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
- void environmentEntry(const bt2c::CStringView name, const bt2c::CStringView val) const
+ CommonTrace environmentEntry(const bt2c::CStringView name, const bt2c::CStringView val) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTrace`.");
if (status == BT_TRACE_SET_ENVIRONMENT_ENTRY_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
std::uint64_t environmentSize() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonTrace userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTrace`.");
bt_trace_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
return bt_event_class_get_id(this->libObjPtr());
}
- void name(const bt2c::CStringView name) const
+ CommonEventClass name(const bt2c::CStringView name) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
if (status == BT_EVENT_CLASS_SET_NAME_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
bt2c::CStringView name() const noexcept
return bt_event_class_get_name(this->libObjPtr());
}
- void logLevel(const LogLevel logLevel) const noexcept
+ CommonEventClass logLevel(const LogLevel logLevel) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
bt_event_class_set_log_level(this->libObjPtr(),
static_cast<bt_event_class_log_level>(logLevel));
+ return *this;
}
bt2s::optional<LogLevel> logLevel() const noexcept
return bt2s::nullopt;
}
- void emfUri(const bt2c::CStringView emfUri) const
+ CommonEventClass emfUri(const bt2c::CStringView emfUri) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
if (status == BT_EVENT_CLASS_SET_EMF_URI_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
bt2c::CStringView emfUri() const noexcept
return bt_event_class_get_emf_uri(this->libObjPtr());
}
- void payloadFieldClass(const StructureFieldClass fc) const
+ CommonEventClass payloadFieldClass(const StructureFieldClass fc) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
if (status == BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
OptionalBorrowedObject<_StructureFieldClass> payloadFieldClass() const noexcept
return _Spec::payloadFieldClass(this->libObjPtr());
}
- void specificContextFieldClass(const StructureFieldClass fc) const
+ CommonEventClass specificContextFieldClass(const StructureFieldClass fc) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
if (status == BT_EVENT_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
OptionalBorrowedObject<_StructureFieldClass> specificContextFieldClass() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonEventClass userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
bt_event_class_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
return bt_stream_class_get_id(this->libObjPtr());
}
- void name(const bt2c::CStringView name) const
+ CommonStreamClass name(const bt2c::CStringView name) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
if (status == BT_STREAM_CLASS_SET_NAME_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
bt2c::CStringView name() const noexcept
return bt_stream_class_get_name(this->libObjPtr());
}
- void assignsAutomaticEventClassId(const bool val) const noexcept
+ CommonStreamClass assignsAutomaticEventClassId(const bool val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
bt_stream_class_set_assigns_automatic_event_class_id(this->libObjPtr(),
static_cast<bt_bool>(val));
+ return *this;
}
bool assignsAutomaticEventClassId() const noexcept
bt_stream_class_assigns_automatic_event_class_id(this->libObjPtr()));
}
- void assignsAutomaticStreamId(const bool val) const noexcept
+ CommonStreamClass assignsAutomaticStreamId(const bool val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
bt_stream_class_set_assigns_automatic_stream_id(this->libObjPtr(),
static_cast<bt_bool>(val));
+ return *this;
}
bool assignsAutomaticStreamId() const noexcept
return static_cast<bool>(bt_stream_class_assigns_automatic_stream_id(this->libObjPtr()));
}
- void supportsPackets(const bool supportsPackets, const bool withBeginningDefaultClkSnapshot,
- const bool withEndDefaultClkSnapshot) const noexcept
+ CommonStreamClass supportsPackets(const bool supportsPackets,
+ const bool withBeginningDefaultClkSnapshot,
+ const bool withEndDefaultClkSnapshot) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
static_cast<bt_bool>(supportsPackets),
static_cast<bt_bool>(withBeginningDefaultClkSnapshot),
static_cast<bt_bool>(withEndDefaultClkSnapshot));
+ return *this;
}
bool supportsPackets() const noexcept
bt_stream_class_packets_have_end_default_clock_snapshot(this->libObjPtr()));
}
- void supportsDiscardedEvents(const bool supportsDiscardedEvents,
- const bool withDefaultClkSnapshots) const noexcept
+ CommonStreamClass supportsDiscardedEvents(const bool supportsDiscardedEvents,
+ const bool withDefaultClkSnapshots) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
bt_stream_class_set_supports_discarded_events(
this->libObjPtr(), static_cast<bt_bool>(supportsDiscardedEvents),
static_cast<bt_bool>(withDefaultClkSnapshots));
+ return *this;
}
bool supportsDiscardedEvents() const noexcept
bt_stream_class_discarded_events_have_default_clock_snapshots(this->libObjPtr()));
}
- void supportsDiscardedPackets(const bool supportsDiscardedPackets,
- const bool withDefaultClkSnapshots) const noexcept
+ CommonStreamClass supportsDiscardedPackets(const bool supportsDiscardedPackets,
+ const bool withDefaultClkSnapshots) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
bt_stream_class_set_supports_discarded_packets(
this->libObjPtr(), static_cast<bt_bool>(supportsDiscardedPackets),
static_cast<bt_bool>(withDefaultClkSnapshots));
+ return *this;
}
bool supportsDiscardedPackets() const noexcept
bt_stream_class_discarded_packets_have_default_clock_snapshots(this->libObjPtr()));
}
- void defaultClockClass(const ClockClass clkCls) const
+ CommonStreamClass defaultClockClass(const ClockClass clkCls) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
bt_stream_class_set_default_clock_class(this->libObjPtr(), clkCls.libObjPtr());
BT_ASSERT(status == BT_STREAM_CLASS_SET_DEFAULT_CLOCK_CLASS_STATUS_OK);
+ return *this;
}
OptionalBorrowedObject<_ClockClass> defaultClockClass() const noexcept
return _Spec::eventClassById(this->libObjPtr(), id);
}
- void packetContextFieldClass(const StructureFieldClass fc) const
+ CommonStreamClass packetContextFieldClass(const StructureFieldClass fc) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
if (status == BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
OptionalBorrowedObject<_StructureFieldClass> packetContextFieldClass() const noexcept
return _Spec::packetContextFieldClass(this->libObjPtr());
}
- void eventCommonContextFieldClass(const StructureFieldClass fc) const
+ CommonStreamClass eventCommonContextFieldClass(const StructureFieldClass fc) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
if (status == BT_STREAM_CLASS_SET_FIELD_CLASS_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
OptionalBorrowedObject<_StructureFieldClass> eventCommonContextFieldClass() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonStreamClass userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStreamClass`.");
bt_stream_class_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
VariantWithSignedIntegerSelectorFieldClass>(selectorFieldClass);
}
- void assignsAutomaticStreamClassId(const bool val) const noexcept
+ CommonTraceClass assignsAutomaticStreamClassId(const bool val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
bt_trace_class_set_assigns_automatic_stream_class_id(this->libObjPtr(),
static_cast<bt_bool>(val));
+ return *this;
}
bool assignsAutomaticStreamClassId() const noexcept
}
template <typename LibValT>
- void userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
+ CommonTraceClass userAttributes(const CommonMapValue<LibValT> userAttrs) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstTraceClass`.");
bt_trace_class_set_user_attributes(this->libObjPtr(), userAttrs.libObjPtr());
+ return *this;
}
UserAttributes userAttributes() const noexcept
return static_cast<Value>(bt_value_bool_get(this->libObjPtr()));
}
- void value(const Value val) const noexcept
+ CommonBoolValue value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstBoolValue`.");
bt_value_bool_set(this->libObjPtr(), static_cast<bt_bool>(val));
+ return *this;
}
Shared shared() const noexcept
return RawValueProxy<CommonUnsignedIntegerValue> {*this};
}
- void value(const Value val) const noexcept
+ CommonUnsignedIntegerValue value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstUnsignedIntegerValue`.");
bt_value_integer_unsigned_set(this->libObjPtr(), val);
+ return *this;
}
Value value() const noexcept
return RawValueProxy<CommonSignedIntegerValue> {*this};
}
- void value(const Value val) const noexcept
+ CommonSignedIntegerValue value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstSignedIntegerValue`.");
bt_value_integer_signed_set(this->libObjPtr(), val);
+ return *this;
}
Value value() const noexcept
return RawValueProxy<CommonRealValue> {*this};
}
- void value(const Value val) const noexcept
+ CommonRealValue value(const Value val) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstRealValue`.");
bt_value_real_set(this->libObjPtr(), val);
+ return *this;
}
Value value() const noexcept
return RawValueProxy<CommonStringValue> {*this};
}
- void value(const Value val) const
+ CommonStringValue value(const Value val) const
{
static_assert(!std::is_const<LibObjT>::value,
"Not available with `bt2::ConstStringValue`.");
if (status == BT_VALUE_STRING_SET_STATUS_MEMORY_ERROR) {
throw MemoryError {};
}
+
+ return *this;
}
Value value() const noexcept
internal::CommonArrayValueSpec<LibObjT>::elementByIndex(this->libObjPtr(), index)};
}
- void append(const Value val) const
+ CommonArrayValue append(const Value val) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstArrayValue`.");
const auto status = bt_value_array_append_element(this->libObjPtr(), val.libObjPtr());
this->_handleAppendLibStatus(status);
+ return *this;
}
- void append(const bool rawVal) const
+ CommonArrayValue append(const bool rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstArrayValue`.");
bt_value_array_append_bool_element(this->libObjPtr(), static_cast<bt_bool>(rawVal));
this->_handleAppendLibStatus(status);
+ return *this;
}
- void append(const std::uint64_t rawVal) const
+ CommonArrayValue append(const std::uint64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstArrayValue`.");
bt_value_array_append_unsigned_integer_element(this->libObjPtr(), rawVal);
this->_handleAppendLibStatus(status);
+ return *this;
}
- void append(const std::int64_t rawVal) const
+ CommonArrayValue append(const std::int64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstArrayValue`.");
const auto status = bt_value_array_append_signed_integer_element(this->libObjPtr(), rawVal);
this->_handleAppendLibStatus(status);
+ return *this;
}
- void append(const double rawVal) const
+ CommonArrayValue append(const double rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstArrayValue`.");
const auto status = bt_value_array_append_real_element(this->libObjPtr(), rawVal);
this->_handleAppendLibStatus(status);
+ return *this;
}
- void append(const char * const rawVal) const
+ CommonArrayValue append(const char * const rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstArrayValue`.");
const auto status = bt_value_array_append_string_element(this->libObjPtr(), rawVal);
this->_handleAppendLibStatus(status);
+ return *this;
}
- void append(const bt2c::CStringView rawVal) const
+ CommonArrayValue append(const bt2c::CStringView rawVal) const
{
- this->append(rawVal.data());
+ return this->append(rawVal.data());
}
CommonArrayValue<bt_value> appendEmptyArray() const;
return static_cast<bool>(bt_value_map_has_entry(this->libObjPtr(), key));
}
- void insert(const bt2c::CStringView key, const Value val) const
+ CommonMapValue insert(const bt2c::CStringView key, const Value val) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstMapValue`.");
const auto status = bt_value_map_insert_entry(this->libObjPtr(), key, val.libObjPtr());
this->_handleInsertLibStatus(status);
+ return *this;
}
- void insert(const bt2c::CStringView key, const bool rawVal) const
+ CommonMapValue insert(const bt2c::CStringView key, const bool rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstMapValue`.");
bt_value_map_insert_bool_entry(this->libObjPtr(), key, static_cast<bt_bool>(rawVal));
this->_handleInsertLibStatus(status);
+ return *this;
}
- void insert(const bt2c::CStringView key, const std::uint64_t rawVal) const
+ CommonMapValue insert(const bt2c::CStringView key, const std::uint64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstMapValue`.");
bt_value_map_insert_unsigned_integer_entry(this->libObjPtr(), key, rawVal);
this->_handleInsertLibStatus(status);
+ return *this;
}
- void insert(const bt2c::CStringView key, const std::int64_t rawVal) const
+
+ CommonMapValue insert(const bt2c::CStringView key, const std::int64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstMapValue`.");
bt_value_map_insert_signed_integer_entry(this->libObjPtr(), key, rawVal);
this->_handleInsertLibStatus(status);
+ return *this;
}
- void insert(const bt2c::CStringView key, const double rawVal) const
+ CommonMapValue insert(const bt2c::CStringView key, const double rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstMapValue`.");
const auto status = bt_value_map_insert_real_entry(this->libObjPtr(), key, rawVal);
this->_handleInsertLibStatus(status);
+ return *this;
}
- void insert(const bt2c::CStringView key, const char *rawVal) const
+ CommonMapValue insert(const bt2c::CStringView key, const char *rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstMapValue`.");
const auto status = bt_value_map_insert_string_entry(this->libObjPtr(), key, rawVal);
this->_handleInsertLibStatus(status);
+ return *this;
}
- void insert(const bt2c::CStringView key, const bt2c::CStringView rawVal) const
+ CommonMapValue insert(const bt2c::CStringView key, const bt2c::CStringView rawVal) const
{
return this->insert(key, rawVal.data());
}
CommonArrayValue<bt_value> insertEmptyArray(bt2c::CStringView key) const;
CommonMapValue<bt_value> insertEmptyMap(bt2c::CStringView key) const;
- void forEach(const internal::CommonMapValueForEachUserFunc<CommonValue<LibObjT>>& func) const
+ CommonMapValue
+ forEach(const internal::CommonMapValueForEachUserFunc<CommonValue<LibObjT>>& func) const
{
internal::CommonMapValueSpec<LibObjT>::forEach(this->libObjPtr(), func);
+ return *this;
}
Shared shared() const noexcept