endif
noinst_HEADERS = \
- cpp-common/bt2/borrowed-obj.hpp \
+ cpp-common/bt2/borrowed-object.hpp \
cpp-common/bt2/clock-class.hpp \
cpp-common/bt2/clock-snapshot.hpp \
cpp-common/bt2/common-iter.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 */
--- /dev/null
+/*
+ * Copyright 2019-2020 (c) Philippe Proulx <pproulx@efficios.com>
+ *
+ * SPDX-License-Identifier: MIT
+ */
+
+#ifndef BABELTRACE_CPP_COMMON_BT2_BORROWED_OBJECT_HPP
+#define BABELTRACE_CPP_COMMON_BT2_BORROWED_OBJECT_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 BorrowedObject
+{
+ static_assert(!std::is_pointer<LibObjT>::value, "`LibObjT` must not be a pointer");
+
+ /*
+ * This makes it possible for a `BorrowedObject<const bt_something>`
+ * instance to get assigned an instance of
+ * `BorrowedObject<bt_something>` ("copy" constructor and
+ * "assignment" operator).
+ *
+ * C++ forbids the other way around.
+ */
+ template <typename>
+ friend class BorrowedObject;
+
+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 _ThisBorrowedObject = BorrowedObject<LibObjT>;
+
+ /*
+ * Builds a borrowed object to wrap the libbabeltrace2 object
+ * pointer `libObjPtr`.
+ *
+ * `libObjPtr` must not be `nullptr`.
+ */
+ explicit BorrowedObject(const _LibObjPtr libObjPtr) noexcept : _mLibObjPtr {libObjPtr}
+ {
+ BT_ASSERT(libObjPtr);
+ }
+
+ /* Default copy operations */
+ BorrowedObject(const BorrowedObject&) noexcept = default;
+ BorrowedObject& operator=(const BorrowedObject&) noexcept = default;
+
+ /*
+ * Generic "copy" constructor.
+ *
+ * This converting constructor accepts both an instance of
+ * `_ThisBorrowedObject` and an instance (`other`) of
+ * `BorrowedObject<ConstLibObjT>`, where `ConstLibObjT` is the
+ * `const` version of `LibObjT`, if applicable.
+ *
+ * This makes it possible for a `BorrowedObject<const bt_something>`
+ * instance to be built from an instance of
+ * `BorrowedObject<bt_something>`. C++ forbids the other way around.
+ */
+ template <typename OtherLibObjT>
+ BorrowedObject(const BorrowedObject<OtherLibObjT>& other) noexcept :
+ BorrowedObject {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
+ * `_ThisBorrowedObject` and an instance (`other`) of
+ * `BorrowedObject<ConstLibObjT>`, where `ConstLibObjT` is the
+ * `const` version of `LibObjT`, if applicable.
+ *
+ * This makes it possible for a `BorrowedObject<const bt_something>`
+ * instance to get assigned an instance of
+ * `BorrowedObject<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>
+ _ThisBorrowedObject& operator=(const BorrowedObject<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 _ThisBorrowedObject& 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_OBJECT_HPP */
#include "cpp-common/string_view.hpp"
#include "cpp-common/uuid-view.hpp"
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "exc.hpp"
#include "internal/shared-obj.hpp"
#include "internal/utils.hpp"
};
template <typename LibObjT>
-class CommonClockClass final : public BorrowedObj<LibObjT>
+class CommonClockClass final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ThisCommonClockClass = CommonClockClass<LibObjT>;
public:
using UserAttributes =
typename std::conditional<std::is_const<LibObjT>::value, ConstMapValue, MapValue>::type;
- explicit CommonClockClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonClockClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
CommonClockClass(const CommonClockClass<OtherLibObjT> clkClass) noexcept :
- _ThisBorrowedObj {clkClass}
+ _ThisBorrowedObject {clkClass}
{
}
template <typename OtherLibObjT>
_ThisCommonClockClass& operator=(const CommonClockClass<OtherLibObjT> clkClass) noexcept
{
- _ThisBorrowedObj::operator=(clkClass);
+ _ThisBorrowedObject::operator=(clkClass);
return *this;
}
#include <babeltrace2/babeltrace.h>
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "exc.hpp"
namespace bt2 {
-class ConstClockSnapshot final : public BorrowedObj<const bt_clock_snapshot>
+class ConstClockSnapshot final : public BorrowedObject<const bt_clock_snapshot>
{
public:
- explicit ConstClockSnapshot(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit ConstClockSnapshot(const _LibObjPtr libObjPtr) noexcept :
+ _ThisBorrowedObject {libObjPtr}
{
}
ConstClockSnapshot(const ConstClockSnapshot& clkSnapshot) noexcept :
- _ThisBorrowedObj {clkSnapshot}
+ _ThisBorrowedObject {clkSnapshot}
{
}
ConstClockSnapshot& operator=(const ConstClockSnapshot& clkSnapshot) noexcept
{
- _ThisBorrowedObj::operator=(clkSnapshot);
+ _ThisBorrowedObject::operator=(clkSnapshot);
return *this;
}
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "common-iter.hpp"
#include "exc.hpp"
#include "field-path.hpp"
};
template <typename LibObjT>
-class CommonFieldClass : public BorrowedObj<LibObjT>
+class CommonFieldClass : public BorrowedObject<LibObjT>
{
/* Allow appendMember() to call `fc.libObjPtr()` */
friend class CommonStructureFieldClass<bt_field_class>;
friend class CommonTraceClass<bt_trace_class>;
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
protected:
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ThisCommonFieldClass = CommonFieldClass<LibObjT>;
public:
using UserAttributes =
typename std::conditional<std::is_const<LibObjT>::value, ConstMapValue, MapValue>::type;
- explicit CommonFieldClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonFieldClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonFieldClass(const CommonFieldClass<OtherLibObjT> fc) noexcept : _ThisBorrowedObj {fc}
+ CommonFieldClass(const CommonFieldClass<OtherLibObjT> fc) noexcept : _ThisBorrowedObject {fc}
{
}
template <typename OtherLibObjT>
CommonFieldClass& operator=(const CommonFieldClass<OtherLibObjT> fc) noexcept
{
- _ThisBorrowedObj::operator=(fc);
+ _ThisBorrowedObject::operator=(fc);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class ConstEnumerationFieldClassMapping final : public BorrowedObj<LibObjT>
+class ConstEnumerationFieldClassMapping final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
public:
using RangeSet = typename std::conditional<
ConstUnsignedIntegerRangeSet, ConstSignedIntegerRangeSet>::type;
explicit ConstEnumerationFieldClassMapping(const _LibObjPtr libObjPtr) noexcept :
- _ThisBorrowedObj {libObjPtr}
+ _ThisBorrowedObject {libObjPtr}
{
}
ConstEnumerationFieldClassMapping(const ConstEnumerationFieldClassMapping& mapping) noexcept :
- _ThisBorrowedObj {mapping}
+ _ThisBorrowedObject {mapping}
{
}
ConstEnumerationFieldClassMapping&
operator=(const ConstEnumerationFieldClassMapping& mapping) noexcept
{
- _ThisBorrowedObj::operator=(mapping);
+ _ThisBorrowedObject::operator=(mapping);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonStructureFieldClassMember final : public BorrowedObj<LibObjT>
+class CommonStructureFieldClassMember final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
using _FieldClass =
typename std::conditional<std::is_const<LibObjT>::value, ConstFieldClass, FieldClass>::type;
typename std::conditional<std::is_const<LibObjT>::value, ConstMapValue, MapValue>::type;
explicit CommonStructureFieldClassMember(const _LibObjPtr libObjPtr) noexcept :
- _ThisBorrowedObj {libObjPtr}
+ _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
CommonStructureFieldClassMember(const CommonStructureFieldClassMember<OtherLibObjT> fc) noexcept
:
- _ThisBorrowedObj {fc}
+ _ThisBorrowedObject {fc}
{
}
CommonStructureFieldClassMember<LibObjT>&
operator=(const CommonStructureFieldClassMember<OtherLibObjT> fc) noexcept
{
- _ThisBorrowedObj::operator=(fc);
+ _ThisBorrowedObject::operator=(fc);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonVariantFieldClassOption : public BorrowedObj<LibObjT>
+class CommonVariantFieldClassOption : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _FieldClass =
typename std::conditional<std::is_const<LibObjT>::value, ConstFieldClass, FieldClass>::type;
typename std::conditional<std::is_const<LibObjT>::value, ConstMapValue, MapValue>::type;
explicit CommonVariantFieldClassOption(const _LibObjPtr libObjPtr) noexcept :
- _ThisBorrowedObj {libObjPtr}
+ _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
CommonVariantFieldClassOption(const CommonVariantFieldClassOption<OtherLibObjT> fc) noexcept :
- _ThisBorrowedObj {fc}
+ _ThisBorrowedObject {fc}
{
}
CommonVariantFieldClassOption&
operator=(const CommonVariantFieldClassOption<OtherLibObjT> fc) noexcept
{
- _ThisBorrowedObj::operator=(fc);
+ _ThisBorrowedObject::operator=(fc);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class ConstVariantWithIntegerSelectorFieldClassOption : public BorrowedObj<LibObjT>
+class ConstVariantWithIntegerSelectorFieldClassOption : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _Spec = internal::ConstVariantWithIntegerSelectorFieldClassOptionSpec<LibObjT>;
public:
ConstUnsignedIntegerRangeSet, ConstSignedIntegerRangeSet>::type;
explicit ConstVariantWithIntegerSelectorFieldClassOption(const _LibObjPtr libObjPtr) noexcept :
- _ThisBorrowedObj {libObjPtr}
+ _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
ConstVariantWithIntegerSelectorFieldClassOption(
const ConstVariantWithIntegerSelectorFieldClassOption<OtherLibObjT> fc) noexcept :
- _ThisBorrowedObj {fc}
+ _ThisBorrowedObject {fc}
{
}
ConstVariantWithIntegerSelectorFieldClassOption&
operator=(const ConstVariantWithIntegerSelectorFieldClassOption<OtherLibObjT> fc) noexcept
{
- _ThisBorrowedObj::operator=(fc);
+ _ThisBorrowedObject::operator=(fc);
return *this;
}
#include "common/assert.h"
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "common-iter.hpp"
#include "internal/shared-obj.hpp"
CURRENT_OPTION_CONTENT = BT_FIELD_PATH_ITEM_TYPE_CURRENT_OPTION_CONTENT,
};
-class ConstFieldPathItem : public BorrowedObj<const bt_field_path_item>
+class ConstFieldPathItem : public BorrowedObject<const bt_field_path_item>
{
public:
- explicit ConstFieldPathItem(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit ConstFieldPathItem(const _LibObjPtr libObjPtr) noexcept :
+ _ThisBorrowedObject {libObjPtr}
{
}
- ConstFieldPathItem(const ConstFieldPathItem& fpItem) noexcept : _ThisBorrowedObj {fpItem}
+ ConstFieldPathItem(const ConstFieldPathItem& fpItem) noexcept : _ThisBorrowedObject {fpItem}
{
}
ConstFieldPathItem& operator=(const ConstFieldPathItem& fpItem) noexcept
{
- _ThisBorrowedObj::operator=(fpItem);
+ _ThisBorrowedObject::operator=(fpItem);
return *this;
}
} /* namespace internal */
-class ConstFieldPath final : public BorrowedObj<const bt_field_path>
+class ConstFieldPath final : public BorrowedObject<const bt_field_path>
{
public:
using Shared =
EVENT_PAYLOAD = BT_FIELD_PATH_SCOPE_EVENT_PAYLOAD,
};
- explicit ConstFieldPath(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit ConstFieldPath(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
- ConstFieldPath(const ConstFieldPath& fieldPath) noexcept : _ThisBorrowedObj {fieldPath}
+ ConstFieldPath(const ConstFieldPath& fieldPath) noexcept : _ThisBorrowedObject {fieldPath}
{
}
ConstFieldPath& operator=(const ConstFieldPath& fieldPath) noexcept
{
- _ThisBorrowedObj::operator=(fieldPath);
+ _ThisBorrowedObject::operator=(fieldPath);
return *this;
}
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "field-class.hpp"
#include "internal/utils.hpp"
} /* namespace internal */
template <typename LibObjT>
-class CommonField : public BorrowedObj<LibObjT>
+class CommonField : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
protected:
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ThisCommonField = CommonField<LibObjT>;
public:
using Class =
typename std::conditional<std::is_const<LibObjT>::value, ConstFieldClass, FieldClass>::type;
- explicit CommonField(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonField(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonField(const CommonField<OtherLibObjT> val) noexcept : _ThisBorrowedObj {val}
+ CommonField(const CommonField<OtherLibObjT> val) noexcept : _ThisBorrowedObject {val}
{
}
template <typename OtherLibObjT>
_ThisCommonField& operator=(const CommonField<OtherLibObjT> val) noexcept
{
- _ThisBorrowedObj::operator=(val);
+ _ThisBorrowedObject::operator=(val);
return *this;
}
#include <babeltrace2/babeltrace.h>
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "common-iter.hpp"
#include "exc.hpp"
#include "integer-range.hpp"
class CommonTraceClass;
template <typename LibObjT>
-class CommonIntegerRangeSet final : public BorrowedObj<LibObjT>
+class CommonIntegerRangeSet final : public BorrowedObject<LibObjT>
{
/* Allow operator==() to call `other.libObjPtr()` */
friend class CommonIntegerRangeSet<bt_integer_range_set_unsigned>;
friend class CommonTraceClass<bt_trace_class>;
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstLibObjT = typename std::add_const<LibObjT>::type;
using _RefFuncs = internal::IntegerRangeSetRefFuncs<_ConstLibObjT>;
using _Spec = internal::CommonIntegerRangeSetSpec<_ConstLibObjT>;
using Iterator = CommonIterator<CommonIntegerRangeSet, Range>;
explicit CommonIntegerRangeSet(const _LibObjPtr libObjPtr) noexcept :
- _ThisBorrowedObj {libObjPtr}
+ _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
CommonIntegerRangeSet(const CommonIntegerRangeSet<OtherLibObjT> rangeSet) noexcept :
- _ThisBorrowedObj {rangeSet}
+ _ThisBorrowedObject {rangeSet}
{
}
_ThisCommonIntegerRangeSet&
operator=(const CommonIntegerRangeSet<OtherLibObjT> rangeSet) noexcept
{
- _ThisBorrowedObj::operator=(rangeSet);
+ _ThisBorrowedObject::operator=(rangeSet);
return *this;
}
#include <babeltrace2/babeltrace.h>
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
namespace bt2 {
} /* namespace internal */
template <typename LibObjT>
-class ConstIntegerRange final : public BorrowedObj<LibObjT>
+class ConstIntegerRange final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ThisConstIntegerRange = ConstIntegerRange<LibObjT>;
public:
std::uint64_t, std::int64_t>::type;
public:
- explicit ConstIntegerRange(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit ConstIntegerRange(const _LibObjPtr libObjPtr) noexcept :
+ _ThisBorrowedObject {libObjPtr}
{
}
- ConstIntegerRange(const _ThisConstIntegerRange& range) noexcept : _ThisBorrowedObj {range}
+ ConstIntegerRange(const _ThisConstIntegerRange& range) noexcept : _ThisBorrowedObject {range}
{
}
_ThisConstIntegerRange& operator=(const _ThisConstIntegerRange& range) noexcept
{
- _ThisBorrowedObj::operator=(range);
+ _ThisBorrowedObject::operator=(range);
return *this;
}
#include "cpp-common/bt2/trace-ir.hpp"
#include "cpp-common/optional.hpp"
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "internal/shared-obj.hpp"
#include "internal/utils.hpp"
};
template <typename LibObjT>
-class CommonMessage : public BorrowedObj<LibObjT>
+class CommonMessage : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
protected:
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ThisCommonMessage = CommonMessage<LibObjT>;
public:
using Shared = internal::SharedMessage<CommonMessage<LibObjT>, LibObjT>;
- explicit CommonMessage(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonMessage(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonMessage(const CommonMessage<OtherLibObjT> val) noexcept : _ThisBorrowedObj {val}
+ CommonMessage(const CommonMessage<OtherLibObjT> val) noexcept : _ThisBorrowedObject {val}
{
}
template <typename OtherLibObjT>
_ThisCommonMessage& operator=(const CommonMessage<OtherLibObjT> val) noexcept
{
- _ThisBorrowedObj::operator=(val);
+ _ThisBorrowedObject::operator=(val);
return *this;
}
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "clock-class.hpp"
#include "field-class.hpp"
#include "field.hpp"
} /* namespace internal */
template <typename LibObjT>
-class CommonEvent final : public BorrowedObj<LibObjT>
+class CommonEvent final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonEventSpec<const bt_event>;
using _Spec = internal::CommonEventSpec<LibObjT>;
CommonEventClass<const bt_event_class>,
CommonEventClass<bt_event_class>>::type;
- explicit CommonEvent(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonEvent(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonEvent(const CommonEvent<OtherLibObjT> event) noexcept : _ThisBorrowedObj {event}
+ CommonEvent(const CommonEvent<OtherLibObjT> event) noexcept : _ThisBorrowedObject {event}
{
}
template <typename OtherLibObjT>
CommonEvent<LibObjT>& operator=(const CommonEvent<OtherLibObjT> event) noexcept
{
- _ThisBorrowedObj::operator=(event);
+ _ThisBorrowedObject::operator=(event);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonPacket final : public BorrowedObj<LibObjT>
+class CommonPacket final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonPacketSpec<const bt_packet>;
using _Spec = internal::CommonPacketSpec<LibObjT>;
using _ThisCommonPacket = CommonPacket<LibObjT>;
public:
using Shared = internal::SharedObj<_ThisCommonPacket, LibObjT, internal::PacketRefFuncs>;
- explicit CommonPacket(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonPacket(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonPacket(const CommonPacket<OtherLibObjT> packet) noexcept : _ThisBorrowedObj {packet}
+ CommonPacket(const CommonPacket<OtherLibObjT> packet) noexcept : _ThisBorrowedObject {packet}
{
}
template <typename OtherLibObjT>
_ThisCommonPacket& operator=(const CommonPacket<OtherLibObjT> packet) noexcept
{
- _ThisBorrowedObj::operator=(packet);
+ _ThisBorrowedObject::operator=(packet);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonStream final : public BorrowedObj<LibObjT>
+class CommonStream final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonStreamSpec<const bt_stream>;
using _Spec = internal::CommonStreamSpec<LibObjT>;
using _ThisCommonStream = CommonStream<LibObjT>;
using UserAttributes =
typename std::conditional<std::is_const<LibObjT>::value, ConstMapValue, MapValue>::type;
- explicit CommonStream(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonStream(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonStream(const CommonStream<OtherLibObjT> stream) noexcept : _ThisBorrowedObj {stream}
+ CommonStream(const CommonStream<OtherLibObjT> stream) noexcept : _ThisBorrowedObject {stream}
{
}
template <typename OtherLibObjT>
_ThisCommonStream& operator=(const CommonStream<OtherLibObjT> stream) noexcept
{
- _ThisBorrowedObj::operator=(stream);
+ _ThisBorrowedObject::operator=(stream);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonTrace final : public BorrowedObj<LibObjT>
+class CommonTrace final : public BorrowedObject<LibObjT>
{
/* Allow instantiate() to call `trace.libObjPtr()` */
friend class CommonStreamClass<bt_stream_class>;
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonTraceSpec<const bt_trace>;
using _Spec = internal::CommonTraceSpec<LibObjT>;
using _ThisCommonTrace = CommonTrace<LibObjT>;
ConstValue value;
};
- explicit CommonTrace(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonTrace(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonTrace(const CommonTrace<OtherLibObjT> trace) noexcept : _ThisBorrowedObj {trace}
+ CommonTrace(const CommonTrace<OtherLibObjT> trace) noexcept : _ThisBorrowedObject {trace}
{
}
template <typename OtherLibObjT>
_ThisCommonTrace& operator=(const CommonTrace<OtherLibObjT> trace) noexcept
{
- _ThisBorrowedObj::operator=(trace);
+ _ThisBorrowedObject::operator=(trace);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonEventClass final : public BorrowedObj<LibObjT>
+class CommonEventClass final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonEventClassSpec<const bt_event_class>;
using _Spec = internal::CommonEventClassSpec<LibObjT>;
using _ThisCommonEventClass = CommonEventClass<LibObjT>;
DEBUG = BT_EVENT_CLASS_LOG_LEVEL_DEBUG,
};
- explicit CommonEventClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonEventClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
CommonEventClass(const CommonEventClass<OtherLibObjT> eventClass) noexcept :
- _ThisBorrowedObj {eventClass}
+ _ThisBorrowedObject {eventClass}
{
}
template <typename OtherLibObjT>
_ThisCommonEventClass& operator=(const CommonEventClass<OtherLibObjT> eventClass) noexcept
{
- _ThisBorrowedObj::operator=(eventClass);
+ _ThisBorrowedObject::operator=(eventClass);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonStreamClass final : public BorrowedObj<LibObjT>
+class CommonStreamClass final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonStreamClassSpec<const bt_stream_class>;
using _Spec = internal::CommonStreamClassSpec<LibObjT>;
using _ThisCommonStreamClass = CommonStreamClass<LibObjT>;
using UserAttributes =
typename std::conditional<std::is_const<LibObjT>::value, ConstMapValue, MapValue>::type;
- explicit CommonStreamClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonStreamClass(const _LibObjPtr libObjPtr) noexcept :
+ _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
CommonStreamClass(const CommonStreamClass<OtherLibObjT> streamClass) noexcept :
- _ThisBorrowedObj {streamClass}
+ _ThisBorrowedObject {streamClass}
{
}
template <typename OtherLibObjT>
_ThisCommonStreamClass& operator=(const CommonStreamClass<OtherLibObjT> streamClass) noexcept
{
- _ThisBorrowedObj::operator=(streamClass);
+ _ThisBorrowedObject::operator=(streamClass);
return *this;
}
} /* namespace internal */
template <typename LibObjT>
-class CommonTraceClass final : public BorrowedObj<LibObjT>
+class CommonTraceClass final : public BorrowedObject<LibObjT>
{
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ConstSpec = internal::CommonTraceClassSpec<const bt_trace_class>;
using _Spec = internal::CommonTraceClassSpec<LibObjT>;
using _ThisCommonTraceClass = CommonTraceClass<LibObjT>;
using UserAttributes =
typename std::conditional<std::is_const<LibObjT>::value, ConstMapValue, MapValue>::type;
- explicit CommonTraceClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonTraceClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
CommonTraceClass(const CommonTraceClass<OtherLibObjT> traceClass) noexcept :
- _ThisBorrowedObj {traceClass}
+ _ThisBorrowedObject {traceClass}
{
}
template <typename OtherLibObjT>
_ThisCommonTraceClass& operator=(const CommonTraceClass<OtherLibObjT> traceClass) noexcept
{
- _ThisBorrowedObj::operator=(traceClass);
+ _ThisBorrowedObject::operator=(traceClass);
return *this;
}
#include "cpp-common/optional.hpp"
#include "cpp-common/string_view.hpp"
-#include "borrowed-obj.hpp"
+#include "borrowed-object.hpp"
#include "common-iter.hpp"
#include "exc.hpp"
#include "internal/shared-obj.hpp"
class CommonStream;
template <typename LibObjT>
-class CommonValue : public BorrowedObj<LibObjT>
+class CommonValue : public BorrowedObject<LibObjT>
{
/* Allow append() to call `val.libObjPtr()` */
friend class CommonArrayValue<bt_value>;
friend class CommonValue<const bt_value>;
private:
- using typename BorrowedObj<LibObjT>::_ThisBorrowedObj;
+ using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
protected:
- using typename BorrowedObj<LibObjT>::_LibObjPtr;
+ using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _ThisCommonValue = CommonValue<LibObjT>;
public:
using Shared = internal::SharedValue<CommonValue<LibObjT>, LibObjT>;
- explicit CommonValue(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObj {libObjPtr}
+ explicit CommonValue(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- CommonValue(const CommonValue<OtherLibObjT> val) noexcept : _ThisBorrowedObj {val}
+ CommonValue(const CommonValue<OtherLibObjT> val) noexcept : _ThisBorrowedObject {val}
{
}
template <typename OtherLibObjT>
_ThisCommonValue& operator=(const CommonValue<OtherLibObjT> val) noexcept
{
- _ThisBorrowedObj::operator=(val);
+ _ThisBorrowedObject::operator=(val);
return *this;
}