graph::Edge< EdgeContent > Class Template Reference

Edge of a vv graph. More...

#include <graph/edge.h>

List of all members.

Public Types

typedef EdgeContent content_t
 Type of the content of the edge.
typedef edge_identity_t identity_t
 Type of the identity of a vertex.
typedef EdgeContent * pointer
 Type of the equivalent pointer.

Public Member Functions

void clear ()
 Reset an edge weak pointer to null.
 Edge (const Edge &copy)
 Get a new weak reference on the copy.
 Edge (identity_t src, identity_t tgt, EdgeContent *content)
 Creates an edge from src to tgt with a given content.
 Edge ()
 Creates a null edge.
bool isNull () const
 Test if an edge is null.
 operator bool () const
 Convert an edge to true if it is not null.
bool operator!= (const Edge &other) const
 Comparison operators.
EdgeContent & operator* () const
 Data access.
EdgeContent * operator-> () const
 Data access.
template<typename R >
const R & operator->* (R EdgeContent::*ptr) const
 Constant access to the data via pointer to member.
template<typename R >
R & operator->* (R EdgeContent::*ptr)
 Access to the data via pointer to member.
bool operator< (const Edge &other) const
 Comparison operators.
bool operator<= (const Edge &other) const
 Comparison operators.
Edgeoperator= (const Edge &other)
 Change the reference help by the object.
bool operator== (const Edge &other) const
 Comparison operators.
bool operator> (const Edge &other) const
 Comparison operators.
bool operator>= (const Edge &other) const
 Comparison operators.
bool serialize (storage::VVEStorage &)
 Serialization method.
identity_t source () const
 Returns the identifier of the source of the edge.
identity_t target () const
 Returns the identifier of the target of the edge.

Static Public Attributes

static Edge null

Protected Attributes

EdgeContent * _content
 Content of the edge.
identity_t _source
 Identity of the source of the edge.
identity_t _target
 Identity of the target of the edge.

Detailed Description

template<typename EdgeContent>
class graph::Edge< EdgeContent >

Edge of a vv graph.

The edges represent weak references on the edges data. The data are owned by the graph. You must never try to access an edge that was deleted from its graph.

Definition at line 33 of file edge.h.


Member Typedef Documentation

template<typename EdgeContent>
typedef EdgeContent graph::Edge< EdgeContent >::content_t

Type of the content of the edge.

Definition at line 44 of file edge.h.

template<typename EdgeContent>
typedef edge_identity_t graph::Edge< EdgeContent >::identity_t

Type of the identity of a vertex.

Definition at line 39 of file edge.h.

template<typename EdgeContent>
typedef EdgeContent* graph::Edge< EdgeContent >::pointer

Type of the equivalent pointer.

Definition at line 49 of file edge.h.


Constructor & Destructor Documentation

template<typename EdgeContent >
graph::Edge< EdgeContent >::Edge (  )  [inline]

Creates a null edge.

Definition at line 222 of file edge.h.

00223     : _source(0)
00224     , _target(0)
00225     , _content(0)
00226     { }

template<typename EdgeContent >
graph::Edge< EdgeContent >::Edge ( identity_t  src,
identity_t  tgt,
EdgeContent *  content 
) [inline]

Creates an edge from src to tgt with a given content.

The object do not take ownership of the content which must then be kept alive for as long as needed.

Note:
This function is meant to be used by the graph, not really by the user of the VV library.

Definition at line 236 of file edge.h.

00237     : _source(src)
00238     , _target(tgt)
00239     , _content(content)
00240     { }

template<typename EdgeContent >
graph::Edge< EdgeContent >::Edge ( const Edge< EdgeContent > &  copy  )  [inline]

Get a new weak reference on the copy.

Definition at line 229 of file edge.h.

00230     : _source(copy._source)
00231     , _target(copy._target)
00232     , _content(copy._content)
00233     { }


Member Function Documentation

template<typename EdgeContent>
void graph::Edge< EdgeContent >::clear (  )  [inline]

Reset an edge weak pointer to null.

Definition at line 185 of file edge.h.

References graph::Edge< EdgeContent >::_content, graph::Edge< EdgeContent >::_source, and graph::Edge< EdgeContent >::_target.

00186       {
00187         _source = 0;
00188         _target = 0;
00189         _content = 0;
00190       }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::isNull (  )  const [inline]
template<typename EdgeContent>
graph::Edge< EdgeContent >::operator bool (  )  const [inline]

Convert an edge to true if it is not null.

Definition at line 165 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00165 { return _content != 0; }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::operator!= ( const Edge< EdgeContent > &  other  )  const [inline]

Comparison operators.

Note:
The comparison is done on the identity of the edge, not the content.

Definition at line 130 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00130 { return _content != other._content; }

template<typename EdgeContent>
EdgeContent& graph::Edge< EdgeContent >::operator* (  )  const [inline]

Data access.

Warning:
Do not try to access the data of the null edge or of an edge that does not exist anymore in its graph.

Definition at line 90 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00090 { return *_content; }

template<typename EdgeContent>
EdgeContent* graph::Edge< EdgeContent >::operator-> (  )  const [inline]

Data access.

Warning:
Do not try to access the data of the null edge or of an edge that does not exist anymore in its graph.

Definition at line 82 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00082 { return _content; }

template<typename EdgeContent>
template<typename R >
const R& graph::Edge< EdgeContent >::operator->* ( R EdgeContent::*  ptr  )  const [inline]

Constant access to the data via pointer to member.

Definition at line 104 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00105         {
00106           return _content->*ptr;
00107         }

template<typename EdgeContent>
template<typename R >
R& graph::Edge< EdgeContent >::operator->* ( R EdgeContent::*  ptr  )  [inline]

Access to the data via pointer to member.

Definition at line 96 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00097         {
00098           return _content->*ptr;
00099         }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::operator< ( const Edge< EdgeContent > &  other  )  const [inline]

Comparison operators.

Note:
The comparison is done on the identity of the edge, not the content.

Definition at line 142 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00142 { return _content < other._content; }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::operator<= ( const Edge< EdgeContent > &  other  )  const [inline]

Comparison operators.

Note:
The comparison is done on the identity of the edge, not the content.

Definition at line 155 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00155 { return _content <= other._content; }

template<typename EdgeContent >
Edge< EdgeContent > & graph::Edge< EdgeContent >::operator= ( const Edge< EdgeContent > &  other  )  [inline]

Change the reference help by the object.

Definition at line 243 of file edge.h.

References graph::Edge< EdgeContent >::_content, graph::Edge< EdgeContent >::_source, and graph::Edge< EdgeContent >::_target.

00244     {
00245       _source = other._source;
00246       _target = other._target;
00247       _content = other._content;
00248       return *this;
00249     }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::operator== ( const Edge< EdgeContent > &  other  )  const [inline]

Comparison operators.

Note:
The comparison is done on the identity of the edge, not the content.

Definition at line 124 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00124 { return _content == other._content; }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::operator> ( const Edge< EdgeContent > &  other  )  const [inline]

Comparison operators.

Note:
The comparison is done on the identity of the edge, not the content.

Definition at line 136 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00136 { return _content > other._content; }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::operator>= ( const Edge< EdgeContent > &  other  )  const [inline]

Comparison operators.

Note:
The comparison is done on the identity of the edge, not the content.

Definition at line 149 of file edge.h.

References graph::Edge< EdgeContent >::_content.

00149 { return _content >= other._content; }

template<typename EdgeContent>
bool graph::Edge< EdgeContent >::serialize ( storage::VVEStorage  ) 

Serialization method.

Warning:
You need to include <storage/graph.h> to use this serialization method
template<typename EdgeContent>
identity_t graph::Edge< EdgeContent >::source (  )  const [inline]

Returns the identifier of the source of the edge.

Note:
You should rather use the VVGraph::source() method that returns the source vertex.

Definition at line 173 of file edge.h.

References graph::Edge< EdgeContent >::_source.

Referenced by graph::VVGraph< RESOLVE_LEAF_CLASS(LeafClass, Tissue< ALL_COMPLEX_TEMPLATE_ARGS >), graph::_EmptyEdgeContent, false >::source(), and graph::VVBiGraph< typename cell::content_t, typename junction::content_t >::source().

00173 { return _source; }

template<typename EdgeContent>
identity_t graph::Edge< EdgeContent >::target (  )  const [inline]

Returns the identifier of the target of the edge.

Note:
You should rather use the VVGraph::target() method that returns the target vertex.

Definition at line 180 of file edge.h.

References graph::Edge< EdgeContent >::_target.

Referenced by graph::VVGraph< RESOLVE_LEAF_CLASS(LeafClass, Tissue< ALL_COMPLEX_TEMPLATE_ARGS >), graph::_EmptyEdgeContent, false >::target(), and graph::VVBiGraph< typename cell::content_t, typename junction::content_t >::target().

00180 { return _target; }


Member Data Documentation

template<typename EdgeContent>
EdgeContent* graph::Edge< EdgeContent >::_content [protected]
template<typename EdgeContent>
identity_t graph::Edge< EdgeContent >::_source [protected]

Identity of the source of the edge.

Definition at line 206 of file edge.h.

Referenced by graph::Edge< EdgeContent >::clear(), graph::Edge< EdgeContent >::operator=(), and graph::Edge< EdgeContent >::source().

template<typename EdgeContent>
identity_t graph::Edge< EdgeContent >::_target [protected]

Identity of the target of the edge.

Definition at line 210 of file edge.h.

Referenced by graph::Edge< EdgeContent >::clear(), graph::Edge< EdgeContent >::operator=(), and graph::Edge< EdgeContent >::target().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines
Generated on Fri May 31 15:38:08 2013 for VVE by  doxygen 1.6.3