Skip to content

Commit

Permalink
iox-eclipse-iceoryx#1942 Add documentation to the semantic string ope…
Browse files Browse the repository at this point in the history
…rators
  • Loading branch information
elfenpiff committed Mar 20, 2023
1 parent 07e3671 commit 4e73add
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ TYPED_TEST(SemanticString_test, InequalityOperatorWorks)
EXPECT_TRUE(this->greater_value != this->smaller_value_str);
}

TYPED_TEST(SemanticString_test, LessThanOperatorWorks)
TYPED_TEST(SemanticString_test, LessThanOrEqualOperatorWorks)
{
::testing::Test::RecordProperty("TEST_ID", "53f5b765-b462-4cc1-bab7-9b937fbbcecf");

Expand All @@ -338,7 +338,7 @@ TYPED_TEST(SemanticString_test, LessThanOperatorWorks)
EXPECT_FALSE(this->greater_value <= this->smaller_value);
}

TYPED_TEST(SemanticString_test, LessOperatorWorks)
TYPED_TEST(SemanticString_test, LessThanOperatorWorks)
{
::testing::Test::RecordProperty("TEST_ID", "cea977a4-ccb3-42a6-9d13-e09dce24c273");

Expand All @@ -347,7 +347,7 @@ TYPED_TEST(SemanticString_test, LessOperatorWorks)
EXPECT_FALSE(this->greater_value < this->smaller_value);
}

TYPED_TEST(SemanticString_test, GreaterThanOperatorWorks)
TYPED_TEST(SemanticString_test, GreaterThanOrEqualOperatorWorks)
{
::testing::Test::RecordProperty("TEST_ID", "5d731b17-f787-46fc-b64d-3d86c9102008");

Expand All @@ -356,7 +356,7 @@ TYPED_TEST(SemanticString_test, GreaterThanOperatorWorks)
EXPECT_TRUE(this->greater_value >= this->smaller_value);
}

TYPED_TEST(SemanticString_test, GreaterOperatorWorks)
TYPED_TEST(SemanticString_test, GreaterThanOperatorWorks)
{
::testing::Test::RecordProperty("TEST_ID", "8c046cff-fb69-43b4-9a45-e86f17c874db");

Expand Down
36 changes: 36 additions & 0 deletions iceoryx_hoofs/vocabulary/include/iox/semantic_string.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,33 +121,69 @@ class SemanticString
template <typename T>
expected<SemanticStringError> insert(const uint64_t pos, const T& str, const uint64_t count) noexcept;

/// @brief checks if another SemanticString is equal to this string
/// @param [in] rhs the other SemanticString
/// @return true if the contents equal, otherwise false
bool operator==(const SemanticString& rhs) const noexcept;

/// @brief checks if another string or char array is equal to this string
/// @param [in] rhs the other string
/// @return true if the contents equal, otherwise false
template <typename T>
IsStringOrCharArray<T, bool> operator==(const T& rhs) const noexcept;

/// @brief checks if another SemanticString is not equal to this string
/// @param [in] rhs the other SemanticString
/// @return true if the contents not equal, otherwise false
bool operator!=(const SemanticString& rhs) const noexcept;

/// @brief checks if another string or char array is not equal to this string
/// @param [in] rhs the other string
/// @return true if the contents not equal, otherwise false
template <typename T>
IsStringOrCharArray<T, bool> operator!=(const T& rhs) const noexcept;

/// @brief checks if another SemanticString is less than or equal this string
/// @param [in] rhs the other SemanticString
/// @return true if the contents are less than or equal rhs, otherwise false
bool operator<=(const SemanticString& rhs) const noexcept;

/// @brief checks if another string or char array is less than or equal this string
/// @param [in] rhs the other string
/// @return true if the contents are less than or equal rhs, otherwise false
template <typename T>
IsStringOrCharArray<T, bool> operator<=(const T& rhs) const noexcept;

/// @brief checks if another SemanticString is less than this string
/// @param [in] rhs the other SemanticString
/// @return true if the contents are less than rhs, otherwise false
bool operator<(const SemanticString& rhs) const noexcept;

/// @brief checks if another string or char array is less than this string
/// @param [in] rhs the other string
/// @return true if the contents are less than rhs, otherwise false
template <typename T>
IsStringOrCharArray<T, bool> operator<(const T& rhs) const noexcept;

/// @brief checks if another SemanticString is greater than or equal this string
/// @param [in] rhs the other SemanticString
/// @return true if the contents are greater than or equal rhs, otherwise false
bool operator>=(const SemanticString& rhs) const noexcept;

/// @brief checks if another string or char array is greater than or equal this string
/// @param [in] rhs the other string
/// @return true if the contents are greater than or equal rhs, otherwise false
template <typename T>
IsStringOrCharArray<T, bool> operator>=(const T& rhs) const noexcept;

/// @brief checks if another SemanticString is greater than this string
/// @param [in] rhs the other SemanticString
/// @return true if the contents are greater than rhs, otherwise false
bool operator>(const SemanticString& rhs) const noexcept;

/// @brief checks if another string or char array is greater than this string
/// @param [in] rhs the other string
/// @return true if the contents are greater than rhs, otherwise false
template <typename T>
IsStringOrCharArray<T, bool> operator>(const T& rhs) const noexcept;

Expand Down

0 comments on commit 4e73add

Please sign in to comment.