MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
mgx::graph::Edge< EdgeContent > Class Template Reference

Edge of a vv graph. More...

#include <Edge.hpp>

Public Types

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

Public Member Functions

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

Static Public Attributes

static Edge null
 

Protected Attributes

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

Detailed Description

template<typename EdgeContent>
class mgx::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.

Constructor & Destructor Documentation

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

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.

Member Function Documentation

template<typename EdgeContent>
bool mgx::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.
template<typename EdgeContent>
EdgeContent& mgx::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.
template<typename EdgeContent>
EdgeContent* mgx::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.
template<typename EdgeContent>
bool mgx::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.
template<typename EdgeContent>
bool mgx::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.
template<typename EdgeContent>
bool mgx::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.
template<typename EdgeContent>
identity_t mgx::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.
template<typename EdgeContent>
identity_t mgx::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.

The documentation for this class was generated from the following file: