cpp-common: remove unused include
[babeltrace.git] / src / cpp-common / bt2 / clock-class.hpp
index 64e093f40004a7c6f33f0cd4c6f1b443854714a7..f8fc17e04cc727ef4848445738574819aa8061fa 100644 (file)
@@ -8,13 +8,13 @@
 #define BABELTRACE_CPP_COMMON_BT2_CLOCK_CLASS_HPP
 
 #include <cstdint>
-#include <string>
 #include <type_traits>
 
 #include <babeltrace2/babeltrace.h>
 
-#include "cpp-common/bt2c/uuid-view.hpp"
-#include "cpp-common/optional.hpp"
+#include "cpp-common/bt2c/c-string-view.hpp"
+#include "cpp-common/bt2c/uuid.hpp"
+#include "cpp-common/bt2s/optional.hpp"
 
 #include "borrowed-object.hpp"
 #include "exc.hpp"
@@ -91,13 +91,13 @@ class CommonClockClass final : public BorrowedObject<LibObjT>
 {
 private:
     using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
-    using typename BorrowedObject<LibObjT>::_LibObjPtr;
 
 public:
+    using typename BorrowedObject<LibObjT>::LibObjPtr;
     using Shared = SharedObject<CommonClockClass, LibObjT, internal::ClockClassRefFuncs>;
     using UserAttributes = internal::DepUserAttrs<LibObjT>;
 
-    explicit CommonClockClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
+    explicit CommonClockClass(const LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
     {
     }
 
@@ -172,7 +172,7 @@ public:
         return static_cast<bool>(bt_clock_class_origin_is_unix_epoch(this->libObjPtr()));
     }
 
-    void name(const char * const name) const
+    void name(const bt2c::CStringView name) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
 
@@ -183,17 +183,12 @@ public:
         }
     }
 
-    void name(const std::string& name) const
-    {
-        this->name(name.data());
-    }
-
-    const char *name() const noexcept
+    bt2c::CStringView name() const noexcept
     {
         return bt_clock_class_get_name(this->libObjPtr());
     }
 
-    void description(const char * const description) const
+    void description(const bt2c::CStringView description) const
     {
         static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstClockClass`.");
 
@@ -204,12 +199,7 @@ public:
         }
     }
 
-    void description(const std::string& description) const
-    {
-        this->description(description.data());
-    }
-
-    const char *description() const noexcept
+    bt2c::CStringView description() const noexcept
     {
         return bt_clock_class_get_description(this->libObjPtr());
     }
@@ -219,7 +209,7 @@ public:
         bt_clock_class_set_uuid(this->libObjPtr(), uuid);
     }
 
-    nonstd::optional<bt2c::UuidView> uuid() const noexcept
+    bt2s::optional<bt2c::UuidView> uuid() const noexcept
     {
         const auto uuid = bt_clock_class_get_uuid(this->libObjPtr());
 
@@ -227,7 +217,7 @@ public:
             return bt2c::UuidView {uuid};
         }
 
-        return nonstd::nullopt;
+        return bt2s::nullopt;
     }
 
     template <typename LibValT>
This page took 0.023906 seconds and 4 git commands to generate.