Skip to content

Commit

Permalink
Fix namespaces
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <mjcarroll@intrinsic.ai>
  • Loading branch information
mjcarroll committed Sep 27, 2023
1 parent 1e88241 commit c032c1e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
31 changes: 16 additions & 15 deletions include/gz/common/EnumIface.hh
Original file line number Diff line number Diff line change
Expand Up @@ -226,22 +226,23 @@ namespace gz::common
{
return !(_e1 == _e2);
}

/// \brief A template that allows an enum to have an iterator and string
/// conversion.
/// \param[in] begin Enum value that marks the beginning of the enum
/// values.
/// \param[in] end Enum value that marks the end of the enum values.
/// \param[in] names A vector of strings, one for each enum value.
/// \sa EnumIface
/// \sa EnumIterator
template<typename T>
static constexpr gz::common::EnumIface<T> gzEnum(
T _enumBegin, T _enumEnd, const std::vector<std::string> &_enumVals)
{
return gz::common::EnumIface<T>(_enumBegin, _enumEnd, _enumVals);
}
} // namespace gz::common

/// \brief A template that allows an enum to have an iterator and string
/// conversion.
/// \param[in] begin Enum value that marks the beginning of the enum
/// values.
/// \param[in] end Enum value that marks the end of the enum values.
/// \param[in] names A vector of strings, one for each enum value.
/// \sa EnumIface
/// \sa EnumIterator
template<typename T>
static constexpr gz::common::EnumIface<T> gzEnum(
T _enumBegin, T _enumEnd, const std::vector<std::string> &_enumVals)
{
return gz::common::EnumIface<T>(_enumBegin, _enumEnd, _enumVals);
}

/// \brief A macro that allows an enum to have an iterator and string
/// conversion.
Expand All @@ -254,6 +255,6 @@ static constexpr gz::common::EnumIface<T> gzEnum(
/// \sa EnumIface
/// \sa EnumIterator
#define GZ_ENUM(name, enumType, begin, end, ...) \
static auto name = gzEnum(begin, end, {__VA_ARGS__});
static auto name = gz::common::gzEnum(begin, end, {__VA_ARGS__});

#endif // GZ_COMMON_ENUMITERATOR_HH_
4 changes: 1 addition & 3 deletions src/EnumIface_TEST.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@

#include "gz/common/testing/AutoLogFixture.hh"

using namespace gz;

class EnumIfaceTest : public common::testing::AutoLogFixture { };
class EnumIfaceTest : public gz::common::testing::AutoLogFixture { };

enum MyType
{
Expand Down

0 comments on commit c032c1e

Please sign in to comment.