} /* namespace internal */
+enum class ComponentClassType
+{
+ Source = BT_COMPONENT_CLASS_TYPE_SOURCE,
+ Filter = BT_COMPONENT_CLASS_TYPE_FILTER,
+ Sink = BT_COMPONENT_CLASS_TYPE_SINK,
+};
+
template <typename LibObjT>
class CommonSourceComponentClass;
using typename _ThisBorrowedObject::LibObjPtr;
using Shared = SharedObject<CommonComponentClass, LibObjT, internal::ComponentClassRefFuncs>;
- enum class Type
- {
- Source = BT_COMPONENT_CLASS_TYPE_SOURCE,
- Filter = BT_COMPONENT_CLASS_TYPE_FILTER,
- Sink = BT_COMPONENT_CLASS_TYPE_SINK,
- };
-
explicit CommonComponentClass(const LibObjPtr libObjPtr) noexcept :
_ThisBorrowedObject {libObjPtr}
{
class ConstComponentErrorCause;
class ConstMessageIteratorErrorCause;
+enum class ErrorCauseActorType
+{
+ Unknown = BT_ERROR_CAUSE_ACTOR_TYPE_UNKNOWN,
+ Component = BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT,
+ ComponentClass = BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS,
+ MessageIterator = BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR,
+};
+
class ConstErrorCause : public BorrowedObject<const bt_error_cause>
{
public:
- enum class ActorType
- {
- Unknown = BT_ERROR_CAUSE_ACTOR_TYPE_UNKNOWN,
- Component = BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT,
- ComponentClass = BT_ERROR_CAUSE_ACTOR_TYPE_COMPONENT_CLASS,
- MessageIterator = BT_ERROR_CAUSE_ACTOR_TYPE_MESSAGE_ITERATOR,
- };
-
explicit ConstErrorCause(const LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
- ActorType actorType() const noexcept
+ ErrorCauseActorType actorType() const noexcept
{
- return static_cast<ActorType>(bt_error_cause_get_actor_type(this->libObjPtr()));
+ return static_cast<ErrorCauseActorType>(bt_error_cause_get_actor_type(this->libObjPtr()));
}
bool actorTypeIsComponentClass() const noexcept
{
- return this->actorType() == ActorType::ComponentClass;
+ return this->actorType() == ErrorCauseActorType::ComponentClass;
}
bool actorTypeIsComponent() const noexcept
{
- return this->actorType() == ActorType::Component;
+ return this->actorType() == ErrorCauseActorType::Component;
}
bool actorTypeIsMessageIterator() const noexcept
{
- return this->actorType() == ActorType::MessageIterator;
+ return this->actorType() == ErrorCauseActorType::MessageIterator;
}
ConstComponentClassErrorCause asComponentClass() const noexcept;
BT_ASSERT(this->actorTypeIsComponentClass());
}
- bt2::ComponentClass::Type componentClassType() const noexcept
+ bt2::ComponentClassType componentClassType() const noexcept
{
- return static_cast<bt2::ComponentClass::Type>(
+ return static_cast<bt2::ComponentClassType>(
bt_error_cause_component_class_actor_get_component_class_type(this->libObjPtr()));
}
return bt_error_cause_component_actor_get_component_name(this->libObjPtr());
}
- bt2::ComponentClass::Type componentClassType() const noexcept
+ bt2::ComponentClassType componentClassType() const noexcept
{
- return static_cast<bt2::ComponentClass::Type>(
+ return static_cast<bt2::ComponentClassType>(
bt_error_cause_component_actor_get_component_class_type(this->libObjPtr()));
}
return bt_error_cause_message_iterator_actor_get_component_name(this->libObjPtr());
}
- bt2::ComponentClass::Type componentClassType() const noexcept
+ bt2::ComponentClassType componentClassType() const noexcept
{
- return static_cast<bt2::ComponentClass::Type>(
+ return static_cast<bt2::ComponentClassType>(
bt_error_cause_message_iterator_actor_get_component_class_type(this->libObjPtr()));
}
} /* namespace internal */
+enum class FieldPathScope
+{
+ PacketContext = BT_FIELD_PATH_SCOPE_PACKET_CONTEXT,
+ EventCommonContext = BT_FIELD_PATH_SCOPE_EVENT_COMMON_CONTEXT,
+ EventSpecificContext = BT_FIELD_PATH_SCOPE_EVENT_SPECIFIC_CONTEXT,
+ EventPayload = BT_FIELD_PATH_SCOPE_EVENT_PAYLOAD,
+};
+
class ConstFieldPath final : public BorrowedObject<const bt_field_path>
{
public:
using Shared = SharedObject<ConstFieldPath, const bt_field_path, internal::FieldPathRefFuncs>;
using Iterator = BorrowedObjectIterator<ConstFieldPath>;
- enum class Scope
- {
- PacketContext = BT_FIELD_PATH_SCOPE_PACKET_CONTEXT,
- EventCommonContext = BT_FIELD_PATH_SCOPE_EVENT_COMMON_CONTEXT,
- EventSpecificContext = BT_FIELD_PATH_SCOPE_EVENT_SPECIFIC_CONTEXT,
- EventPayload = BT_FIELD_PATH_SCOPE_EVENT_PAYLOAD,
- };
-
explicit ConstFieldPath(const LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
- Scope rootScope() const noexcept
+ FieldPathScope rootScope() const noexcept
{
- return static_cast<Scope>(bt_field_path_get_root_scope(this->libObjPtr()));
+ return static_cast<FieldPathScope>(bt_field_path_get_root_scope(this->libObjPtr()));
}
std::uint64_t length() const noexcept
} /* namespace internal */
+/* Avoid `-Wshadow` error on GCC, conflicting with `bt2::Error` */
+BT_DIAG_PUSH
+BT_DIAG_IGNORE_SHADOW
+
+enum class EventClassLogLevel
+{
+ Emergency = BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY,
+ Alert = BT_EVENT_CLASS_LOG_LEVEL_ALERT,
+ Critical = BT_EVENT_CLASS_LOG_LEVEL_CRITICAL,
+ Error = BT_EVENT_CLASS_LOG_LEVEL_ERROR,
+ Warning = BT_EVENT_CLASS_LOG_LEVEL_WARNING,
+ Notice = BT_EVENT_CLASS_LOG_LEVEL_NOTICE,
+ Info = BT_EVENT_CLASS_LOG_LEVEL_INFO,
+ DebugSystem = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM,
+ DebugProgram = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM,
+ DebugProcess = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS,
+ DebugModule = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE,
+ DebugUnit = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT,
+ DebugFunction = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION,
+ DebugLine = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE,
+ Debug = BT_EVENT_CLASS_LOG_LEVEL_DEBUG,
+};
+
+BT_DIAG_POP
+
template <typename LibObjT>
class CommonEventClass final : public BorrowedObject<LibObjT>
{
using Shared = SharedObject<CommonEventClass, LibObjT, internal::EventClassRefFuncs>;
using UserAttributes = internal::DepUserAttrs<LibObjT>;
- /* Avoid `-Wshadow` error on GCC, conflicting with `bt2::Error` */
- BT_DIAG_PUSH
- BT_DIAG_IGNORE_SHADOW
-
- enum class LogLevel
- {
- Emergency = BT_EVENT_CLASS_LOG_LEVEL_EMERGENCY,
- Alert = BT_EVENT_CLASS_LOG_LEVEL_ALERT,
- Critical = BT_EVENT_CLASS_LOG_LEVEL_CRITICAL,
- Error = BT_EVENT_CLASS_LOG_LEVEL_ERROR,
- Warning = BT_EVENT_CLASS_LOG_LEVEL_WARNING,
- Notice = BT_EVENT_CLASS_LOG_LEVEL_NOTICE,
- Info = BT_EVENT_CLASS_LOG_LEVEL_INFO,
- DebugSystem = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_SYSTEM,
- DebugProgram = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROGRAM,
- DebugProcess = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_PROCESS,
- DebugModule = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_MODULE,
- DebugUnit = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_UNIT,
- DebugFunction = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_FUNCTION,
- DebugLine = BT_EVENT_CLASS_LOG_LEVEL_DEBUG_LINE,
- Debug = BT_EVENT_CLASS_LOG_LEVEL_DEBUG,
- };
-
- BT_DIAG_POP
-
explicit CommonEventClass(const LibObjPtr libObjPtr) noexcept : _ThisBorrowedObject {libObjPtr}
{
}
return bt_event_class_get_name(this->libObjPtr());
}
- CommonEventClass logLevel(const LogLevel logLevel) const noexcept
+ CommonEventClass logLevel(const EventClassLogLevel logLevel) const noexcept
{
static_assert(!std::is_const<LibObjT>::value, "Not available with `bt2::ConstEventClass`.");
return *this;
}
- bt2s::optional<LogLevel> logLevel() const noexcept
+ bt2s::optional<EventClassLogLevel> logLevel() const noexcept
{
bt_event_class_log_level libLogLevel;
if (bt_event_class_get_log_level(this->libObjPtr(), &libLogLevel)) {
- return static_cast<LogLevel>(libLogLevel);
+ return static_cast<EventClassLogLevel>(libLogLevel);
}
return bt2s::nullopt;