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.
|
|
void | setStrId (const std::string &strId) |
|
Id | id () const |
| Get the node's id.
|
|
std::optional< std::pair< double, double > > const & | coords () const |
| Get the node's coordinates.
|
|
std::string const & | name () const noexcept |
| Get the node's name.
|
|
std::optional< std::string > const & | strId () const noexcept |
|
virtual bool | isStation () const noexcept |
|
|
Id | m_id |
|
std::optional< std::pair< double, double > > | m_coords |
|
std::string | m_name |
|
std::optional< std::string > | m_strId |
|
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]
dsf::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()
std::optional< std::pair< double, double > > const & dsf::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 dsf::Node::id |
( |
| ) |
const |
|
inline |
Get the node's id.
- Returns
- Id The node's id
◆ isStation()
virtual bool dsf::Node::isStation |
( |
| ) |
const |
|
inlinevirtualnoexcept |
◆ name()
std::string const & dsf::Node::name |
( |
| ) |
const |
|
inlinenoexcept |
Get the node's name.
- Returns
- std::string The node's name
◆ setCoords()
void dsf::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 dsf::Node::setId |
( |
Id | id | ) |
|
|
inline |
Set the node's id.
- Parameters
-
◆ setName()
void dsf::Node::setName |
( |
const std::string & | name | ) |
|
|
inline |
Set the node's name.
- Parameters
-
The documentation for this class was generated from the following file: