diff --git a/cpp_utils/include/cpp_utils/ReturnCode.hpp b/cpp_utils/include/cpp_utils/ReturnCode.hpp index 6d82a4c..b148c6a 100644 --- a/cpp_utils/include/cpp_utils/ReturnCode.hpp +++ b/cpp_utils/include/cpp_utils/ReturnCode.hpp @@ -58,6 +58,10 @@ class ReturnCode ReturnCode( const fastdds::dds::ReturnCode_t& value); + CPP_UTILS_DllAPI + ReturnCode( + const ReturnCodeValue& value); + CPP_UTILS_DllAPI std::uint32_t operator ()() const noexcept; @@ -84,9 +88,8 @@ class ReturnCode //! Link every ReturnCodeValue available with a string to deserialize static const std::map to_string_conversion_; - //! \c ReturnCode value - std::uint32_t value_; - + //! \c ReturnCodeValue + ReturnCodeValue value_; // operator << needs access to the object CPP_UTILS_DllAPI diff --git a/cpp_utils/src/cpp/ReturnCode.cpp b/cpp_utils/src/cpp/ReturnCode.cpp index 1a04b79..8102aba 100644 --- a/cpp_utils/src/cpp/ReturnCode.cpp +++ b/cpp_utils/src/cpp/ReturnCode.cpp @@ -61,6 +61,12 @@ ReturnCode::ReturnCode( } } +ReturnCode::ReturnCode( + const ReturnCode::ReturnCodeValue& value) +{ + value_ = value; +} + std::uint32_t ReturnCode::operator ()() const noexcept { return value_;