Public Types | Public Member Functions | Protected Attributes

mln::util::vertex< G > Class Template Reference

Vertex of a graph G. More...

#include <vertex.hh>

Inheritance diagram for mln::util::vertex< G >:
Inheritance graph

List of all members.

Public Types

typedef Vertex< void > Category
 Object category.
typedef Site< void > category
typedef vertex< G > exact_t
typedef G graph_t
 Graph associated type.
typedef vertex_id_t id_t
 The vertex type id.
typedef vertex_id_t::value_t id_value_t
 The underlying type used to store vertex ids.

Public Member Functions

void change_graph (const G &g)
 Change the parent graph of that vertex.
edge< G > edge_with (const vertex< G > &v_id) const
 Returns true if this vertex has an edge with the given vertex.
const G & graph () const
 Returns the graph pointer this vertex belongs to.
const vertex_id_tid () const
 Returns the vertex id.
void invalidate ()
 Invalidate that vertex.
bool is_valid () const
 Check whether the vertex is still part of the graph.
edge_id_t ith_nbh_edge (unsigned i) const
 Returns the ith edge starting from this vertex.
vertex_id_t ith_nbh_vertex (unsigned i) const
 Returns the ith vertex adjacent to this vertex.
unsigned nmax_nbh_edges () const
 Returns the number max of edges starting from this vertex.
unsigned nmax_nbh_vertices () const
 Returns the number max of vertices adjacent to this vertex.
 operator vertex_id_t () const
 Conversion to the vertex id.
vertex_id_t other (const edge_id_t &id_e) const
 Returns the other vertex located on edge id_e.
void update_id (const vertex_id_t &id)
 Update the vertex id.

 vertex ()
 Constructors.
 vertex (const G &g)
 vertex (const G &g, const id_value_t &id)
 vertex (const G &g, const vertex_id_t &id)

Protected Attributes

g_
vertex_id_t id_

Detailed Description

template<typename G>
class mln::util::vertex< G >

Vertex of a graph G.

Definition at line 71 of file vertex.hh.


Member Typedef Documentation

template<typename G>
typedef Vertex<void> mln::util::vertex< G >::Category

Object category.

Definition at line 77 of file vertex.hh.

typedef Site<void> mln::Site< vertex< G > >::category [inherited]

Reimplemented from mln::Object< vertex< G > >.

Definition at line 57 of file site.hh.

typedef vertex< G > mln::Object< vertex< G > >::exact_t [inherited]

Definition at line 173 of file object.hh.

template<typename G>
typedef G mln::util::vertex< G >::graph_t

Graph associated type.

Definition at line 86 of file vertex.hh.

template<typename G>
typedef vertex_id_t mln::util::vertex< G >::id_t

The vertex type id.

Definition at line 83 of file vertex.hh.

template<typename G>
typedef vertex_id_t::value_t mln::util::vertex< G >::id_value_t

The underlying type used to store vertex ids.

Definition at line 80 of file vertex.hh.


Constructor & Destructor Documentation

template<typename G >
mln::util::vertex< G >::vertex (  )  [inline]

Constructors.

Definition at line 226 of file vertex.hh.

References mln::util::vertex< G >::invalidate().

template<typename G >
mln::util::vertex< G >::vertex ( const G &  g  )  [inline, explicit]

Definition at line 233 of file vertex.hh.

References mln::util::vertex< G >::invalidate().

template<typename G >
mln::util::vertex< G >::vertex ( const G &  g,
const id_value_t id 
) [inline]

Definition at line 241 of file vertex.hh.

References mln::util::vertex< G >::is_valid().

template<typename G >
mln::util::vertex< G >::vertex ( const G &  g,
const vertex_id_t id 
) [inline]

Definition at line 249 of file vertex.hh.

References mln::util::vertex< G >::is_valid().


Member Function Documentation

template<typename G >
void mln::util::vertex< G >::change_graph ( const G &  g  )  [inline]

Change the parent graph of that vertex.

Definition at line 331 of file vertex.hh.

References mln::util::vertex< G >::g_.

template<typename G >
edge< G > mln::util::vertex< G >::edge_with ( const vertex< G > &  v_id  )  const [inline]

Returns true if this vertex has an edge with the given vertex.

Definition at line 321 of file vertex.hh.

References mln::util::vertex< G >::g_, and mln::util::vertex< G >::id_.

template<typename G >
const G & mln::util::vertex< G >::graph (  )  const [inline]

Returns the graph pointer this vertex belongs to.

Definition at line 348 of file vertex.hh.

References mln::util::vertex< G >::g_.

Referenced by mln::p_vertices< G, F >::has(), mln::util::line_graph< G >::has(), and mln::util::operator==().

template<typename G >
const vertex_id_t & mln::util::vertex< G >::id (  )  const [inline]
template<typename G >
void mln::util::vertex< G >::invalidate (  )  [inline]

Invalidate that vertex.

Definition at line 266 of file vertex.hh.

References mln::util::vertex< G >::id_.

Referenced by mln::util::vertex< G >::vertex().

template<typename G >
bool mln::util::vertex< G >::is_valid (  )  const [inline]

Check whether the vertex is still part of the graph.

Definition at line 258 of file vertex.hh.

References mln::util::vertex< G >::g_, and mln::util::vertex< G >::id_.

Referenced by mln::p_vertices< G, F >::has(), and mln::util::vertex< G >::vertex().

template<typename G >
edge_id_t mln::util::vertex< G >::ith_nbh_edge ( unsigned  i  )  const [inline]

Returns the ith edge starting from this vertex.

Definition at line 285 of file vertex.hh.

References mln::util::vertex< G >::g_, and mln::util::vertex< G >::id_.

template<typename G >
vertex_id_t mln::util::vertex< G >::ith_nbh_vertex ( unsigned  i  )  const [inline]

Returns the ith vertex adjacent to this vertex.

Definition at line 303 of file vertex.hh.

References mln::util::vertex< G >::g_, and mln::util::vertex< G >::id_.

Referenced by mln::canvas::browsing::internal::graph_first_search_t< E, C >::operator()().

template<typename G >
unsigned mln::util::vertex< G >::nmax_nbh_edges (  )  const [inline]

Returns the number max of edges starting from this vertex.

If g_ is a sub graph of another graph, nmax will be retrived from the initial graph.

Definition at line 294 of file vertex.hh.

References mln::util::vertex< G >::g_, and mln::util::vertex< G >::id_.

template<typename G >
unsigned mln::util::vertex< G >::nmax_nbh_vertices (  )  const [inline]

Returns the number max of vertices adjacent to this vertex.

Definition at line 312 of file vertex.hh.

References mln::util::vertex< G >::g_, and mln::util::vertex< G >::id_.

Referenced by mln::canvas::browsing::internal::graph_first_search_t< E, C >::operator()().

template<typename G >
mln::util::vertex< G >::operator vertex_id_t (  )  const [inline]

Conversion to the vertex id.

FIXME: May cause ambiguities... :(

Definition at line 363 of file vertex.hh.

References mln::util::vertex< G >::id_.

template<typename G >
vertex_id_t mln::util::vertex< G >::other ( const edge_id_t id_e  )  const [inline]

Returns the other vertex located on edge id_e.

Definition at line 274 of file vertex.hh.

References mln::util::vertex< G >::g_, and mln::util::vertex< G >::id_.

template<typename G >
void mln::util::vertex< G >::update_id ( const vertex_id_t id  )  [inline]

Update the vertex id.

Definition at line 340 of file vertex.hh.

References mln::util::vertex< G >::id_.


Member Data Documentation

template<typename G>
G mln::util::vertex< G >::g_ [protected]
template<typename G>
vertex_id_t mln::util::vertex< G >::id_ [protected]