4 #include "property-container.h"
49 void addNode(
const std::string &
id,
const Node &node);
80 bool hasNode(
const std::string &
id)
const;
100 void addEdge(
const std::string &id1,
const std::string &id2,
const Edge &edge);
112 void addEdge(
const std::pair<std::string, std::string> &nodes_,
const Edge &edge);
150 Edge removeEdge(
const std::pair <std::string, std::string> &nodes_);
176 Edge getEdge(
const std::string &id1,
const std::string &id2)
const;
188 Edge getEdge(
const std::pair <std::string, std::string> &nodes_)
const;
213 bool hasEdge(
const std::string &id1,
const std::string &id2)
const;
224 bool hasEdge(
const std::pair <std::string, std::string> &nodes_)
const;
244 std::set<std::pair <std::string, std::string> >
getAllEdges()
const;
263 this->exceptionStr =
"The edge between nodes with IDs " + nodes_.first +
" and "
264 + nodes_.second +
" was not found.";
270 const char* what()
const throw() {
271 return this->exceptionStr.c_str();
275 std::string exceptionStr;
281 this->exceptionStr =
"The node with ID " +
id +
" was not found.";
287 const char* what()
const throw() {
288 return this->exceptionStr.c_str();
292 std::string exceptionStr;
297 typedef std::map <std::string, Node> nodesType;
301 typedef std::map <Pair <std::string, std::string>,
Edge> edgesType;
bool hasEdge(const std::string &id1, const std::string &id2) const
Definition: topology.cpp:138
unsigned int edgeCount() const
Definition: topology.cpp:156
void addEdge(const std::string &id1, const std::string &id2, const Edge &edge)
Definition: topology.cpp:68
unsigned int nodeCount() const
Definition: topology.cpp:152
Definition: topology.h:278
Definition: topology.h:260
bool hasNode(const std::string &id) const
Definition: topology.cpp:50
Topology(bool directed=false)
Definition: topology.cpp:7
Definition: topology.h:22
std::set< std::pair< std::string, std::string > > getAllEdges() const
Definition: topology.cpp:142
std::set< std::string > getAllNodes() const
Definition: topology.cpp:58
void addNode(const std::string &id, const Node &node)
Definition: topology.cpp:13
bool isDirected() const
Definition: topology.cpp:9
Node removeNode(const std::string &id, bool pruneEdges=true)
Definition: topology.cpp:17
Node getNode(const std::string &id) const
Definition: topology.cpp:42
Edge removeEdge(const std::string &id1, const std::string &id2)
Definition: topology.cpp:104
Edge getEdge(const std::string &id1, const std::string &id2) const
Definition: topology.cpp:121
Definition: property-container.h:15