}
template <typename OtherLibObjT>
- CommonField(const CommonField<OtherLibObjT>& val) noexcept : _ThisBorrowedObj {val}
+ CommonField(const CommonField<OtherLibObjT> val) noexcept : _ThisBorrowedObj {val}
{
}
template <typename OtherLibObjT>
- _ThisCommonField& operator=(const CommonField<OtherLibObjT>& val) noexcept
+ _ThisCommonField& operator=(const CommonField<OtherLibObjT> val) noexcept
{
_ThisBorrowedObj::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonBoolField(const CommonBoolField<OtherLibObjT>& val) noexcept : _ThisCommonField {val}
+ CommonBoolField(const CommonBoolField<OtherLibObjT> val) noexcept : _ThisCommonField {val}
{
}
template <typename OtherLibObjT>
- CommonBoolField<LibObjT>& operator=(const CommonBoolField<OtherLibObjT>& val) noexcept
+ CommonBoolField<LibObjT>& operator=(const CommonBoolField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonBitArrayField(const CommonBitArrayField<OtherLibObjT>& val) noexcept :
+ CommonBitArrayField(const CommonBitArrayField<OtherLibObjT> val) noexcept :
_ThisCommonField {val}
{
}
template <typename OtherLibObjT>
- CommonBitArrayField<LibObjT>& operator=(const CommonBitArrayField<OtherLibObjT>& val) noexcept
+ CommonBitArrayField<LibObjT>& operator=(const CommonBitArrayField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
} /* namespace internal */
template <typename LibObjT>
-class CommonUnsignedIntegerField final : public CommonField<LibObjT>
+class CommonUnsignedIntegerField : public CommonField<LibObjT>
{
private:
using typename CommonField<LibObjT>::_ThisCommonField;
}
template <typename OtherLibObjT>
- CommonUnsignedIntegerField(const CommonUnsignedIntegerField<OtherLibObjT>& val) noexcept :
+ CommonUnsignedIntegerField(const CommonUnsignedIntegerField<OtherLibObjT> val) noexcept :
_ThisCommonField {val}
{
}
template <typename OtherLibObjT>
_ThisCommonUnsignedIntegerField&
- operator=(const CommonUnsignedIntegerField<OtherLibObjT>& val) noexcept
+ operator=(const CommonUnsignedIntegerField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
} /* namespace internal */
template <typename LibObjT>
-class CommonSignedIntegerField final : public CommonField<LibObjT>
+class CommonSignedIntegerField : public CommonField<LibObjT>
{
private:
using typename CommonField<LibObjT>::_ThisCommonField;
using _ThisCommonSignedIntegerField = CommonSignedIntegerField<LibObjT>;
public:
- using Value = std::uint64_t;
+ using Value = std::int64_t;
using Class = typename std::conditional<std::is_const<LibObjT>::value, ConstIntegerFieldClass,
IntegerFieldClass>::type;
}
template <typename OtherLibObjT>
- CommonSignedIntegerField(const CommonSignedIntegerField<OtherLibObjT>& val) noexcept :
+ CommonSignedIntegerField(const CommonSignedIntegerField<OtherLibObjT> val) noexcept :
_ThisCommonField {val}
{
}
template <typename OtherLibObjT>
_ThisCommonSignedIntegerField&
- operator=(const CommonSignedIntegerField<OtherLibObjT>& val) noexcept
+ operator=(const CommonSignedIntegerField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonUnsignedEnumerationField(const CommonUnsignedEnumerationField<OtherLibObjT>& val) noexcept
+ CommonUnsignedEnumerationField(const CommonUnsignedEnumerationField<OtherLibObjT> val) noexcept
:
_ThisCommonUnsignedIntegerField {val}
{
template <typename OtherLibObjT>
CommonUnsignedEnumerationField<LibObjT>&
- operator=(const CommonUnsignedEnumerationField<OtherLibObjT>& val) noexcept
+ operator=(const CommonUnsignedEnumerationField<OtherLibObjT> val) noexcept
{
_ThisCommonUnsignedIntegerField::operator=(val);
return *this;
internal::CommonFieldSpec<const bt_field>::cls(this->libObjPtr())};
}
+ using CommonUnsignedIntegerField<LibObjT>::operator=;
+
Class cls() noexcept
{
return Class {internal::CommonFieldSpec<LibObjT>::cls(this->libObjPtr())};
}
template <typename OtherLibObjT>
- CommonSignedEnumerationField(const CommonSignedEnumerationField<OtherLibObjT>& val) noexcept :
+ CommonSignedEnumerationField(const CommonSignedEnumerationField<OtherLibObjT> val) noexcept :
_ThisCommonSignedIntegerField {val}
{
}
template <typename OtherLibObjT>
CommonSignedEnumerationField<LibObjT>&
- operator=(const CommonSignedEnumerationField<OtherLibObjT>& val) noexcept
+ operator=(const CommonSignedEnumerationField<OtherLibObjT> val) noexcept
{
_ThisCommonSignedIntegerField::operator=(val);
return *this;
}
+ using CommonSignedIntegerField<LibObjT>::operator=;
+
ConstSignedEnumerationFieldClass cls() const noexcept
{
return ConstSignedEnumerationFieldClass {
}
template <typename OtherLibObjT>
- CommonSinglePrecisionRealField(const CommonSinglePrecisionRealField<OtherLibObjT>& val) noexcept
+ CommonSinglePrecisionRealField(const CommonSinglePrecisionRealField<OtherLibObjT> val) noexcept
:
_ThisCommonField {val}
{
template <typename OtherLibObjT>
CommonSinglePrecisionRealField<LibObjT>&
- operator=(const CommonSinglePrecisionRealField<OtherLibObjT>& val) noexcept
+ operator=(const CommonSinglePrecisionRealField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonDoublePrecisionRealField(const CommonDoublePrecisionRealField<OtherLibObjT>& val) noexcept
+ CommonDoublePrecisionRealField(const CommonDoublePrecisionRealField<OtherLibObjT> val) noexcept
:
_ThisCommonField {val}
{
template <typename OtherLibObjT>
CommonDoublePrecisionRealField<LibObjT>&
- operator=(const CommonDoublePrecisionRealField<OtherLibObjT>& val) noexcept
+ operator=(const CommonDoublePrecisionRealField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
- bt_field_real_single_precision_set_value(this->libObjPtr(), val);
+ bt_field_real_double_precision_set_value(this->libObjPtr(), val);
return *this;
}
Value value() const noexcept
{
- return bt_field_real_single_precision_get_value(this->libObjPtr());
+ return bt_field_real_double_precision_get_value(this->libObjPtr());
}
operator Value() const noexcept
}
template <typename OtherLibObjT>
- CommonStringField(const CommonStringField<OtherLibObjT>& val) noexcept : _ThisCommonField {val}
+ CommonStringField(const CommonStringField<OtherLibObjT> val) noexcept : _ThisCommonField {val}
{
}
template <typename OtherLibObjT>
- CommonStringField<LibObjT>& operator=(const CommonStringField<OtherLibObjT>& val) noexcept
+ CommonStringField<LibObjT>& operator=(const CommonStringField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
- CommonStringField<LibObjT>& operator=(const char * const val) noexcept
+ CommonStringField<LibObjT>& operator=(const char * const val)
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
return *this;
}
- CommonStringField<LibObjT>& operator=(const std::string& val) noexcept
+ CommonStringField<LibObjT>& operator=(const std::string& val)
{
return *this = val.data();
}
+ void append(const char * const begin, const std::uint64_t len)
+ {
+ static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
+
+ const auto status = bt_field_string_append_with_length(this->libObjPtr(), begin, len);
+
+ if (status == BT_FIELD_STRING_APPEND_STATUS_MEMORY_ERROR) {
+ throw MemoryError {};
+ }
+ }
+
+ void append(const std::string& val)
+ {
+ this->append(val.data(), val.size());
+ }
+
void clear() noexcept
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
}
template <typename OtherLibObjT>
- CommonStructureField(const CommonStructureField<OtherLibObjT>& val) noexcept :
+ CommonStructureField(const CommonStructureField<OtherLibObjT> val) noexcept :
_ThisCommonField {val}
{
}
template <typename OtherLibObjT>
- CommonStructureField<LibObjT>& operator=(const CommonStructureField<OtherLibObjT>& val) noexcept
+ CommonStructureField<LibObjT>& operator=(const CommonStructureField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonArrayField(const CommonArrayField<OtherLibObjT>& val) noexcept : _ThisCommonField {val}
+ CommonArrayField(const CommonArrayField<OtherLibObjT> val) noexcept : _ThisCommonField {val}
{
}
template <typename OtherLibObjT>
- _ThisCommonArrayField& operator=(const CommonArrayField<OtherLibObjT>& val) noexcept
+ _ThisCommonArrayField& operator=(const CommonArrayField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonDynamicArrayField(const CommonDynamicArrayField<OtherLibObjT>& val) noexcept :
+ CommonDynamicArrayField(const CommonDynamicArrayField<OtherLibObjT> val) noexcept :
_ThisCommonArrayField {val}
{
}
template <typename OtherLibObjT>
CommonDynamicArrayField<LibObjT>&
- operator=(const CommonDynamicArrayField<OtherLibObjT>& val) noexcept
+ operator=(const CommonDynamicArrayField<OtherLibObjT> val) noexcept
{
_ThisCommonArrayField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonOptionField(const CommonOptionField<OtherLibObjT>& val) noexcept : _ThisCommonField {val}
+ CommonOptionField(const CommonOptionField<OtherLibObjT> val) noexcept : _ThisCommonField {val}
{
}
template <typename OtherLibObjT>
- CommonOptionField<LibObjT>& operator=(const CommonOptionField<OtherLibObjT>& val) noexcept
+ CommonOptionField<LibObjT>& operator=(const CommonOptionField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- CommonVariantField(const CommonVariantField<OtherLibObjT>& val) noexcept :
- _ThisCommonField {val}
+ CommonVariantField(const CommonVariantField<OtherLibObjT> val) noexcept : _ThisCommonField {val}
{
}
template <typename OtherLibObjT>
- CommonVariantField<LibObjT>& operator=(const CommonVariantField<OtherLibObjT>& val) noexcept
+ CommonVariantField<LibObjT>& operator=(const CommonVariantField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;