diff --git a/include/CXXGraph/Node/Node_decl.h b/include/CXXGraph/Node/Node_decl.h index 0618f605e..5c2e2b17d 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(); 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..20d60e2c8 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() { + 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__