#include <babeltrace2/babeltrace.h>
-#include "cpp-common/optional.hpp"
-#include "cpp-common/string_view.hpp"
+#include "cpp-common/bt2s/optional.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;
Class cls() const noexcept;
_Stream stream() const noexcept;
- nonstd::optional<_Packet> packet() const noexcept;
+ bt2s::optional<_Packet> packet() const noexcept;
- nonstd::optional<_StructureField> payloadField() const noexcept
+ bt2s::optional<_StructureField> payloadField() const noexcept
{
const auto libObjPtr = _Spec::payloadField(this->libObjPtr());
return _StructureField {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
- nonstd::optional<_StructureField> specificContextField() const noexcept
+ bt2s::optional<_StructureField> specificContextField() const noexcept
{
const auto libObjPtr = _Spec::specificContextField(this->libObjPtr());
return _StructureField {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
- nonstd::optional<_StructureField> commonContextField() const noexcept
+ bt2s::optional<_StructureField> commonContextField() const noexcept
{
const auto libObjPtr = _Spec::commonContextField(this->libObjPtr());
return _StructureField {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
};
}
template <typename OtherLibObjT>
- CommonPacket& operator=(const CommonPacket<OtherLibObjT> packet) noexcept
+ CommonPacket operator=(const CommonPacket<OtherLibObjT> packet) noexcept
{
_ThisBorrowedObject::operator=(packet);
return *this;
_Stream stream() const noexcept;
- nonstd::optional<_StructureField> contextField() const noexcept
+ bt2s::optional<_StructureField> contextField() const noexcept
{
const auto libObjPtr = _Spec::contextField(this->libObjPtr());
return _StructureField {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
Shared shared() const noexcept
} /* namespace internal */
template <typename LibObjT>
-nonstd::optional<typename CommonEvent<LibObjT>::_Packet>
-CommonEvent<LibObjT>::packet() const noexcept
+bt2s::optional<typename CommonEvent<LibObjT>::_Packet> CommonEvent<LibObjT>::packet() const noexcept
{
const auto libObjPtr = _Spec::packet(this->libObjPtr());
return _Packet {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
namespace internal {
}
template <typename OtherLibObjT>
- CommonStream& 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>
struct ConstEnvironmentEntry
{
- bpstd::string_view name;
+ const char *name;
ConstValue value;
};
}
template <typename OtherLibObjT>
- CommonTrace& 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
+ void uuid(const bt2c::UuidView& uuid) const noexcept
{
bt_trace_set_uuid(this->libObjPtr(), uuid.begin());
}
- nonstd::optional<bt2_common::UuidView> uuid() const noexcept
+ bt2s::optional<bt2c::UuidView> 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;
+ return bt2s::nullopt;
}
std::uint64_t length() const noexcept
return _Stream {_Spec::streamByIndex(this->libObjPtr(), index)};
}
- nonstd::optional<_Stream> streamById(const std::uint64_t id) const noexcept
+ bt2s::optional<_Stream> streamById(const std::uint64_t id) const noexcept
{
const auto libObjPtr = _Spec::streamById(this->libObjPtr(), id);
return _Stream {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
void environmentEntry(const char * const name, const std::int64_t val) const
return ConstEnvironmentEntry {name, ConstValue {libObjPtr}};
}
- nonstd::optional<ConstValue> environmentEntry(const char * const name) const noexcept
+ bt2s::optional<ConstValue> environmentEntry(const char * const name) const noexcept
{
const auto libObjPtr =
bt_trace_borrow_environment_entry_value_by_name_const(this->libObjPtr(), name);
return ConstValue {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
- nonstd::optional<ConstValue> environmentEntry(const std::string& name) const noexcept
+ bt2s::optional<ConstValue> environmentEntry(const std::string& name) const noexcept
{
return this->environmentEntry(name.data());
}
}
template <typename OtherLibObjT>
- CommonEventClass& 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
static_cast<bt_event_class_log_level>(logLevel));
}
- nonstd::optional<LogLevel> logLevel() const noexcept
+ bt2s::optional<LogLevel> logLevel() const noexcept
{
bt_event_class_log_level libLogLevel;
const auto avail = bt_event_class_get_log_level(this->libObjPtr(), &libLogLevel);
return static_cast<LogLevel>(libLogLevel);
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
void emfUri(const char * const emfUri) const
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
}
}
- nonstd::optional<_StructureFieldClass> payloadFieldClass() const noexcept
+ bt2s::optional<_StructureFieldClass> payloadFieldClass() const noexcept
{
const auto libObjPtr = _Spec::payloadFieldClass(this->libObjPtr());
return _StructureFieldClass {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
void specificContextFieldClass(const StructureFieldClass fc) const
}
}
- nonstd::optional<_StructureFieldClass> specificContextFieldClass() const noexcept
+ bt2s::optional<_StructureFieldClass> specificContextFieldClass() const noexcept
{
const auto libObjPtr = _Spec::specificContextFieldClass(this->libObjPtr());
return _StructureFieldClass {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
template <typename LibValT>
}
template <typename OtherLibObjT>
- CommonStreamClass& 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
BT_ASSERT(status == BT_STREAM_CLASS_SET_DEFAULT_CLOCK_CLASS_STATUS_OK);
}
- nonstd::optional<_ClockClass> defaultClockClass() const noexcept
+ bt2s::optional<_ClockClass> defaultClockClass() const noexcept
{
const auto libObjPtr = _Spec::defaultClockClass(this->libObjPtr());
return _ClockClass {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
std::uint64_t length() const noexcept
return _EventClass {_Spec::eventClassByIndex(this->libObjPtr(), index)};
}
- nonstd::optional<_EventClass> eventClassById(const std::uint64_t id) const noexcept
+ bt2s::optional<_EventClass> eventClassById(const std::uint64_t id) const noexcept
{
const auto libObjPtr = _Spec::eventClassById(this->libObjPtr(), id);
return _EventClass {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
void packetContextFieldClass(const StructureFieldClass fc) const
}
}
- nonstd::optional<_StructureFieldClass> packetContextFieldClass() const noexcept
+ bt2s::optional<_StructureFieldClass> packetContextFieldClass() const noexcept
{
const auto libObjPtr = _Spec::packetContextFieldClass(this->libObjPtr());
return _StructureFieldClass {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
void eventCommonContextFieldClass(const StructureFieldClass fc) const
}
}
- nonstd::optional<_StructureFieldClass> eventCommonContextFieldClass() const noexcept
+ bt2s::optional<_StructureFieldClass> eventCommonContextFieldClass() const noexcept
{
const auto libObjPtr = _Spec::eventCommonContextFieldClass(this->libObjPtr());
return _StructureFieldClass {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
template <typename LibValT>
}
template <typename OtherLibObjT>
- CommonTraceClass& operator=(const CommonTraceClass<OtherLibObjT> traceClass) noexcept
+ CommonTraceClass operator=(const CommonTraceClass<OtherLibObjT> traceClass) noexcept
{
_ThisBorrowedObject::operator=(traceClass);
return *this;
return _StreamClass {_Spec::streamClassByIndex(this->libObjPtr(), index)};
}
- nonstd::optional<_StreamClass> streamClassById(const std::uint64_t id) const noexcept
+ bt2s::optional<_StreamClass> streamClassById(const std::uint64_t id) const noexcept
{
const auto libObjPtr = _Spec::streamClassById(this->libObjPtr(), id);
return _StreamClass {libObjPtr};
}
- return nonstd::nullopt;
+ return bt2s::nullopt;
}
template <typename LibValT>