X-Git-Url: http://git.efficios.com/?a=blobdiff_plain;f=src%2Fcpp-common%2Fbt2%2Fcomponent-class-dev.hpp;h=e0d45d6b7e20f0347dbbba67c473ee60f2a504e0;hb=1c5ea5eb3a9adbc3adc4a3a36a6cf09f7fa05bf1;hp=b89ac6b24305fa95b6eda6339138acff04d317c4;hpb=eee15e593cc1c99b61d5d7089aea2f47e820b461;p=babeltrace.git diff --git a/src/cpp-common/bt2/component-class-dev.hpp b/src/cpp-common/bt2/component-class-dev.hpp index b89ac6b2..e0d45d6b 100644 --- a/src/cpp-common/bt2/component-class-dev.hpp +++ b/src/cpp-common/bt2/component-class-dev.hpp @@ -471,9 +471,9 @@ private: /* Type of `_mExcToThrowType` */ enum class _ExcToThrowType { - NONE, - ERROR, - MEM_ERROR, + None, + Error, + MemError, }; protected: @@ -489,17 +489,17 @@ public: void next(ConstMessageArray& messages) { /* Any saved error? Now is the time to throw */ - if (G_UNLIKELY(_mExcToThrowType != _ExcToThrowType::NONE)) { + if (G_UNLIKELY(_mExcToThrowType != _ExcToThrowType::None)) { /* Move `_mSavedLibError`, if any, as current thread error */ if (_mSavedLibError) { bt_current_thread_move_error(_mSavedLibError.release()); } /* Throw the corresponding exception */ - if (_mExcToThrowType == _ExcToThrowType::ERROR) { + if (_mExcToThrowType == _ExcToThrowType::Error) { throw Error {}; } else { - BT_ASSERT(_mExcToThrowType == _ExcToThrowType::MEM_ERROR); + BT_ASSERT(_mExcToThrowType == _ExcToThrowType::MemError); throw MemoryError {}; } } @@ -513,7 +513,7 @@ public: * if any, so that we can restore it later (see the beginning of * this method). */ - BT_ASSERT_DBG(_mExcToThrowType == _ExcToThrowType::NONE); + BT_ASSERT_DBG(_mExcToThrowType == _ExcToThrowType::None); try { this->_userObj()._next(messages); @@ -529,16 +529,16 @@ public: throw; } - _mExcToThrowType = _ExcToThrowType::MEM_ERROR; + _mExcToThrowType = _ExcToThrowType::MemError; } catch (const Error&) { if (messages.isEmpty()) { throw; } - _mExcToThrowType = _ExcToThrowType::ERROR; + _mExcToThrowType = _ExcToThrowType::Error; } - if (_mExcToThrowType != _ExcToThrowType::NONE) { + if (_mExcToThrowType != _ExcToThrowType::None) { BT_CPPLOGE( "An error occurred, but there are {} messages to return: delaying the error reporting.", messages.length()); @@ -716,7 +716,7 @@ private: void _resetError() noexcept { - _mExcToThrowType = _ExcToThrowType::NONE; + _mExcToThrowType = _ExcToThrowType::None; _mSavedLibError.reset(); } @@ -730,7 +730,7 @@ private: * * It also saves the type of the exception to throw the next time. */ - _ExcToThrowType _mExcToThrowType = _ExcToThrowType::NONE; + _ExcToThrowType _mExcToThrowType = _ExcToThrowType::None; struct LibErrorDeleter final {