cpp-common/bt2: use the "length" term everywhere instead of "size"
[babeltrace.git] / src / cpp-common / bt2 / value.hpp
index 7c4e4a997c5b04596ec0fd8ece7930580f0d643a..c8e3dc791fce51678e5dc5301487fedcd3e58156 100644 (file)
@@ -81,45 +81,9 @@ enum class ValueType
     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;
 
@@ -807,12 +771,6 @@ public:
         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};
@@ -1106,14 +1064,14 @@ public:
         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
This page took 0.040403 seconds and 4 git commands to generate.