From 701ab06e5c9df701df8ae6bd39bf7febc4aa3441 Mon Sep 17 00:00:00 2001 From: yapa Date: Mon, 5 Aug 2024 22:50:26 +0530 Subject: [PATCH 1/5] Fixed, CXXGraph::Node::getData() should not be const #438 --- include/CXXGraph/Node/Node_decl.h | 1 + include/CXXGraph/Node/Node_impl.hpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/include/CXXGraph/Node/Node_decl.h b/include/CXXGraph/Node/Node_decl.h index 0618f605e..da615e547 100644 --- a/include/CXXGraph/Node/Node_decl.h +++ b/include/CXXGraph/Node/Node_decl.h @@ -48,6 +48,7 @@ class Node { const CXXGraph::id_t &getId() const; const std::string &getUserId() const; const T &getData() const; + T &getData() const; void setData(T &&new_data); // operator bool operator==(const Node &b) const; diff --git a/include/CXXGraph/Node/Node_impl.hpp b/include/CXXGraph/Node/Node_impl.hpp index eb6905c2c..d5638c3fc 100644 --- a/include/CXXGraph/Node/Node_impl.hpp +++ b/include/CXXGraph/Node/Node_impl.hpp @@ -65,6 +65,11 @@ const T &Node::getData() const { return data; } +template +T &Node::getData() const { + return data; +} + template void Node::setData(T &&new_data) { this->data = std::move(new_data); @@ -92,4 +97,4 @@ std::ostream &operator<<(std::ostream &os, const Node &node) { } // namespace CXXGraph -#endif // __CXXGRAPH_NODE_IMPL_H__ \ No newline at end of file +#endif // __CXXGRAPH_NODE_IMPL_H__ From 116d7e8ef5853267dfafb4dc7d89cbab41231285 Mon Sep 17 00:00:00 2001 From: yapa Date: Tue, 6 Aug 2024 20:01:34 +0530 Subject: [PATCH 2/5] Fixed the build failure --- include/CXXGraph/Node/Node_decl.h | 2 +- include/CXXGraph/Node/Node_impl.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/CXXGraph/Node/Node_decl.h b/include/CXXGraph/Node/Node_decl.h index da615e547..70902f152 100644 --- a/include/CXXGraph/Node/Node_decl.h +++ b/include/CXXGraph/Node/Node_decl.h @@ -48,7 +48,7 @@ class Node { const CXXGraph::id_t &getId() const; const std::string &getUserId() const; const T &getData() const; - T &getData() const; + T &getData() ; void setData(T &&new_data); // operator bool operator==(const Node &b) const; diff --git a/include/CXXGraph/Node/Node_impl.hpp b/include/CXXGraph/Node/Node_impl.hpp index d5638c3fc..84c40b91c 100644 --- a/include/CXXGraph/Node/Node_impl.hpp +++ b/include/CXXGraph/Node/Node_impl.hpp @@ -66,7 +66,7 @@ const T &Node::getData() const { } template -T &Node::getData() const { +T &Node::getData() { return data; } From f6e4ecf7707541a0b14033cd1030141a0495a33f Mon Sep 17 00:00:00 2001 From: yapa Date: Fri, 9 Aug 2024 22:42:41 +0530 Subject: [PATCH 3/5] Fix some lint issues --- include/CXXGraph/Node/Node_decl.h | 2 +- include/CXXGraph/Node/Node_impl.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/CXXGraph/Node/Node_decl.h b/include/CXXGraph/Node/Node_decl.h index 70902f152..c3c6c55ae 100644 --- a/include/CXXGraph/Node/Node_decl.h +++ b/include/CXXGraph/Node/Node_decl.h @@ -48,7 +48,7 @@ class Node { const CXXGraph::id_t &getId() const; const std::string &getUserId() const; const T &getData() const; - T &getData() ; + T &getData(); void setData(T &&new_data); // operator bool operator==(const Node &b) const; diff --git a/include/CXXGraph/Node/Node_impl.hpp b/include/CXXGraph/Node/Node_impl.hpp index 84c40b91c..20d60e2c8 100644 --- a/include/CXXGraph/Node/Node_impl.hpp +++ b/include/CXXGraph/Node/Node_impl.hpp @@ -66,7 +66,7 @@ const T &Node::getData() const { } template -T &Node::getData() { +T& Node::getData() { return data; } From 4bfa9866d95784e8c28f6c7e870b42ec84e69a45 Mon Sep 17 00:00:00 2001 From: Tharindu Lakmal Yapa <51540855+yapa-ymtl@users.noreply.github.com> Date: Sat, 10 Aug 2024 16:09:06 +0530 Subject: [PATCH 4/5] Update Node_decl.h Fixed lint issue --- include/CXXGraph/Node/Node_decl.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/CXXGraph/Node/Node_decl.h b/include/CXXGraph/Node/Node_decl.h index c3c6c55ae..5c2e2b17d 100644 --- a/include/CXXGraph/Node/Node_decl.h +++ b/include/CXXGraph/Node/Node_decl.h @@ -48,7 +48,7 @@ class Node { const CXXGraph::id_t &getId() const; const std::string &getUserId() const; const T &getData() const; - T &getData(); + T& getData(); void setData(T &&new_data); // operator bool operator==(const Node &b) const; From 5b6a7898675b71e663eddb4b8cc5cc7a076c5d8a Mon Sep 17 00:00:00 2001 From: Tharindu Lakmal Yapa <51540855+yapa-ymtl@users.noreply.github.com> Date: Tue, 4 Feb 2025 15:04:13 +0530 Subject: [PATCH 5/5] Update Node_impl.hpp fixed lint issue --- include/CXXGraph/Node/Node_impl.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/CXXGraph/Node/Node_impl.hpp b/include/CXXGraph/Node/Node_impl.hpp index 3504e0280..058f092ef 100644 --- a/include/CXXGraph/Node/Node_impl.hpp +++ b/include/CXXGraph/Node/Node_impl.hpp @@ -66,7 +66,7 @@ const T &Node::getData() const { } template -T& Node::getData() { +T &Node::getData() { return data; }