return *this;
}
- CommonBoolValue<LibObjT>& operator=(const Value rawVal) noexcept
+ CommonBoolValue<LibObjT> operator=(const Value rawVal) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
return *this;
}
- CommonUnsignedIntegerValue<LibObjT>& operator=(const Value rawVal) noexcept
+ CommonUnsignedIntegerValue<LibObjT> operator=(const Value rawVal) const noexcept
{
bt_value_integer_unsigned_set(this->libObjPtr(), rawVal);
return *this;
}
template <typename OtherLibObjT>
- CommonSignedIntegerValue<LibObjT>&
+ CommonSignedIntegerValue<LibObjT>
operator=(const CommonSignedIntegerValue<OtherLibObjT> val) noexcept
{
_ThisCommonValue::operator=(val);
return *this;
}
- CommonSignedIntegerValue<LibObjT>& operator=(const Value rawVal) noexcept
+ CommonSignedIntegerValue<LibObjT> operator=(const Value rawVal) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
return *this;
}
- CommonRealValue<LibObjT>& operator=(const Value rawVal) noexcept
+ CommonRealValue<LibObjT> operator=(const Value rawVal) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
return *this;
}
- CommonStringValue<LibObjT>& operator=(const char * const rawVal)
+ CommonStringValue<LibObjT> operator=(const char * const rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
return *this;
}
- CommonStringValue<LibObjT>& operator=(const std::string& rawVal) noexcept
+ CommonStringValue<LibObjT> operator=(const std::string& rawVal) const noexcept
{
return *this = rawVal.data();
}
return this->length() == 0;
}
- ConstValue operator[](const std::uint64_t index) const noexcept
- {
- return ConstValue {internal::CommonArrayValueSpec<const bt_value>::elementByIndex(
- this->libObjPtr(), index)};
- }
-
- CommonValue<LibObjT> operator[](const std::uint64_t index) noexcept
+ CommonValue<LibObjT> operator[](const std::uint64_t index) const noexcept
{
return CommonValue<LibObjT> {
internal::CommonArrayValueSpec<LibObjT>::elementByIndex(this->libObjPtr(), index)};
}
- void append(const Value val)
+ void append(const Value val) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleAppendLibStatus(status);
}
- void append(const bool rawVal)
+ void append(const bool rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleAppendLibStatus(status);
}
- void append(const std::uint64_t rawVal)
+ void append(const std::uint64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleAppendLibStatus(status);
}
- void append(const std::int64_t rawVal)
+ void append(const std::int64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleAppendLibStatus(status);
}
- void append(const double rawVal)
+ void append(const double rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleAppendLibStatus(status);
}
- void append(const char * const rawVal)
+ void append(const char * const rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleAppendLibStatus(status);
}
- void append(const std::string& rawVal)
+ void append(const std::string& rawVal) const
{
this->append(rawVal.data());
}
- CommonArrayValue<bt_value> appendEmptyArray();
- CommonMapValue<bt_value> appendEmptyMap();
+ CommonArrayValue<bt_value> appendEmptyArray() const;
+ CommonMapValue<bt_value> appendEmptyMap() const;
- void operator+=(const Value val)
+ void operator+=(const Value val) const
{
this->append(val);
}
- void operator+=(const bool rawVal)
+ void operator+=(const bool rawVal) const
{
this->append(rawVal);
}
- void operator+=(const std::uint64_t rawVal)
+ void operator+=(const std::uint64_t rawVal) const
{
this->append(rawVal);
}
- void operator+=(const std::int64_t rawVal)
+ void operator+=(const std::int64_t rawVal) const
{
this->append(rawVal);
}
- void operator+=(const double rawVal)
+ void operator+=(const double rawVal) const
{
this->append(rawVal);
}
- void operator+=(const char * const rawVal)
+ void operator+=(const char * const rawVal) const
{
this->append(rawVal);
}
- void operator+=(const std::string& rawVal)
+ void operator+=(const std::string& rawVal) const
{
this->append(rawVal);
}
return this->size() == 0;
}
- nonstd::optional<ConstValue> operator[](const char * const key) const noexcept
- {
- const auto libObjPtr =
- internal::CommonMapValueSpec<const bt_value>::entryByKey(this->libObjPtr(), key);
-
- if (!libObjPtr) {
- return nonstd::nullopt;
- }
-
- return ConstValue {libObjPtr};
- }
-
- nonstd::optional<ConstValue> operator[](const std::string& key) const noexcept
- {
- return (*this)[key.data()];
- }
-
- nonstd::optional<CommonValue<LibObjT>> operator[](const char * const key) noexcept
+ nonstd::optional<CommonValue<LibObjT>> operator[](const char * const key) const noexcept
{
const auto libObjPtr =
internal::CommonMapValueSpec<LibObjT>::entryByKey(this->libObjPtr(), key);
return CommonValue<LibObjT> {libObjPtr};
}
- nonstd::optional<CommonValue<LibObjT>> operator[](const std::string& key) noexcept
+ nonstd::optional<CommonValue<LibObjT>> operator[](const std::string& key) const noexcept
{
return (*this)[key.data()];
}
return this->hasEntry(key.data());
}
- void insert(const char * const key, const Value val)
+ void insert(const char * const key, const Value val) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleInsertLibStatus(status);
}
- void insert(const std::string& key, const Value val)
+ void insert(const std::string& key, const Value val) const
{
this->insert(key.data(), val);
}
- void insert(const char * const key, const bool rawVal)
+ void insert(const char * const key, const bool rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleInsertLibStatus(status);
}
- void insert(const std::string& key, const bool rawVal)
+ void insert(const std::string& key, const bool rawVal) const
{
this->insert(key.data(), rawVal);
}
- void insert(const char * const key, const std::uint64_t rawVal)
+ void insert(const char * const key, const std::uint64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleInsertLibStatus(status);
}
- void insert(const std::string& key, const std::uint64_t rawVal)
+ void insert(const std::string& key, const std::uint64_t rawVal) const
{
this->insert(key.data(), rawVal);
}
- void insert(const char * const key, const std::int64_t rawVal)
+ void insert(const char * const key, const std::int64_t rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleInsertLibStatus(status);
}
- void insert(const std::string& key, const std::int64_t rawVal)
+ void insert(const std::string& key, const std::int64_t rawVal) const
{
this->insert(key.data(), rawVal);
}
- void insert(const char * const key, const double rawVal)
+ void insert(const char * const key, const double rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleInsertLibStatus(status);
}
- void insert(const std::string& key, const double rawVal)
+ void insert(const std::string& key, const double rawVal) const
{
this->insert(key.data(), rawVal);
}
- void insert(const char * const key, const char * const rawVal)
+ void insert(const char * const key, const char * const rawVal) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
this->_handleInsertLibStatus(status);
}
- void insert(const char * const key, const std::string& rawVal)
+ void insert(const char * const key, const std::string& rawVal) const
{
this->insert(key, rawVal.data());
}
- void insert(const std::string& key, const char * const rawVal)
+ void insert(const std::string& key, const char * const rawVal) const
{
this->insert(key.data(), rawVal);
}
- void insert(const std::string& key, const std::string& rawVal)
+ void insert(const std::string& key, const std::string& rawVal) const
{
this->insert(key.data(), rawVal.data());
}
- CommonArrayValue<bt_value> insertEmptyArray(const char *key);
- CommonArrayValue<bt_value> insertEmptyArray(const std::string& key);
- CommonMapValue<bt_value> insertEmptyMap(const char *key);
- CommonMapValue<bt_value> insertEmptyMap(const std::string& key);
-
- void forEach(const internal::CommonMapValueForEachUserFunc<ConstValue>& func) const
- {
- internal::CommonMapValueSpec<const bt_value>::forEach(this->libObjPtr(), func);
- }
+ CommonArrayValue<bt_value> insertEmptyArray(const char *key) const;
+ CommonArrayValue<bt_value> insertEmptyArray(const std::string& key) const;
+ CommonMapValue<bt_value> insertEmptyMap(const char *key) const;
+ CommonMapValue<bt_value> insertEmptyMap(const std::string& key) const;
- void forEach(const internal::CommonMapValueForEachUserFunc<CommonValue<LibObjT>>& func)
+ void forEach(const internal::CommonMapValueForEachUserFunc<CommonValue<LibObjT>>& func) const
{
internal::CommonMapValueSpec<LibObjT>::forEach(this->libObjPtr(), func);
}
}
template <typename LibObjT>
-ArrayValue CommonArrayValue<LibObjT>::appendEmptyArray()
+ArrayValue CommonArrayValue<LibObjT>::appendEmptyArray() const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
}
template <typename LibObjT>
-MapValue CommonArrayValue<LibObjT>::appendEmptyMap()
+MapValue CommonArrayValue<LibObjT>::appendEmptyMap() const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
}
template <typename LibObjT>
-ArrayValue CommonMapValue<LibObjT>::insertEmptyArray(const char * const key)
+ArrayValue CommonMapValue<LibObjT>::insertEmptyArray(const char * const key) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
}
template <typename LibObjT>
-ArrayValue CommonMapValue<LibObjT>::insertEmptyArray(const std::string& key)
+ArrayValue CommonMapValue<LibObjT>::insertEmptyArray(const std::string& key) const
{
return this->insertEmptyArray(key.data());
}
template <typename LibObjT>
-MapValue CommonMapValue<LibObjT>::insertEmptyMap(const char * const key)
+MapValue CommonMapValue<LibObjT>::insertEmptyMap(const char * const key) const
{
static_assert(!std::is_const<LibObjT>::value, "`LibObjT` must NOT be `const`.");
}
template <typename LibObjT>
-MapValue CommonMapValue<LibObjT>::insertEmptyMap(const std::string& key)
+MapValue CommonMapValue<LibObjT>::insertEmptyMap(const std::string& key) const
{
return this->insertEmptyMap(key.data());
}