From 094bf3f24c790995348235921f3c26d94b7f4f19 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Mon, 11 Dec 2023 16:05:13 -0500 Subject: [PATCH] cpp-common: rename `bt2_common` namespace -> `bt2c` I always end up using the `bt2c` namespace alias in `*.cpp` files anyway. Also put all the `bt2c` stuff in `cpp-common/bt2c` to make it clear. What remains in `cpp-common`, but outside `cpp-common/bt2c`, are the libbabeltrace2 C++ bindings (`bt2` namespace) and external projects. Signed-off-by: Philippe Proulx Change-Id: Ife8527aa961025f28d06707eb9f374cafea572f5 Reviewed-on: https://review.lttng.org/c/babeltrace/+/11390 Reviewed-by: Simon Marchi CI-Build: Simon Marchi Tested-by: jenkins --- src/Makefile.am | 33 ++++++++++--------- src/cpp-common/bt2/clock-class.hpp | 6 ++-- src/cpp-common/bt2/exc.hpp | 10 +++--- src/cpp-common/bt2/trace-ir.hpp | 6 ++-- src/cpp-common/{ => bt2c}/align.hpp | 10 +++--- src/cpp-common/{ => bt2c}/endian.hpp | 10 +++--- src/cpp-common/{ => bt2c}/exc.hpp | 10 +++--- src/cpp-common/{ => bt2c}/glib-up.hpp | 10 +++--- src/cpp-common/{ => bt2c}/lib-str.hpp | 12 +++---- src/cpp-common/{ => bt2c}/libc-up.hpp | 10 +++--- src/cpp-common/{ => bt2c}/make-unique.hpp | 10 +++--- .../{ => bt2c}/read-fixed-len-int.hpp | 16 ++++----- src/cpp-common/{ => bt2c}/safe-ops.hpp | 10 +++--- src/cpp-common/{ => bt2c}/std-int.hpp | 10 +++--- src/cpp-common/{ => bt2c}/uuid-view.cpp | 4 +-- src/cpp-common/{ => bt2c}/uuid-view.hpp | 10 +++--- src/cpp-common/{ => bt2c}/uuid.hpp | 10 +++--- src/cpp-common/{ => bt2c}/vector.hpp | 4 +-- 18 files changed, 96 insertions(+), 95 deletions(-) rename src/cpp-common/{ => bt2c}/align.hpp (68%) rename src/cpp-common/{ => bt2c}/endian.hpp (93%) rename src/cpp-common/{ => bt2c}/exc.hpp (84%) rename src/cpp-common/{ => bt2c}/glib-up.hpp (85%) rename src/cpp-common/{ => bt2c}/lib-str.hpp (51%) rename src/cpp-common/{ => bt2c}/libc-up.hpp (65%) rename src/cpp-common/{ => bt2c}/make-unique.hpp (70%) rename src/cpp-common/{ => bt2c}/read-fixed-len-int.hpp (71%) rename src/cpp-common/{ => bt2c}/safe-ops.hpp (87%) rename src/cpp-common/{ => bt2c}/std-int.hpp (86%) rename src/cpp-common/{ => bt2c}/uuid-view.cpp (85%) rename src/cpp-common/{ => bt2c}/uuid-view.hpp (91%) rename src/cpp-common/{ => bt2c}/uuid.hpp (94%) rename src/cpp-common/{ => bt2c}/vector.hpp (93%) diff --git a/src/Makefile.am b/src/Makefile.am index 02b5a173..b5d24fe1 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -20,10 +20,10 @@ noinst_HEADERS = \ cpp-common/bt2/component-port.hpp \ cpp-common/bt2/exc.hpp \ cpp-common/bt2/field-class.hpp \ - cpp-common/bt2/field.hpp \ cpp-common/bt2/field-path.hpp \ - cpp-common/bt2/integer-range.hpp \ + cpp-common/bt2/field.hpp \ cpp-common/bt2/integer-range-set.hpp \ + cpp-common/bt2/integer-range.hpp \ cpp-common/bt2/internal/utils.hpp \ cpp-common/bt2/logging.hpp \ cpp-common/bt2/message-array.hpp \ @@ -36,26 +36,27 @@ noinst_HEADERS = \ cpp-common/bt2/self-component-port.hpp \ cpp-common/bt2/self-message-iterator-configuration.hpp \ cpp-common/bt2/self-message-iterator.hpp \ + cpp-common/bt2/shared-object.hpp \ cpp-common/bt2/trace-ir.hpp \ cpp-common/bt2/type-traits.hpp \ cpp-common/bt2/value.hpp \ cpp-common/bt2/wrap.hpp \ - cpp-common/align.hpp \ - cpp-common/endian.hpp \ - cpp-common/exc.hpp \ - cpp-common/glib-up.hpp \ - cpp-common/libc-up.hpp \ - cpp-common/lib-str.hpp \ - cpp-common/make-unique.hpp \ + cpp-common/bt2c/align.hpp \ + cpp-common/bt2c/endian.hpp \ + cpp-common/bt2c/exc.hpp \ + cpp-common/bt2c/glib-up.hpp \ + cpp-common/bt2c/lib-str.hpp \ + cpp-common/bt2c/libc-up.hpp \ + cpp-common/bt2c/make-unique.hpp \ + cpp-common/bt2c/read-fixed-len-int.hpp \ + cpp-common/bt2c/safe-ops.hpp \ + cpp-common/bt2c/std-int.hpp \ + cpp-common/bt2c/uuid-view.hpp \ + cpp-common/bt2c/uuid.hpp \ + cpp-common/bt2c/vector.hpp \ cpp-common/nlohmann/json.hpp \ cpp-common/optional.hpp \ - cpp-common/read-fixed-len-int.hpp \ - cpp-common/safe-ops.hpp \ - cpp-common/std-int.hpp \ - cpp-common/string_view.hpp \ - cpp-common/uuid.hpp \ - cpp-common/uuid-view.hpp \ - cpp-common/vector.hpp + cpp-common/string_view.hpp ## This target generates an include file that contains the git version ## string of the current branch, it must be continuously updated when diff --git a/src/cpp-common/bt2/clock-class.hpp b/src/cpp-common/bt2/clock-class.hpp index 72064f84..64e093f4 100644 --- a/src/cpp-common/bt2/clock-class.hpp +++ b/src/cpp-common/bt2/clock-class.hpp @@ -13,8 +13,8 @@ #include +#include "cpp-common/bt2c/uuid-view.hpp" #include "cpp-common/optional.hpp" -#include "cpp-common/uuid-view.hpp" #include "borrowed-object.hpp" #include "exc.hpp" @@ -219,12 +219,12 @@ public: bt_clock_class_set_uuid(this->libObjPtr(), uuid); } - nonstd::optional uuid() const noexcept + nonstd::optional uuid() const noexcept { const auto uuid = bt_clock_class_get_uuid(this->libObjPtr()); if (uuid) { - return bt2_common::UuidView {uuid}; + return bt2c::UuidView {uuid}; } return nonstd::nullopt; diff --git a/src/cpp-common/bt2/exc.hpp b/src/cpp-common/bt2/exc.hpp index 71997c3e..723368c6 100644 --- a/src/cpp-common/bt2/exc.hpp +++ b/src/cpp-common/bt2/exc.hpp @@ -7,14 +7,14 @@ #ifndef BABELTRACE_CPP_COMMON_BT2_EXC_HPP #define BABELTRACE_CPP_COMMON_BT2_EXC_HPP -#include "cpp-common/exc.hpp" +#include "cpp-common/bt2c/exc.hpp" namespace bt2 { -using Error = bt2_common::Error; -using OverflowError = bt2_common::OverflowError; -using MemoryError = bt2_common::MemoryError; -using TryAgain = bt2_common::TryAgain; +using Error = bt2c::Error; +using OverflowError = bt2c::OverflowError; +using MemoryError = bt2c::MemoryError; +using TryAgain = bt2c::TryAgain; } /* namespace bt2 */ diff --git a/src/cpp-common/bt2/trace-ir.hpp b/src/cpp-common/bt2/trace-ir.hpp index b6f349be..9df6abbf 100644 --- a/src/cpp-common/bt2/trace-ir.hpp +++ b/src/cpp-common/bt2/trace-ir.hpp @@ -685,17 +685,17 @@ public: return bt_trace_get_name(this->libObjPtr()); } - void uuid(const bt2_common::UuidView& uuid) const noexcept + void uuid(const bt2c::UuidView& uuid) const noexcept { bt_trace_set_uuid(this->libObjPtr(), uuid.begin()); } - nonstd::optional uuid() const noexcept + nonstd::optional uuid() const noexcept { const auto uuid = bt_trace_get_uuid(this->libObjPtr()); if (uuid) { - return bt2_common::UuidView {uuid}; + return bt2c::UuidView {uuid}; } return nonstd::nullopt; diff --git a/src/cpp-common/align.hpp b/src/cpp-common/bt2c/align.hpp similarity index 68% rename from src/cpp-common/align.hpp rename to src/cpp-common/bt2c/align.hpp index 3a036c88..ef443aa3 100644 --- a/src/cpp-common/align.hpp +++ b/src/cpp-common/bt2c/align.hpp @@ -4,14 +4,14 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_ALIGN_HPP -#define BABELTRACE_CPP_COMMON_ALIGN_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_ALIGN_HPP +#define BABELTRACE_CPP_COMMON_BT2C_ALIGN_HPP #include #include "common/align.h" -namespace bt2_common { +namespace bt2c { template ValT align(const ValT val, const AlignT align) noexcept @@ -20,6 +20,6 @@ ValT align(const ValT val, const AlignT align) noexcept return BT_ALIGN(val, static_cast(align)); } -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_ALIGN_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_ALIGN_HPP */ diff --git a/src/cpp-common/endian.hpp b/src/cpp-common/bt2c/endian.hpp similarity index 93% rename from src/cpp-common/endian.hpp rename to src/cpp-common/bt2c/endian.hpp index a31e31ab..4d315b26 100644 --- a/src/cpp-common/endian.hpp +++ b/src/cpp-common/bt2c/endian.hpp @@ -4,14 +4,14 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_ENDIAN_HPP -#define BABELTRACE_CPP_COMMON_ENDIAN_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_ENDIAN_HPP +#define BABELTRACE_CPP_COMMON_BT2C_ENDIAN_HPP #include #include "compat/endian.h" /* IWYU pragma: keep */ -namespace bt2_common { +namespace bt2c { static inline std::uint8_t littleEndianToNative(const std::uint8_t val) noexcept { @@ -93,6 +93,6 @@ static inline std::int64_t bigEndianToNative(const std::int64_t val) noexcept return static_cast(bigEndianToNative(static_cast(val))); } -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_ENDIAN_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_ENDIAN_HPP */ diff --git a/src/cpp-common/exc.hpp b/src/cpp-common/bt2c/exc.hpp similarity index 84% rename from src/cpp-common/exc.hpp rename to src/cpp-common/bt2c/exc.hpp index 09da6bec..3138fdbc 100644 --- a/src/cpp-common/exc.hpp +++ b/src/cpp-common/bt2c/exc.hpp @@ -4,15 +4,15 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_EXC_HPP -#define BABELTRACE_CPP_COMMON_EXC_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_EXC_HPP +#define BABELTRACE_CPP_COMMON_BT2C_EXC_HPP #include #include #include #include -namespace bt2_common { +namespace bt2c { /* * End of iteration. @@ -69,6 +69,6 @@ public: } }; -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_EXC_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_EXC_HPP */ diff --git a/src/cpp-common/glib-up.hpp b/src/cpp-common/bt2c/glib-up.hpp similarity index 85% rename from src/cpp-common/glib-up.hpp rename to src/cpp-common/bt2c/glib-up.hpp index 33e04a9d..bfe2eadc 100644 --- a/src/cpp-common/glib-up.hpp +++ b/src/cpp-common/bt2c/glib-up.hpp @@ -4,14 +4,14 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_GLIB_UP_HPP -#define BABELTRACE_CPP_COMMON_GLIB_UP_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_GLIB_UP_HPP +#define BABELTRACE_CPP_COMMON_BT2C_GLIB_UP_HPP #include #include -namespace bt2_common { +namespace bt2c { namespace internal { struct GCharDeleter final @@ -68,6 +68,6 @@ struct GMappedFileDeleter final using GMappedFileUP = std::unique_ptr; -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_GLIB_UP_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_GLIB_UP_HPP */ diff --git a/src/cpp-common/lib-str.hpp b/src/cpp-common/bt2c/lib-str.hpp similarity index 51% rename from src/cpp-common/lib-str.hpp rename to src/cpp-common/bt2c/lib-str.hpp index fbd5401f..815f105f 100644 --- a/src/cpp-common/lib-str.hpp +++ b/src/cpp-common/bt2c/lib-str.hpp @@ -4,18 +4,18 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_LIB_STR_HPP -#define BABELTRACE_CPP_COMMON_LIB_STR_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_LIB_STR_HPP +#define BABELTRACE_CPP_COMMON_BT2C_LIB_STR_HPP -#include "bt2/message.hpp" +#include "cpp-common/bt2/message.hpp" -namespace bt2_common { +namespace bt2c { static inline const char *messageTypeStr(const bt2::MessageType type) { return bt_common_message_type_string(static_cast(type)); } -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_LIB_STR_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_LIB_STR_HPP */ diff --git a/src/cpp-common/libc-up.hpp b/src/cpp-common/bt2c/libc-up.hpp similarity index 65% rename from src/cpp-common/libc-up.hpp rename to src/cpp-common/bt2c/libc-up.hpp index c53a39a5..fa7468f2 100644 --- a/src/cpp-common/libc-up.hpp +++ b/src/cpp-common/bt2c/libc-up.hpp @@ -4,13 +4,13 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_LIBC_UP_HPP -#define BABELTRACE_CPP_COMMON_LIBC_UP_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_LIBC_UP_HPP +#define BABELTRACE_CPP_COMMON_BT2C_LIBC_UP_HPP #include #include -namespace bt2_common { +namespace bt2c { namespace internal { struct FileCloserDeleter @@ -25,6 +25,6 @@ struct FileCloserDeleter using FileUP = std::unique_ptr; -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_LIBC_UP_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_LIBC_UP_HPP */ diff --git a/src/cpp-common/make-unique.hpp b/src/cpp-common/bt2c/make-unique.hpp similarity index 70% rename from src/cpp-common/make-unique.hpp rename to src/cpp-common/bt2c/make-unique.hpp index 12e85f44..95f55340 100644 --- a/src/cpp-common/make-unique.hpp +++ b/src/cpp-common/bt2c/make-unique.hpp @@ -4,14 +4,14 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_MAKE_UNIQUE_HPP -#define BABELTRACE_CPP_COMMON_MAKE_UNIQUE_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_MAKE_UNIQUE_HPP +#define BABELTRACE_CPP_COMMON_BT2C_MAKE_UNIQUE_HPP #include #include #include -namespace bt2_common { +namespace bt2c { /* * Our implementation of std::make_unique<>() for C++11. @@ -24,6 +24,6 @@ std::unique_ptr makeUnique(ArgTs&&...args) return std::unique_ptr(new T {std::forward(args)...}); } -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_MAKE_UNIQUE_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_MAKE_UNIQUE_HPP */ diff --git a/src/cpp-common/read-fixed-len-int.hpp b/src/cpp-common/bt2c/read-fixed-len-int.hpp similarity index 71% rename from src/cpp-common/read-fixed-len-int.hpp rename to src/cpp-common/bt2c/read-fixed-len-int.hpp index 07481f21..93d85039 100644 --- a/src/cpp-common/read-fixed-len-int.hpp +++ b/src/cpp-common/bt2c/read-fixed-len-int.hpp @@ -4,16 +4,16 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_READ_FIXED_LEN_INT_HPP -#define BABELTRACE_CPP_COMMON_READ_FIXED_LEN_INT_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_READ_FIXED_LEN_INT_HPP +#define BABELTRACE_CPP_COMMON_BT2C_READ_FIXED_LEN_INT_HPP #include #include #include -#include "cpp-common/endian.hpp" +#include "endian.hpp" -namespace bt2_common { +namespace bt2c { /* * Reads a fixed-length integer of unknown byte order into a value of integral @@ -37,7 +37,7 @@ IntT readFixedLenInt(const std::uint8_t * const buf) template IntT readFixedLenIntLe(const std::uint8_t * const buf) { - return bt2_common::littleEndianToNative(readFixedLenInt(buf)); + return bt2c::littleEndianToNative(readFixedLenInt(buf)); } /* @@ -47,9 +47,9 @@ IntT readFixedLenIntLe(const std::uint8_t * const buf) template IntT readFixedLenIntBe(const std::uint8_t * const buf) { - return bt2_common::bigEndianToNative(readFixedLenInt(buf)); + return bt2c::bigEndianToNative(readFixedLenInt(buf)); } -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_READ_FIXED_LEN_INT_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_READ_FIXED_LEN_INT_HPP */ diff --git a/src/cpp-common/safe-ops.hpp b/src/cpp-common/bt2c/safe-ops.hpp similarity index 87% rename from src/cpp-common/safe-ops.hpp rename to src/cpp-common/bt2c/safe-ops.hpp index 90dae882..e1d66012 100644 --- a/src/cpp-common/safe-ops.hpp +++ b/src/cpp-common/bt2c/safe-ops.hpp @@ -4,15 +4,15 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_SAFE_OPS_HPP -#define BABELTRACE_CPP_COMMON_SAFE_OPS_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_SAFE_OPS_HPP +#define BABELTRACE_CPP_COMMON_BT2C_SAFE_OPS_HPP #include #include #include "common/assert.h" -namespace bt2_common { +namespace bt2c { template constexpr bool safeToMul(const T a, const T b) @@ -65,6 +65,6 @@ T safeSub(const T a, const T b) noexcept return a - b; } -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_SAFE_OPS_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_SAFE_OPS_HPP */ diff --git a/src/cpp-common/std-int.hpp b/src/cpp-common/bt2c/std-int.hpp similarity index 86% rename from src/cpp-common/std-int.hpp rename to src/cpp-common/bt2c/std-int.hpp index 2bdb4ec7..2fe35353 100644 --- a/src/cpp-common/std-int.hpp +++ b/src/cpp-common/bt2c/std-int.hpp @@ -4,12 +4,12 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_STD_INT_HPP -#define BABELTRACE_CPP_COMMON_STD_INT_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_STD_INT_HPP +#define BABELTRACE_CPP_COMMON_BT2C_STD_INT_HPP #include -namespace bt2_common { +namespace bt2c { namespace internal { template @@ -76,6 +76,6 @@ struct StdIntTBase<64, false> template using StdIntT = typename internal::StdIntTBase::Type; -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_STD_INT_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_STD_INT_HPP */ diff --git a/src/cpp-common/uuid-view.cpp b/src/cpp-common/bt2c/uuid-view.cpp similarity index 85% rename from src/cpp-common/uuid-view.cpp rename to src/cpp-common/bt2c/uuid-view.cpp index 57392304..2d784a56 100644 --- a/src/cpp-common/uuid-view.cpp +++ b/src/cpp-common/bt2c/uuid-view.cpp @@ -7,7 +7,7 @@ #include "uuid-view.hpp" #include "uuid.hpp" -namespace bt2_common { +namespace bt2c { UuidView::UuidView(const Uuid& uuid) noexcept : _mUuid {uuid.data()} { @@ -18,4 +18,4 @@ UuidView::operator Uuid() const noexcept return Uuid {*this}; } -} /* namespace bt2_common */ +} /* namespace bt2c */ diff --git a/src/cpp-common/uuid-view.hpp b/src/cpp-common/bt2c/uuid-view.hpp similarity index 91% rename from src/cpp-common/uuid-view.hpp rename to src/cpp-common/bt2c/uuid-view.hpp index d719d877..a87388ab 100644 --- a/src/cpp-common/uuid-view.hpp +++ b/src/cpp-common/bt2c/uuid-view.hpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_UUID_VIEW_HPP -#define BABELTRACE_CPP_COMMON_UUID_VIEW_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_UUID_VIEW_HPP +#define BABELTRACE_CPP_COMMON_BT2C_UUID_VIEW_HPP #include #include @@ -14,7 +14,7 @@ #include "common/assert.h" #include "common/uuid.h" -namespace bt2_common { +namespace bt2c { class Uuid; @@ -109,6 +109,6 @@ private: const Val *_mUuid; }; -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_UUID_VIEW_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_UUID_VIEW_HPP */ diff --git a/src/cpp-common/uuid.hpp b/src/cpp-common/bt2c/uuid.hpp similarity index 94% rename from src/cpp-common/uuid.hpp rename to src/cpp-common/bt2c/uuid.hpp index 13c3cb91..86d1217f 100644 --- a/src/cpp-common/uuid.hpp +++ b/src/cpp-common/bt2c/uuid.hpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: MIT */ -#ifndef BABELTRACE_CPP_COMMON_UUID_HPP -#define BABELTRACE_CPP_COMMON_UUID_HPP +#ifndef BABELTRACE_CPP_COMMON_BT2C_UUID_HPP +#define BABELTRACE_CPP_COMMON_BT2C_UUID_HPP #include #include @@ -16,7 +16,7 @@ #include "uuid-view.hpp" -namespace bt2_common { +namespace bt2c { /* * A universally unique identifier. @@ -149,6 +149,6 @@ private: std::array _mUuid = {}; }; -} /* namespace bt2_common */ +} /* namespace bt2c */ -#endif /* BABELTRACE_CPP_COMMON_UUID_HPP */ +#endif /* BABELTRACE_CPP_COMMON_BT2C_UUID_HPP */ diff --git a/src/cpp-common/vector.hpp b/src/cpp-common/bt2c/vector.hpp similarity index 93% rename from src/cpp-common/vector.hpp rename to src/cpp-common/bt2c/vector.hpp index 2d6b6cbe..516a8263 100644 --- a/src/cpp-common/vector.hpp +++ b/src/cpp-common/bt2c/vector.hpp @@ -11,7 +11,7 @@ #include "common/assert.h" -namespace bt2_common { +namespace bt2c { /* * Moves the last entry of `vec` to the index `idx`, then removes the last entry. @@ -32,6 +32,6 @@ void vectorFastRemove(std::vector& vec, vec.pop_back(); } -} /* namespace bt2_common */ +} /* namespace bt2c */ #endif /* SRC_CPP_COMMON_VECTOR_HPP */ -- 2.34.1