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