The Node class represents the concept of a node in the network.
More...
#include <Node.hpp>
|
| | Node (Id id) |
| | Construct a new Node object with capacity 1.
|
| | Node (Id id, geometry::Point point) |
| | Construct a new Node object with capacity 1.
|
|
| Node (Node const &other) |
|
Node & | operator= (Node const &other) |
| void | setId (Id id) noexcept |
| | Set the node's id.
|
| void | setGeometry (geometry::Point point) noexcept |
| | Set the node's geometry.
|
| void | setName (const std::string &name) noexcept |
| | Set the node's name.
|
| void | addIngoingEdge (Id edgeId) |
| | Add an ingoing edge to the node.
|
| void | addOutgoingEdge (Id edgeId) |
| | Add an outgoing edge to the node.
|
| void | setAttribute (std::string const &name, std::variant< std::monostate, bool, std::int64_t, double, std::string > const &value) |
| | Set an attribute for the node.
|
| auto | id () const |
| | Get the node's id.
|
| auto const & | geometry () const noexcept |
| | Get the node's geometry.
|
| auto const & | name () const noexcept |
| | Get the node's name.
|
| auto const & | ingoingEdges () const noexcept |
| | Get the node's ingoing edges.
|
| auto const & | outgoingEdges () const noexcept |
| | Get the node's outgoing edges.
|
| auto const & | attributes () const noexcept |
| | Get the node's attributes.
|
| template<typename T> |
| std::optional< T > | getAttribute (std::string const &name) const |
| | Get a specific attribute of the node.
|
|
|
Id | m_id |
|
std::optional< geometry::Point > | m_geometry |
|
std::string | m_name |
|
std::vector< Id > | m_ingoingEdges |
|
std::vector< Id > | m_outgoingEdges |
|
std::unordered_map< std::string, std::variant< std::monostate, bool, std::int64_t, double, std::string > > | m_attributes |
The Node class represents the concept of a node in the network.
◆ Node() [1/2]
Construct a new Node object with capacity 1.
- Parameters
-
◆ Node() [2/2]
Construct a new Node object with capacity 1.
- Parameters
-
◆ addIngoingEdge()
| void dsf::Node::addIngoingEdge |
( |
Id | edgeId | ) |
|
|
inline |
Add an ingoing edge to the node.
- Parameters
-
- Exceptions
-
| std::invalid_argument | if the edge already exists in the ingoing edges |
◆ addOutgoingEdge()
| void dsf::Node::addOutgoingEdge |
( |
Id | edgeId | ) |
|
|
inline |
Add an outgoing edge to the node.
- Parameters
-
- Exceptions
-
| std::invalid_argument | if the edge already exists in the outgoing edges |
◆ attributes()
| auto const & dsf::Node::attributes |
( |
| ) |
const |
|
inlinenoexcept |
Get the node's attributes.
- Returns
- std::unordered_map<std::string, std::variant<std::monostate, bool, std::int64_t, double, std::string>> A map of the node's attributes, where the key is the attribute's name and the value is the attribute's value
◆ geometry()
| auto const & dsf::Node::geometry |
( |
| ) |
const |
|
inlinenoexcept |
Get the node's geometry.
- Returns
- std::optional<geometry::Point> A geometry::Point
◆ getAttribute()
template<typename T>
| std::optional< T > dsf::Node::getAttribute |
( |
std::string const & | name | ) |
const |
|
inline |
Get a specific attribute of the node.
- Template Parameters
-
| T | The type of the attribute's value |
- Parameters
-
- Returns
- std::optional<T> The attribute's value if it exists and can be cast to the specified type, std::nullopt otherwise
◆ id()
| auto dsf::Node::id |
( |
| ) |
const |
|
inline |
Get the node's id.
- Returns
- Id The node's id
◆ ingoingEdges()
| auto const & dsf::Node::ingoingEdges |
( |
| ) |
const |
|
inlinenoexcept |
Get the node's ingoing edges.
- Returns
- std::vector<Id> A vector of the node's ingoing edge ids
◆ name()
| auto const & dsf::Node::name |
( |
| ) |
const |
|
inlinenoexcept |
Get the node's name.
- Returns
- std::string The node's name
◆ outgoingEdges()
| auto const & dsf::Node::outgoingEdges |
( |
| ) |
const |
|
inlinenoexcept |
Get the node's outgoing edges.
- Returns
- std::vector<Id> A vector of the node's outgoing edge ids
◆ setAttribute()
| void dsf::Node::setAttribute |
( |
std::string const & | name, |
|
|
std::variant< std::monostate, bool, std::int64_t, double, std::string > const & | value ) |
|
inline |
Set an attribute for the node.
- Parameters
-
| name | The attribute's name |
| value | The attribute's value |
◆ setGeometry()
Set the node's geometry.
- Parameters
-
◆ setId()
| void dsf::Node::setId |
( |
Id | id | ) |
|
|
inlinenoexcept |
Set the node's id.
- Parameters
-
◆ setName()
| void dsf::Node::setName |
( |
const std::string & | name | ) |
|
|
inlinenoexcept |
Set the node's name.
- Parameters
-
The documentation for this class was generated from the following file: