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, std::pair< double, double > coords) |
| Construct a new Node object with capacity 1.
|
|
| Node (Node const &other) |
|
Node & | operator= (Node const &other) |
|
void | setId (Id id) |
| Set the node's id.
|
|
void | setCoords (std::pair< double, double > coords) |
| Set the node's coordinates.
|
|
void | setName (const std::string &name) |
| Set the node's name.
|
|
Id | id () const |
| Get the node's id.
|
|
const std::optional< std::pair< double, double > > & | coords () const |
| Get the node's coordinates.
|
|
const std::string & | name () const |
| Get the node's name.
|
|
virtual bool | isStation () const noexcept |
|
|
Id | m_id |
|
std::optional< std::pair< double, double > > | m_coords |
|
std::string | m_name |
|
The Node class represents the concept of a node in the network.
- Template Parameters
-
Id | The type of the node's id |
Size | The type of the node's capacity |
◆ Node() [1/2]
Construct a new Node object with capacity 1.
- Parameters
-
◆ Node() [2/2]
dsm::Node::Node |
( |
Id | id, |
|
|
std::pair< double, double > | coords ) |
|
inline |
Construct a new Node object with capacity 1.
- Parameters
-
id | The node's id |
coords | A std::pair containing the node's coordinates (lat, lon) |
◆ coords()
const std::optional< std::pair< double, double > > & dsm::Node::coords |
( |
| ) |
const |
|
inline |
Get the node's coordinates.
- Returns
- std::optional<std::pair<double, double>> A std::pair containing the node's coordinates
◆ id()
Id dsm::Node::id |
( |
| ) |
const |
|
inline |
Get the node's id.
- Returns
- Id The node's id
◆ isStation()
virtual bool dsm::Node::isStation |
( |
| ) |
const |
|
inlinevirtualnoexcept |
◆ name()
const std::string & dsm::Node::name |
( |
| ) |
const |
|
inline |
Get the node's name.
- Returns
- std::string The node's name
◆ setCoords()
void dsm::Node::setCoords |
( |
std::pair< double, double > | coords | ) |
|
|
inline |
Set the node's coordinates.
- Parameters
-
coords | A std::pair containing the node's coordinates (lat, lon) |
◆ setId()
void dsm::Node::setId |
( |
Id | id | ) |
|
|
inline |
Set the node's id.
- Parameters
-
◆ setName()
void dsm::Node::setName |
( |
const std::string & | name | ) |
|
|
inline |
Set the node's name.
- Parameters
-
The documentation for this class was generated from the following file: