A vertex in a graph. More...
#include <bgrl_vertex.h>
Public Types | |
typedef vcl_set < bgrl_edge_sptr >::iterator | edge_iterator |
Public Member Functions | |
bgrl_vertex () | |
Constructor. | |
bgrl_vertex (const bgrl_vertex &vertex) | |
Copy Constructor. | |
virtual | ~bgrl_vertex () |
Destructor. | |
edge_iterator | begin () |
Returns an iterator to the beginning of the set of outgoing edges. | |
edge_iterator | end () |
Returns an iterator to the end of the list of outgoing edges. | |
int | degree () const |
Returns the total number of edges at this vertex. | |
unsigned int | in_degree () const |
Returns the number of incoming edges to this vertex. | |
unsigned int | out_degree () const |
Returns the number of outgoing edges to this vertex. | |
virtual vcl_string | is_a () const |
Return a platform independent string identifying the class. | |
virtual bgrl_vertex * | 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. | |
void | ref () |
void | unref () |
int | get_references () const |
bool | is_referenced () const |
Protected Member Functions | |
bgrl_edge_sptr | add_edge_to (const bgrl_vertex_sptr &vertex, const bgrl_edge_sptr &model_edge) |
Create an outgoing edge to vertex . | |
bool | remove_edge_to (const bgrl_vertex_sptr &vertex) |
Remove the outgoing edge to vertex . | |
void | strip () |
Strip all of the edges from this vertex. | |
bool | purge () |
Remove any edges to or from NULL vertices. | |
Protected Attributes | |
vcl_set< bgrl_edge_sptr > | out_edges_ |
The pointers to outgoing edges. | |
vcl_set< bgrl_edge_sptr > | in_edges_ |
The pointers to incoming edges. | |
Friends | |
class | bgrl_graph |
A vertex in a graph.
Definition at line 30 of file bgrl_vertex.h.
typedef vcl_set<bgrl_edge_sptr>::iterator bgrl_vertex::edge_iterator |
Definition at line 34 of file bgrl_vertex.h.
bgrl_vertex::bgrl_vertex | ( | ) |
Constructor.
Definition at line 13 of file bgrl_vertex.cxx.
bgrl_vertex::bgrl_vertex | ( | const bgrl_vertex & | vertex | ) |
Copy Constructor.
Definition at line 20 of file bgrl_vertex.cxx.
virtual bgrl_vertex::~bgrl_vertex | ( | ) | [inline, virtual] |
Destructor.
Definition at line 44 of file bgrl_vertex.h.
bgrl_edge_sptr bgrl_vertex::add_edge_to | ( | const bgrl_vertex_sptr & | vertex, |
const bgrl_edge_sptr & | model_edge | ||
) | [protected] |
Create an outgoing edge to vertex
.
Add an edge to vertex
.
Definition at line 102 of file bgrl_vertex.cxx.
void bgrl_vertex::b_read | ( | vsl_b_istream & | is | ) |
Binary load self from stream.
Definition at line 205 of file bgrl_vertex.cxx.
void bgrl_vertex::b_write | ( | vsl_b_ostream & | os | ) | const |
Binary save self to stream.
Definition at line 192 of file bgrl_vertex.cxx.
bgrl_vertex::edge_iterator bgrl_vertex::begin | ( | ) |
Returns an iterator to the beginning of the set of outgoing edges.
Returns an iterator to the beginning of the list of outgoing edges.
Definition at line 159 of file bgrl_vertex.cxx.
bgrl_vertex * bgrl_vertex::clone | ( | ) | const [virtual] |
Create a copy of the object on the heap.
The caller is responsible for deletion
Definition at line 184 of file bgrl_vertex.cxx.
int bgrl_vertex::degree | ( | ) | const [inline] |
Returns the total number of edges at this vertex.
Definition at line 53 of file bgrl_vertex.h.
bgrl_vertex::edge_iterator bgrl_vertex::end | ( | ) |
Returns an iterator to the end of the list of outgoing edges.
Definition at line 167 of file bgrl_vertex.cxx.
unsigned int bgrl_vertex::in_degree | ( | ) | const [inline] |
Returns the number of incoming edges to this vertex.
Definition at line 56 of file bgrl_vertex.h.
vcl_string bgrl_vertex::is_a | ( | ) | const [virtual] |
Return a platform independent string identifying the class.
Definition at line 175 of file bgrl_vertex.cxx.
unsigned int bgrl_vertex::out_degree | ( | ) | const [inline] |
Returns the number of outgoing edges to this vertex.
Definition at line 59 of file bgrl_vertex.h.
void bgrl_vertex::print_summary | ( | vcl_ostream & | os | ) | const |
Print an ascii summary to the stream.
Definition at line 249 of file bgrl_vertex.cxx.
bool bgrl_vertex::purge | ( | ) | [protected] |
Remove any edges to or from NULL vertices.
true | if any edges were removed |
false | if all edges are valid |
Definition at line 68 of file bgrl_vertex.cxx.
bool bgrl_vertex::remove_edge_to | ( | const bgrl_vertex_sptr & | vertex | ) | [protected] |
Remove the outgoing edge to vertex
.
Remove vertex
from the neighborhood.
true | if the edge was removed successfully |
false | if the edge was not found |
Definition at line 135 of file bgrl_vertex.cxx.
void bgrl_vertex::strip | ( | ) | [protected] |
Strip all of the edges from this vertex.
This also removes edges to and from this vertex in neighboring vertices
Definition at line 34 of file bgrl_vertex.cxx.
short bgrl_vertex::version | ( | ) | const |
Return IO version number;.
Definition at line 241 of file bgrl_vertex.cxx.
friend class bgrl_graph [friend] |
Definition at line 35 of file bgrl_vertex.h.
vcl_set<bgrl_edge_sptr> bgrl_vertex::in_edges_ [protected] |
The pointers to incoming edges.
Definition at line 106 of file bgrl_vertex.h.
vcl_set<bgrl_edge_sptr> bgrl_vertex::out_edges_ [protected] |
The pointers to outgoing edges.
Definition at line 103 of file bgrl_vertex.h.