The graph. More...
#include <bgrl_graph.h>
Classes | |
class | iterator |
Public Types | |
typedef vcl_set < bgrl_vertex_sptr >::iterator | vertex_iterator |
typedef vcl_set < bgrl_edge_sptr >::iterator | edge_iterator |
Public Member Functions | |
bgrl_graph () | |
Constructor. | |
bgrl_graph (const bgrl_graph &graph) | |
Copy Constructor. | |
virtual | ~bgrl_graph () |
Destructor. | |
bool | add_vertex (const bgrl_vertex_sptr &vertex) |
Adds a new vertex to the graph. | |
bool | remove_vertex (const bgrl_vertex_sptr &vertex) |
Deletes a vertex in the graph. | |
bgrl_edge_sptr | add_edge (const bgrl_vertex_sptr &v1, const bgrl_vertex_sptr &v2, const bgrl_edge_sptr &model_edge=NULL) |
Add an edge between v1 and v2 . | |
bool | remove_edge (const bgrl_vertex_sptr &v1, const bgrl_vertex_sptr &v2) |
Add an edge between v1 and v2 . | |
bool | purge () |
Remove all edges to NULL vertices and vertices not found in this graph. | |
int | size () const |
Returns the number of vertices in the graph. | |
virtual vcl_string | is_a () const |
Return a platform independent string identifying the class. | |
virtual bgrl_graph * | clone () const |
Create a copy of the object on the heap. | |
void | b_write (vsl_b_ostream &os) const |
Binary save self to stream. | |
void | b_read (vsl_b_istream &is) |
Binary load self from stream. | |
short | version () const |
Return IO version number;. | |
void | print_summary (vcl_ostream &os) const |
Print an ascii summary to the stream. | |
iterator | begin (const bgrl_search_func_sptr &func=NULL) |
Depth first search begin iterator. | |
iterator | end () |
Depth first search end iterator. | |
void | ref () |
void | unref () |
int | get_references () const |
bool | is_referenced () const |
Private Attributes | |
vcl_set< bgrl_vertex_sptr > | vertices_ |
The vector of vertices. | |
Friends | |
class | bgrl_graph::iterator |
The graph.
Definition at line 34 of file bgrl_graph.h.
typedef vcl_set<bgrl_edge_sptr>::iterator bgrl_graph::edge_iterator |
Definition at line 39 of file bgrl_graph.h.
typedef vcl_set<bgrl_vertex_sptr>::iterator bgrl_graph::vertex_iterator |
Definition at line 38 of file bgrl_graph.h.
bgrl_graph::bgrl_graph | ( | ) |
Constructor.
Definition at line 12 of file bgrl_graph.cxx.
bgrl_graph::bgrl_graph | ( | const bgrl_graph & | graph | ) |
Copy Constructor.
Definition at line 18 of file bgrl_graph.cxx.
virtual bgrl_graph::~bgrl_graph | ( | ) | [inline, virtual] |
Destructor.
Definition at line 49 of file bgrl_graph.h.
bgrl_edge_sptr bgrl_graph::add_edge | ( | const bgrl_vertex_sptr & | v1, |
const bgrl_vertex_sptr & | v2, | ||
const bgrl_edge_sptr & | model_edge = NULL |
||
) |
Add an edge between v1
and v2
.
Definition at line 77 of file bgrl_graph.cxx.
bool bgrl_graph::add_vertex | ( | const bgrl_vertex_sptr & | vertex | ) |
Adds a new vertex to the graph.
true | if the vertex was added |
false | if the vertex could not be added |
Definition at line 53 of file bgrl_graph.cxx.
void bgrl_graph::b_read | ( | vsl_b_istream & | is | ) |
Binary load self from stream.
Definition at line 174 of file bgrl_graph.cxx.
void bgrl_graph::b_write | ( | vsl_b_ostream & | os | ) | const |
Binary save self to stream.
Definition at line 163 of file bgrl_graph.cxx.
iterator bgrl_graph::begin | ( | const bgrl_search_func_sptr & | func = NULL | ) | [inline] |
Depth first search begin iterator.
Definition at line 143 of file bgrl_graph.h.
bgrl_graph * bgrl_graph::clone | ( | ) | const [virtual] |
Create a copy of the object on the heap.
The caller is responsible for deletion
Definition at line 155 of file bgrl_graph.cxx.
iterator bgrl_graph::end | ( | ) | [inline] |
Depth first search end iterator.
Definition at line 145 of file bgrl_graph.h.
vcl_string bgrl_graph::is_a | ( | ) | const [virtual] |
Return a platform independent string identifying the class.
Definition at line 146 of file bgrl_graph.cxx.
void bgrl_graph::print_summary | ( | vcl_ostream & | os | ) | const |
Print an ascii summary to the stream.
Definition at line 202 of file bgrl_graph.cxx.
bool bgrl_graph::purge | ( | ) |
Remove all edges to NULL vertices and vertices not found in this graph.
Remove all edges to NULL vertices and vertex not found in this graph.
true | if any edges have been purged |
false | if all edges were found to be valid |
Definition at line 103 of file bgrl_graph.cxx.
bool bgrl_graph::remove_edge | ( | const bgrl_vertex_sptr & | v1, |
const bgrl_vertex_sptr & | v2 | ||
) |
Add an edge between v1
and v2
.
Remove an edge between v1
and v2
.
Definition at line 94 of file bgrl_graph.cxx.
bool bgrl_graph::remove_vertex | ( | const bgrl_vertex_sptr & | vertex | ) |
Deletes a vertex in the graph.
true | if the vertex was deleted |
false | if the vertex was not found in the graph |
Definition at line 63 of file bgrl_graph.cxx.
int bgrl_graph::size | ( | ) | const |
Returns the number of vertices in the graph.
Returns the number of vertices in the graph;.
Definition at line 138 of file bgrl_graph.cxx.
short bgrl_graph::version | ( | ) | const |
Return IO version number;.
Definition at line 210 of file bgrl_graph.cxx.
friend class bgrl_graph::iterator [friend] |
Definition at line 140 of file bgrl_graph.h.
vcl_set<bgrl_vertex_sptr> bgrl_graph::vertices_ [private] |
The vector of vertices.
Definition at line 98 of file bgrl_graph.h.