#include <topological_map.h>
Public Types | |
typedef msg::TopologicalMapEdge | Edge |
typedef msg::TopologicalMapNode | Node |
Public Member Functions | |
GraphEdge | addEdge (const Edge &info) |
Add an edge. | |
GraphVertex | addNode (const Node &info) |
Add a node. | |
GraphEdge | edge (unsigned id) const |
Get the edge descriptor for this id. | |
Edge & | edgeInfo (unsigned id) |
Convenience function to get edge info. | |
const Edge & | edgeInfo (unsigned id) const |
Convenience function to get edge info. | |
GraphVertex | node (unsigned id) const |
Get the node descriptor for this id. | |
Node & | nodeInfo (unsigned id) |
Convenience function to get node info. | |
const Node & | nodeInfo (unsigned id) const |
Convenience function to get node info. | |
TopologicalMap & | operator= (const TopologicalMap &g) |
Assignment operator. | |
void | removeEdge (unsigned id) |
Remove an edge. | |
void | removeNode (unsigned id) |
Remove a node. | |
TopologicalMap () | |
Default constructor creates empty graph. | |
TopologicalMap (const TopologicalMap &g) | |
Copy constructor. | |
Private Member Functions | |
void | recomputeIndices () |
Recompute the indices from the graph. | |
Private Attributes | |
std::map< unsigned, GraphEdge > | edge_map_ |
std::map< unsigned, GraphVertex > | vertex_map_ |
Basically a boost adjacency_list, together with additional indexes that map from unsigned integers to boost node and edge descriptors (which are void pointers, and therefore can't be used when serializing the message). Adding and removing nodes and edges should be done with the member functions below so the indexes are updated appropriately. For everything else, use the boost adjacency_list ops, though some of them are wrapped for convenience, such as node/edgeInfo.
Definition at line 70 of file topological_map.h.
typedef msg::TopologicalMapEdge topological_map_2d::TopologicalMap::Edge |
Definition at line 75 of file topological_map.h.
typedef msg::TopologicalMapNode topological_map_2d::TopologicalMap::Node |
Definition at line 74 of file topological_map.h.
Default constructor creates empty graph.
Definition at line 81 of file topological_map.cpp.
Copy constructor.
Definition at line 85 of file topological_map.cpp.
GraphEdge topological_map_2d::TopologicalMap::addEdge | ( | const Edge & | info | ) |
Add an edge.
Descriptor | for the newly added edge |
DuplicateEdgeIdException | |
InvalidEdgeIdException | if info.id is 0 |
UnknownNodeIdException |
Definition at line 164 of file topological_map.cpp.
GraphVertex topological_map_2d::TopologicalMap::addNode | ( | const Node & | info | ) |
Add a node.
Descriptor | for the newly added node |
DuplicateNodeIdException | |
InvalidNodeIdException | if info.id is 0 |
Definition at line 155 of file topological_map.cpp.
GraphEdge topological_map_2d::TopologicalMap::edge | ( | unsigned | id | ) | const |
Get the edge descriptor for this id.
UnknownEdgeIdException |
Definition at line 122 of file topological_map.cpp.
TopologicalMap::Edge & topological_map_2d::TopologicalMap::edgeInfo | ( | unsigned | id | ) |
Convenience function to get edge info.
UnknownEdgeIdException |
Definition at line 135 of file topological_map.cpp.
const TopologicalMap::Edge & topological_map_2d::TopologicalMap::edgeInfo | ( | unsigned | id | ) | const |
Convenience function to get edge info.
UnknownEdgeIdException |
Definition at line 145 of file topological_map.cpp.
GraphVertex topological_map_2d::TopologicalMap::node | ( | unsigned | id | ) | const |
Get the node descriptor for this id.
UnknownNodeIdException |
Definition at line 114 of file topological_map.cpp.
TopologicalMap::Node & topological_map_2d::TopologicalMap::nodeInfo | ( | unsigned | id | ) |
Convenience function to get node info.
UnknownNodeIdException |
Definition at line 130 of file topological_map.cpp.
const TopologicalMap::Node & topological_map_2d::TopologicalMap::nodeInfo | ( | unsigned | id | ) | const |
Convenience function to get node info.
UnknownNodeIdException |
Definition at line 140 of file topological_map.cpp.
TopologicalMap & topological_map_2d::TopologicalMap::operator= | ( | const TopologicalMap & | g | ) |
Assignment operator.
Definition at line 91 of file topological_map.cpp.
void topological_map_2d::TopologicalMap::recomputeIndices | ( | ) | [private] |
Recompute the indices from the graph.
Definition at line 98 of file topological_map.cpp.
void topological_map_2d::TopologicalMap::removeEdge | ( | unsigned | id | ) |
void topological_map_2d::TopologicalMap::removeNode | ( | unsigned | id | ) |
std::map<unsigned, GraphEdge> topological_map_2d::TopologicalMap::edge_map_ [private] |
Definition at line 139 of file topological_map.h.
std::map<unsigned, GraphVertex> topological_map_2d::TopologicalMap::vertex_map_ [private] |
Definition at line 138 of file topological_map.h.