pivotal-jbarrett commented on a change in pull request #619:
URL: https://github.com/apache/geode-native/pull/619#discussion_r442936246
##########
File path: cppcache/src/PdxType.hpp
##########
@@ -202,11 +202,38 @@ class PdxType : public internal::DataSerializableInternal,
bool Equals(std::shared_ptr<PdxType> otherObj);
- // This is for PdxType as key in std map.
- bool operator<(const PdxType& other) const;
+ bool operator==(const PdxType& other) const;
+
+ size_t hashcode() const;
Review comment:
Now that `std::hash` has the implementation is it necessary to have this
on the class declaration? I don't see it in defined in the cpp file anymore.
##########
File path: cppcache/src/PdxType.cpp
##########
@@ -556,12 +556,23 @@ bool PdxType::Equals(std::shared_ptr<PdxType> otherObj) {
return true;
}
-bool PdxType::operator<(const PdxType& other) const {
- auto typeIdLessThan = this->m_geodeTypeId < other.m_geodeTypeId;
- auto typeIdsBothZero =
- (this->m_geodeTypeId == 0) && (other.m_geodeTypeId == 0);
- auto classnameLessThan = this->m_className < other.m_className;
- return (typeIdLessThan || (typeIdsBothZero && classnameLessThan));
+bool PdxType::operator==(const PdxType& other) const {
Review comment:
How does this differ from the `PdxType::Equals` method? Is there a
purpose for the `PdxType::Equals` anymore?
##########
File path: cppcache/test/CMakeLists.txt
##########
@@ -55,7 +56,7 @@ add_executable(apache-geode_unittests
util/synchronized_setTest.cpp
util/TestableRecursiveMutex.hpp
util/chrono/durationTest.cpp
-)
+ PdxTypeTest.cpp)
Review comment:
Looks like we are adding this file twice.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]