endif
noinst_HEADERS = \
+ cpp-common/bt2/borrowed-obj.hpp \
cpp-common/bt2/clock-class.hpp \
cpp-common/bt2/clock-snapshot.hpp \
cpp-common/bt2/common-iter.hpp \
cpp-common/bt2/field-path.hpp \
cpp-common/bt2/integer-range.hpp \
cpp-common/bt2/integer-range-set.hpp \
- cpp-common/bt2/internal/borrowed-obj.hpp \
cpp-common/bt2/internal/shared-obj.hpp \
cpp-common/bt2/internal/utils.hpp \
cpp-common/bt2/logging.hpp \
--- /dev/null
+/*
+ * Copyright 2019-2020 (c) Philippe Proulx <pproulx@efficios.com>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef BABELTRACE_CPP_COMMON_BT2_BORROWED_OBJ_HPP
+#define BABELTRACE_CPP_COMMON_BT2_BORROWED_OBJ_HPP
+
+#include <functional>
+#include <type_traits>
+
+#include "common/assert.h"
+
+namespace bt2 {
+
+/*
+ * An instance of this class wraps a pointer to a libbabeltrace2 object
+ * of type `LibObjT` without managing any reference counting.
+ *
+ * This is an abstract base class for any libbabeltrace2 object wrapper.
+ *
+ * `LibObjT` is the direct libbabeltrace2 object type, for example
+ * `bt_stream_class` or `const bt_value`.
+ *
+ * Methods of a derived class can call libObjPtr() to access the
+ * libbabeltrace2 object pointer.
+ */
+template <typename LibObjT>
+class BorrowedObj
+{
+ static_assert(!std::is_pointer<LibObjT>::value, "`LibObjT` must not be a pointer");
+
+ /*
+ * This makes it possible for a `BorrowedObj<const bt_something>`
+ * instance to get assigned an instance of
+ * `BorrowedObj<bt_something>` ("copy" constructor and "assignment"
+ * operator).
+ *
+ * C++ forbids the other way around.
+ */
+ template <typename>
+ friend class BorrowedObj;
+
+private:
+ /*
+ * Provides `val` which indicates whether or not you can assign this
+ * object from a borrowed object of type `OtherLibObjT`.
+ */
+ template <typename OtherLibObjT>
+ struct _AssignableFromConst final
+ {
+ /*
+ * If `LibObjT` is const (for example, `const bt_value`), then
+ * you may always assign from its non-const equivalent (for
+ * example, `bt_value`). In C (correct):
+ *
+ * bt_value * const meow = bt_value_bool_create_init(BT_TRUE);
+ * const bt_value * const mix = meow;
+ *
+ * If `LibObjT` is non-const, then you may not assign from its
+ * const equivalent. In C (not correct):
+ *
+ * const bt_value * const meow =
+ * bt_value_array_borrow_element_by_index_const(some_val, 17);
+ * bt_value * const mix = meow;
+ */
+ static constexpr bool val =
+ std::is_const<LibObjT>::value || !std::is_const<OtherLibObjT>::value;
+ };
+
+protected:
+ /* libbabeltrace2 object pointer */
+ using _LibObjPtr = LibObjT *;
+
+ /* This complete borrowed object */
+ using _ThisBorrowedObj = BorrowedObj<LibObjT>;
+
+ /*
+ * Builds a borrowed object to wrap the libbabeltrace2 object
+ * pointer `libObjPtr`.
+ *
+ * `libObjPtr` must not be `nullptr`.
+ */
+ explicit BorrowedObj(const _LibObjPtr libObjPtr) noexcept : _mLibObjPtr {libObjPtr}
+ {
+ BT_ASSERT(libObjPtr);
+ }
+
+ /* Default copy operations */
+ BorrowedObj(const BorrowedObj&) noexcept = default;
+ BorrowedObj& operator=(const BorrowedObj&) noexcept = default;
+
+ /*
+ * Generic "copy" constructor.
+ *
+ * This converting constructor accepts both an instance of
+ * `_ThisBorrowedObj` and an instance (`other`) of
+ * `BorrowedObj<ConstLibObjT>`, where `ConstLibObjT` is the `const`
+ * version of `LibObjT`, if applicable.
+ *
+ * This makes it possible for a `BorrowedObj<const bt_something>`
+ * instance to be built from an instance of
+ * `BorrowedObj<bt_something>`. C++ forbids the other way around.
+ */
+ template <typename OtherLibObjT>
+ BorrowedObj(const BorrowedObj<OtherLibObjT>& other) noexcept : BorrowedObj {other._mLibObjPtr}
+ {
+ static_assert(_AssignableFromConst<OtherLibObjT>::val,
+ "Don't assign a non-const wrapper from a const wrapper.");
+ }
+
+ /*
+ * Generic "assignment" operator.
+ *
+ * This operator accepts both an instance of
+ * `_ThisBorrowedObj` and an instance (`other`) of
+ * `BorrowedObj<ConstLibObjT>`, where `ConstLibObjT` is the `const`
+ * version of `LibObjT`, if applicable.
+ *
+ * This makes it possible for a `BorrowedObj<const bt_something>`
+ * instance to get assigned an instance of
+ * `BorrowedObj<bt_something>`. C++ forbids the other way around,
+ * therefore we use `_EnableIfAssignableT` to show a more relevant
+ * context in the compiler error message.
+ */
+ template <typename OtherLibObjT>
+ _ThisBorrowedObj& operator=(const BorrowedObj<OtherLibObjT>& other) noexcept
+ {
+ static_assert(_AssignableFromConst<OtherLibObjT>::val,
+ "Don't assign a non-const wrapper from a const wrapper.");
+
+ _mLibObjPtr = other._mLibObjPtr;
+ return *this;
+ }
+
+public:
+ /*
+ * Returns a hash of this object, solely based on its raw libbabeltrace2
+ * pointer.
+ */
+ std::size_t hash() const noexcept
+ {
+ return std::hash<_LibObjPtr> {}(_mLibObjPtr);
+ }
+
+ /*
+ * Returns whether or not this object is the exact same as `other`,
+ * solely based on the raw libbabeltrace2 pointers.
+ */
+ bool isSame(const _ThisBorrowedObj& other) const noexcept
+ {
+ return _mLibObjPtr == other._mLibObjPtr;
+ }
+
+ /* Wrapped libbabeltrace2 object pointer */
+ _LibObjPtr libObjPtr() const noexcept
+ {
+ return _mLibObjPtr;
+ }
+
+private:
+ _LibObjPtr _mLibObjPtr;
+};
+
+} /* namespace bt2 */
+
+#endif /* BABELTRACE_CPP_COMMON_BT2_BORROWED_OBJ_HPP */
#include "cpp-common/string_view.hpp"
#include "cpp-common/uuid-view.hpp"
+#include "borrowed-obj.hpp"
#include "exc.hpp"
-#include "internal/borrowed-obj.hpp"
#include "internal/shared-obj.hpp"
#include "internal/utils.hpp"
#include "value.hpp"
};
template <typename LibObjT>
-class CommonClockClass final : public internal::BorrowedObj<LibObjT>
+class CommonClockClass final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ThisCommonClockClass = CommonClockClass<LibObjT>;
public:
#include <babeltrace2/babeltrace.h>
+#include "borrowed-obj.hpp"
#include "exc.hpp"
-#include "internal/borrowed-obj.hpp"
namespace bt2 {
-class ConstClockSnapshot final : public internal::BorrowedObj<const bt_clock_snapshot>
+class ConstClockSnapshot final : public BorrowedObj<const bt_clock_snapshot>
{
public:
explicit ConstClockSnapshot(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
+#include "borrowed-obj.hpp"
#include "common-iter.hpp"
#include "exc.hpp"
#include "field-path.hpp"
#include "integer-range-set.hpp"
-#include "internal/borrowed-obj.hpp"
#include "internal/shared-obj.hpp"
#include "internal/utils.hpp"
#include "value.hpp"
};
template <typename LibObjT>
-class CommonFieldClass : public internal::BorrowedObj<LibObjT>
+class CommonFieldClass : public BorrowedObj<LibObjT>
{
/* Allow appendMember() to call `fc.libObjPtr()` */
friend class CommonStructureFieldClass<bt_field_class>;
friend class CommonTraceClass<bt_trace_class>;
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
protected:
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ThisCommonFieldClass = CommonFieldClass<LibObjT>;
public:
} /* namespace internal */
template <typename LibObjT>
-class ConstEnumerationFieldClassMapping final : public internal::BorrowedObj<LibObjT>
+class ConstEnumerationFieldClassMapping final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
public:
using RangeSet = typename std::conditional<
} /* namespace internal */
template <typename LibObjT>
-class CommonStructureFieldClassMember final : public internal::BorrowedObj<LibObjT>
+class CommonStructureFieldClassMember final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
using _FieldClass =
typename std::conditional<std::is_const<LibObjT>::value, ConstFieldClass, FieldClass>::type;
} /* namespace internal */
template <typename LibObjT>
-class CommonVariantFieldClassOption : public internal::BorrowedObj<LibObjT>
+class CommonVariantFieldClassOption : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _FieldClass =
typename std::conditional<std::is_const<LibObjT>::value, ConstFieldClass, FieldClass>::type;
} /* namespace internal */
template <typename LibObjT>
-class ConstVariantWithIntegerSelectorFieldClassOption : public internal::BorrowedObj<LibObjT>
+class ConstVariantWithIntegerSelectorFieldClassOption : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _Spec = internal::ConstVariantWithIntegerSelectorFieldClassOptionSpec<LibObjT>;
public:
#include "common/assert.h"
+#include "borrowed-obj.hpp"
#include "common-iter.hpp"
-#include "internal/borrowed-obj.hpp"
#include "internal/shared-obj.hpp"
namespace bt2 {
CURRENT_OPTION_CONTENT = BT_FIELD_PATH_ITEM_TYPE_CURRENT_OPTION_CONTENT,
};
-class ConstFieldPathItem : public internal::BorrowedObj<const bt_field_path_item>
+class ConstFieldPathItem : public BorrowedObj<const bt_field_path_item>
{
public:
explicit ConstFieldPathItem(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
} /* namespace internal */
-class ConstFieldPath final : public internal::BorrowedObj<const bt_field_path>
+class ConstFieldPath final : public BorrowedObj<const bt_field_path>
{
public:
using Shared =
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
+#include "borrowed-obj.hpp"
#include "field-class.hpp"
-#include "internal/borrowed-obj.hpp"
#include "internal/utils.hpp"
namespace bt2 {
} /* namespace internal */
template <typename LibObjT>
-class CommonField : public internal::BorrowedObj<LibObjT>
+class CommonField : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
protected:
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ThisCommonField = CommonField<LibObjT>;
public:
#include <babeltrace2/babeltrace.h>
+#include "borrowed-obj.hpp"
#include "common-iter.hpp"
#include "exc.hpp"
#include "integer-range.hpp"
-#include "internal/borrowed-obj.hpp"
#include "internal/utils.hpp"
namespace bt2 {
class CommonTraceClass;
template <typename LibObjT>
-class CommonIntegerRangeSet final : public internal::BorrowedObj<LibObjT>
+class CommonIntegerRangeSet final : public BorrowedObj<LibObjT>
{
/* Allow operator==() to call `other.libObjPtr()` */
friend class CommonIntegerRangeSet<bt_integer_range_set_unsigned>;
friend class CommonTraceClass<bt_trace_class>;
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstLibObjT = typename std::add_const<LibObjT>::type;
using _RefFuncs = internal::IntegerRangeSetRefFuncs<_ConstLibObjT>;
using _Spec = internal::CommonIntegerRangeSetSpec<_ConstLibObjT>;
#include <babeltrace2/babeltrace.h>
-#include "internal/borrowed-obj.hpp"
+#include "borrowed-obj.hpp"
namespace bt2 {
} /* namespace internal */
template <typename LibObjT>
-class ConstIntegerRange final : public internal::BorrowedObj<LibObjT>
+class ConstIntegerRange final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ThisConstIntegerRange = ConstIntegerRange<LibObjT>;
public:
+++ /dev/null
-/*
- * Copyright 2019-2020 (c) Philippe Proulx <pproulx@efficios.com>
- *
- * SPDX-License-Identifier: MIT
- */
-
-#ifndef BABELTRACE_CPP_COMMON_BT2_INTERNAL_BORROWED_OBJ_HPP
-#define BABELTRACE_CPP_COMMON_BT2_INTERNAL_BORROWED_OBJ_HPP
-
-#include <functional>
-#include <type_traits>
-
-#include "common/assert.h"
-
-namespace bt2 {
-namespace internal {
-
-/*
- * An instance of this class wraps a pointer to a libbabeltrace2 object
- * of type `LibObjT` without managing any reference counting.
- *
- * This is an abstract base class for any libbabeltrace2 object wrapper.
- *
- * `LibObjT` is the direct libbabeltrace2 object type, for example
- * `bt_stream_class` or `const bt_value`.
- *
- * Methods of a derived class can call libObjPtr() to access the
- * libbabeltrace2 object pointer.
- */
-template <typename LibObjT>
-class BorrowedObj
-{
- static_assert(!std::is_pointer<LibObjT>::value, "`LibObjT` must not be a pointer");
-
- /*
- * This makes it possible for a `BorrowedObj<const bt_something>`
- * instance to get assigned an instance of
- * `BorrowedObj<bt_something>` ("copy" constructor and "assignment"
- * operator).
- *
- * C++ forbids the other way around.
- */
- template <typename>
- friend class BorrowedObj;
-
-private:
- /*
- * Provides `val` which indicates whether or not you can assign this
- * object from a borrowed object of type `OtherLibObjT`.
- */
- template <typename OtherLibObjT>
- struct _AssignableFromConst final
- {
- /*
- * If `LibObjT` is const (for example, `const bt_value`), then
- * you may always assign from its non-const equivalent (for
- * example, `bt_value`). In C (correct):
- *
- * bt_value * const meow = bt_value_bool_create_init(BT_TRUE);
- * const bt_value * const mix = meow;
- *
- * If `LibObjT` is non-const, then you may not assign from its
- * const equivalent. In C (not correct):
- *
- * const bt_value * const meow =
- * bt_value_array_borrow_element_by_index_const(some_val, 17);
- * bt_value * const mix = meow;
- */
- static constexpr bool val =
- std::is_const<LibObjT>::value || !std::is_const<OtherLibObjT>::value;
- };
-
-protected:
- /* libbabeltrace2 object pointer */
- using _LibObjPtr = LibObjT *;
-
- /* This complete borrowed object */
- using _ThisBorrowedObj = BorrowedObj<LibObjT>;
-
- /*
- * Builds a borrowed object to wrap the libbabeltrace2 object
- * pointer `libObjPtr`.
- *
- * `libObjPtr` must not be `nullptr`.
- */
- explicit BorrowedObj(const _LibObjPtr libObjPtr) noexcept : _mLibObjPtr {libObjPtr}
- {
- BT_ASSERT(libObjPtr);
- }
-
- /* Default copy operations */
- BorrowedObj(const BorrowedObj&) noexcept = default;
- BorrowedObj& operator=(const BorrowedObj&) noexcept = default;
-
- /*
- * Generic "copy" constructor.
- *
- * This converting constructor accepts both an instance of
- * `_ThisBorrowedObj` and an instance (`other`) of
- * `BorrowedObj<ConstLibObjT>`, where `ConstLibObjT` is the `const`
- * version of `LibObjT`, if applicable.
- *
- * This makes it possible for a `BorrowedObj<const bt_something>`
- * instance to be built from an instance of
- * `BorrowedObj<bt_something>`. C++ forbids the other way around.
- */
- template <typename OtherLibObjT>
- BorrowedObj(const BorrowedObj<OtherLibObjT>& other) noexcept : BorrowedObj {other._mLibObjPtr}
- {
- static_assert(_AssignableFromConst<OtherLibObjT>::val,
- "Don't assign a non-const wrapper from a const wrapper.");
- }
-
- /*
- * Generic "assignment" operator.
- *
- * This operator accepts both an instance of
- * `_ThisBorrowedObj` and an instance (`other`) of
- * `BorrowedObj<ConstLibObjT>`, where `ConstLibObjT` is the `const`
- * version of `LibObjT`, if applicable.
- *
- * This makes it possible for a `BorrowedObj<const bt_something>`
- * instance to get assigned an instance of
- * `BorrowedObj<bt_something>`. C++ forbids the other way around,
- * therefore we use `_EnableIfAssignableT` to show a more relevant
- * context in the compiler error message.
- */
- template <typename OtherLibObjT>
- _ThisBorrowedObj& operator=(const BorrowedObj<OtherLibObjT>& other) noexcept
- {
- static_assert(_AssignableFromConst<OtherLibObjT>::val,
- "Don't assign a non-const wrapper from a const wrapper.");
-
- _mLibObjPtr = other._mLibObjPtr;
- return *this;
- }
-
-public:
- /*
- * Returns a hash of this object, solely based on its raw libbabeltrace2
- * pointer.
- */
- std::size_t hash() const noexcept
- {
- return std::hash<_LibObjPtr> {}(_mLibObjPtr);
- }
-
- /*
- * Returns whether or not this object is the exact same as `other`,
- * solely based on the raw libbabeltrace2 pointers.
- */
- bool isSame(const _ThisBorrowedObj& other) const noexcept
- {
- return _mLibObjPtr == other._mLibObjPtr;
- }
-
- /* Wrapped libbabeltrace2 object pointer */
- _LibObjPtr libObjPtr() const noexcept
- {
- return _mLibObjPtr;
- }
-
-private:
- _LibObjPtr _mLibObjPtr;
-};
-
-} /* namespace internal */
-} /* namespace bt2 */
-
-#endif /* BABELTRACE_CPP_COMMON_BT2_INTERNAL_BORROWED_OBJ_HPP */
#include "cpp-common/bt2/trace-ir.hpp"
#include "cpp-common/optional.hpp"
-#include "internal/borrowed-obj.hpp"
+#include "borrowed-obj.hpp"
#include "internal/shared-obj.hpp"
#include "internal/utils.hpp"
};
template <typename LibObjT>
-class CommonMessage : public internal::BorrowedObj<LibObjT>
+class CommonMessage : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
protected:
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ThisCommonMessage = CommonMessage<LibObjT>;
public:
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
+#include "borrowed-obj.hpp"
#include "clock-class.hpp"
#include "field-class.hpp"
#include "field.hpp"
-#include "internal/borrowed-obj.hpp"
#include "internal/utils.hpp"
#include "value.hpp"
} /* namespace internal */
template <typename LibObjT>
-class CommonEvent final : public internal::BorrowedObj<LibObjT>
+class CommonEvent final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonEventSpec<const bt_event>;
using _Spec = internal::CommonEventSpec<LibObjT>;
} /* namespace internal */
template <typename LibObjT>
-class CommonPacket final : public internal::BorrowedObj<LibObjT>
+class CommonPacket final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonPacketSpec<const bt_packet>;
using _Spec = internal::CommonPacketSpec<LibObjT>;
using _ThisCommonPacket = CommonPacket<LibObjT>;
} /* namespace internal */
template <typename LibObjT>
-class CommonStream final : public internal::BorrowedObj<LibObjT>
+class CommonStream final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonStreamSpec<const bt_stream>;
using _Spec = internal::CommonStreamSpec<LibObjT>;
using _ThisCommonStream = CommonStream<LibObjT>;
} /* namespace internal */
template <typename LibObjT>
-class CommonTrace final : public internal::BorrowedObj<LibObjT>
+class CommonTrace final : public BorrowedObj<LibObjT>
{
/* Allow instantiate() to call `trace.libObjPtr()` */
friend class CommonStreamClass<bt_stream_class>;
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonTraceSpec<const bt_trace>;
using _Spec = internal::CommonTraceSpec<LibObjT>;
using _ThisCommonTrace = CommonTrace<LibObjT>;
} /* namespace internal */
template <typename LibObjT>
-class CommonEventClass final : public internal::BorrowedObj<LibObjT>
+class CommonEventClass final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonEventClassSpec<const bt_event_class>;
using _Spec = internal::CommonEventClassSpec<LibObjT>;
using _ThisCommonEventClass = CommonEventClass<LibObjT>;
} /* namespace internal */
template <typename LibObjT>
-class CommonStreamClass final : public internal::BorrowedObj<LibObjT>
+class CommonStreamClass final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonStreamClassSpec<const bt_stream_class>;
using _Spec = internal::CommonStreamClassSpec<LibObjT>;
using _ThisCommonStreamClass = CommonStreamClass<LibObjT>;
} /* namespace internal */
template <typename LibObjT>
-class CommonTraceClass final : public internal::BorrowedObj<LibObjT>
+class CommonTraceClass final : public BorrowedObj<LibObjT>
{
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonTraceClassSpec<const bt_trace_class>;
using _Spec = internal::CommonTraceClassSpec<LibObjT>;
using _ThisCommonTraceClass = CommonTraceClass<LibObjT>;
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
+#include "borrowed-obj.hpp"
#include "common-iter.hpp"
#include "exc.hpp"
-#include "internal/borrowed-obj.hpp"
#include "internal/shared-obj.hpp"
#include "internal/utils.hpp"
class CommonStream;
template <typename LibObjT>
-class CommonValue : public internal::BorrowedObj<LibObjT>
+class CommonValue : public BorrowedObj<LibObjT>
{
/* Allow append() to call `val.libObjPtr()` */
friend class CommonArrayValue<bt_value>;
friend class CommonValue<const bt_value>;
private:
- using typename internal::BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
protected:
- using typename internal::BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObj<LibObjT>::_LibObjPtr;
using _ThisCommonValue = CommonValue<LibObjT>;
public: