#include <babeltrace2/babeltrace.h>
#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
#include "borrowed-object.hpp"
#include "clock-class.hpp"
}
template <typename OtherLibObjT>
- CommonEvent<LibObjT>& operator=(const CommonEvent<OtherLibObjT> event) noexcept
+ CommonEvent<LibObjT> operator=(const CommonEvent<OtherLibObjT> event) noexcept
{
_ThisBorrowedObject::operator=(event);
return *this;
using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _Spec = internal::CommonPacketSpec<LibObjT>;
- using _ThisCommonPacket = CommonPacket<LibObjT>;
using _Stream = internal::DepStream<LibObjT>;
using _StructureField = internal::DepStructField<LibObjT>;
public:
- using Shared = SharedObject<_ThisCommonPacket, LibObjT, internal::PacketRefFuncs>;
+ using Shared = SharedObject<CommonPacket, LibObjT, internal::PacketRefFuncs>;
explicit CommonPacket(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
template <typename OtherLibObjT>
- _ThisCommonPacket& operator=(const CommonPacket<OtherLibObjT> packet) noexcept
+ CommonPacket operator=(const CommonPacket<OtherLibObjT> packet) noexcept
{
_ThisBorrowedObject::operator=(packet);
return *this;
using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _Spec = internal::CommonStreamSpec<LibObjT>;
- using _ThisCommonStream = CommonStream<LibObjT>;
using _Trace = internal::DepType<LibObjT, CommonTrace<bt_trace>, CommonTrace<const bt_trace>>;
public:
- using Shared = SharedObject<_ThisCommonStream, LibObjT, internal::StreamRefFuncs>;
+ using Shared = SharedObject<CommonStream, LibObjT, internal::StreamRefFuncs>;
using UserAttributes = internal::DepUserAttrs<LibObjT>;
using Class = internal::DepType<LibObjT, CommonStreamClass<bt_stream_class>,
}
template <typename OtherLibObjT>
- _ThisCommonStream& operator=(const CommonStream<OtherLibObjT> stream) noexcept
+ CommonStream operator=(const CommonStream<OtherLibObjT> stream) noexcept
{
_ThisBorrowedObject::operator=(stream);
return *this;
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_stream_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_stream_get_name(this->libObjPtr());
}
template <typename LibValT>
using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _Spec = internal::CommonTraceSpec<LibObjT>;
- using _ThisCommonTrace = CommonTrace<LibObjT>;
using _Stream = internal::DepStream<LibObjT>;
public:
- using Shared = SharedObject<_ThisCommonTrace, LibObjT, internal::TraceRefFuncs>;
+ using Shared = SharedObject<CommonTrace, LibObjT, internal::TraceRefFuncs>;
using UserAttributes = internal::DepUserAttrs<LibObjT>;
using Class = internal::DepType<LibObjT, CommonTraceClass<bt_trace_class>,
struct ConstEnvironmentEntry
{
- bpstd::string_view name;
+ const char *name;
ConstValue value;
};
}
template <typename OtherLibObjT>
- _ThisCommonTrace& operator=(const CommonTrace<OtherLibObjT> trace) noexcept
+ CommonTrace operator=(const CommonTrace<OtherLibObjT> trace) noexcept
{
_ThisBorrowedObject::operator=(trace);
return *this;
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_trace_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_trace_get_name(this->libObjPtr());
}
void uuid(const bt2_common::UuidView& uuid) const noexcept
using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _Spec = internal::CommonEventClassSpec<LibObjT>;
- using _ThisCommonEventClass = CommonEventClass<LibObjT>;
using _StructureFieldClass = internal::DepStructFc<LibObjT>;
using _StreamClass = internal::DepType<LibObjT, CommonStreamClass<bt_stream_class>,
CommonStreamClass<const bt_stream_class>>;
public:
- using Shared = SharedObject<_ThisCommonEventClass, LibObjT, internal::EventClassRefFuncs>;
-
+ using Shared = SharedObject<CommonEventClass, LibObjT, internal::EventClassRefFuncs>;
using UserAttributes = internal::DepUserAttrs<LibObjT>;
enum class LogLevel
}
template <typename OtherLibObjT>
- _ThisCommonEventClass& operator=(const CommonEventClass<OtherLibObjT> eventClass) noexcept
+ CommonEventClass operator=(const CommonEventClass<OtherLibObjT> eventClass) noexcept
{
_ThisBorrowedObject::operator=(eventClass);
return *this;
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_event_class_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_event_class_get_name(this->libObjPtr());
}
void logLevel(const LogLevel logLevel) const noexcept
this->emfUri(emfUri.data());
}
- nonstd::optional<bpstd::string_view> emfUri() const noexcept
+ const char *emfUri() const noexcept
{
- const auto emfUri = bt_event_class_get_emf_uri(this->libObjPtr());
-
- if (emfUri) {
- return emfUri;
- }
-
- return nonstd::nullopt;
+ return bt_event_class_get_emf_uri(this->libObjPtr());
}
void payloadFieldClass(const StructureFieldClass fc) const
using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _Spec = internal::CommonStreamClassSpec<LibObjT>;
- using _ThisCommonStreamClass = CommonStreamClass<LibObjT>;
using _StructureFieldClass = internal::DepStructFc<LibObjT>;
using _TraceClass = internal::DepType<LibObjT, CommonTraceClass<bt_trace_class>,
using _ClockClass = internal::DepType<LibObjT, ClockClass, ConstClockClass>;
public:
- using Shared = SharedObject<_ThisCommonStreamClass, LibObjT, internal::StreamClassRefFuncs>;
-
+ using Shared = SharedObject<CommonStreamClass, LibObjT, internal::StreamClassRefFuncs>;
using UserAttributes = internal::DepUserAttrs<LibObjT>;
explicit CommonStreamClass(const _LibObjPtr libObjPtr) noexcept :
}
template <typename OtherLibObjT>
- _ThisCommonStreamClass& operator=(const CommonStreamClass<OtherLibObjT> streamClass) noexcept
+ CommonStreamClass operator=(const CommonStreamClass<OtherLibObjT> streamClass) noexcept
{
_ThisBorrowedObject::operator=(streamClass);
return *this;
this->name(name.data());
}
- nonstd::optional<bpstd::string_view> name() const noexcept
+ const char *name() const noexcept
{
- const auto name = bt_stream_class_get_name(this->libObjPtr());
-
- if (name) {
- return name;
- }
-
- return nonstd::nullopt;
+ return bt_stream_class_get_name(this->libObjPtr());
}
void assignsAutomaticEventClassId(const bool val) const noexcept
using typename BorrowedObject<LibObjT>::_ThisBorrowedObject;
using typename BorrowedObject<LibObjT>::_LibObjPtr;
using _Spec = internal::CommonTraceClassSpec<LibObjT>;
- using _ThisCommonTraceClass = CommonTraceClass<LibObjT>;
using _StreamClass = internal::DepType<LibObjT, CommonStreamClass<bt_stream_class>,
CommonStreamClass<const bt_stream_class>>;
public:
- using Shared = SharedObject<_ThisCommonTraceClass, LibObjT, internal::TraceClassRefFuncs>;
-
+ using Shared = SharedObject<CommonTraceClass, LibObjT, internal::TraceClassRefFuncs>;
using UserAttributes = internal::DepUserAttrs<LibObjT>;
explicit CommonTraceClass(const _LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
}
template <typename OtherLibObjT>
- _ThisCommonTraceClass& operator=(const CommonTraceClass<OtherLibObjT> traceClass) noexcept
+ CommonTraceClass operator=(const CommonTraceClass<OtherLibObjT> traceClass) noexcept
{
_ThisBorrowedObject::operator=(traceClass);
return *this;