MAP = BT_VALUE_TYPE_MAP,
};
-template <typename LibObjT>
-class CommonClockClass;
-
-template <typename LibObjT>
-class CommonFieldClass;
-
-template <typename LibObjT>
-class CommonTraceClass;
-
-template <typename LibObjT>
-class CommonStreamClass;
-
-template <typename LibObjT>
-class CommonEventClass;
-
-template <typename LibObjT>
-class CommonStream;
-
template <typename LibObjT>
class CommonValue : public BorrowedObject<LibObjT>
{
- /* Allow append() to call `val.libObjPtr()` */
- friend class CommonArrayValue<bt_value>;
-
- /* Allow insert() to call `val.libObjPtr()` */
- friend class CommonMapValue<bt_value>;
-
- /* Allow userAttributes() to call `val.libObjPtr()` */
- friend class CommonClockClass<bt_clock_class>;
- friend class CommonFieldClass<bt_field_class>;
- friend class CommonTraceClass<bt_trace_class>;
- friend class CommonStreamClass<bt_stream_class>;
- friend class CommonEventClass<bt_event_class>;
- friend class CommonStream<bt_stream>;
-
- /* Allow operator==() to call `other.libObjPtr()` */
- friend class CommonValue<bt_value>;
- friend class CommonValue<const bt_value>;
-
private:
using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
return bt_value_array_get_length(this->libObjPtr());
}
- /* Required by the `CommonIterator` template class */
- std::uint64_t size() const noexcept
- {
- return this->length();
- }
-
Iterator begin() const noexcept
{
return Iterator {*this, 0};
return *this;
}
- std::uint64_t size() const noexcept
+ std::uint64_t length() const noexcept
{
return bt_value_map_get_size(this->libObjPtr());
}
bool isEmpty() const noexcept
{
- return this->size() == 0;
+ return this->length() == 0;
}
nonstd::optional<CommonValue<LibObjT>> operator[](const char * const key) const noexcept