#include <babeltrace2/babeltrace.h>
#include "common/assert.h"
-#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
+#include "cpp-common/bt2s/optional.hpp"
#include "borrowed-object.hpp"
#include "field-class.hpp"
}
template <typename OtherLibObjT>
- _ThisCommonField& operator=(const CommonField<OtherLibObjT> val) noexcept
+ _ThisCommonField operator=(const CommonField<OtherLibObjT> val) noexcept
{
_ThisBorrowedObject::operator=(val);
return *this;
}
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<LibObjT>& operator=(const CommonBitArrayField<OtherLibObjT> val) noexcept
+ CommonBitArrayField<LibObjT> operator=(const CommonBitArrayField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
}
template <typename OtherLibObjT>
- _ThisCommonUnsignedIntegerField&
+ _ThisCommonUnsignedIntegerField
operator=(const CommonUnsignedIntegerField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
}
template <typename OtherLibObjT>
- _ThisCommonSignedIntegerField&
+ _ThisCommonSignedIntegerField
operator=(const CommonSignedIntegerField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
{
}
- EnumerationFieldClassMappingLabels(const EnumerationFieldClassMappingLabels&) noexcept =
- default;
-
- EnumerationFieldClassMappingLabels&
- operator=(const EnumerationFieldClassMappingLabels&) noexcept = default;
-
std::uint64_t length() const noexcept
{
return _mLen;
}
- bpstd::string_view operator[](const std::uint64_t index) const noexcept
+ const char *operator[](const std::uint64_t index) const noexcept
{
return _mLabels[index];
}
}
template <typename OtherLibObjT>
- CommonUnsignedEnumerationField<LibObjT>&
+ CommonUnsignedEnumerationField<LibObjT>
operator=(const CommonUnsignedEnumerationField<OtherLibObjT> val) noexcept
{
_ThisCommonUnsignedIntegerField::operator=(val);
}
template <typename OtherLibObjT>
- CommonSignedEnumerationField<LibObjT>&
+ CommonSignedEnumerationField<LibObjT>
operator=(const CommonSignedEnumerationField<OtherLibObjT> val) noexcept
{
_ThisCommonSignedIntegerField::operator=(val);
}
template <typename OtherLibObjT>
- CommonSinglePrecisionRealField<LibObjT>&
+ CommonSinglePrecisionRealField<LibObjT>
operator=(const CommonSinglePrecisionRealField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
}
template <typename OtherLibObjT>
- CommonDoublePrecisionRealField<LibObjT>&
+ CommonDoublePrecisionRealField<LibObjT>
operator=(const CommonDoublePrecisionRealField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(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;
}
template <typename OtherLibObjT>
- CommonStructureField<LibObjT>& operator=(const CommonStructureField<OtherLibObjT> val) noexcept
+ CommonStructureField<LibObjT> operator=(const CommonStructureField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;
return CommonField<LibObjT> {_Spec::memberFieldByIndex(this->libObjPtr(), index)};
}
- nonstd::optional<CommonField<LibObjT>> operator[](const char * const name) const noexcept
+ bt2s::optional<CommonField<LibObjT>> operator[](const char * const name) const noexcept
{
const auto libObjPtr = _Spec::memberFieldByName(this->libObjPtr(), name);
return CommonField<LibObjT> {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
- nonstd::optional<CommonField<LibObjT>> operator[](const std::string& name) const noexcept
+ bt2s::optional<CommonField<LibObjT>> operator[](const std::string& name) const noexcept
{
return (*this)[name.data()];
}
}
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<LibObjT>&
+ CommonDynamicArrayField<LibObjT>
operator=(const CommonDynamicArrayField<OtherLibObjT> val) noexcept
{
_ThisCommonArrayField::operator=(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;
return this->field().has_value();
}
- nonstd::optional<CommonField<LibObjT>> field() const noexcept
+ bt2s::optional<CommonField<LibObjT>> field() const noexcept
{
const auto libObjPtr = _Spec::field(this->libObjPtr());
return CommonField<LibObjT> {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
};
}
template <typename OtherLibObjT>
- CommonVariantField<LibObjT>& operator=(const CommonVariantField<OtherLibObjT> val) noexcept
+ CommonVariantField<LibObjT> operator=(const CommonVariantField<OtherLibObjT> val) noexcept
{
_ThisCommonField::operator=(val);
return *this;