MorphoGraphX  2.0-1-227
Public Types | Public Member Functions | Static Public Attributes | Protected Attributes | List of all members
mgx::Edge< EdgeContent > Class Template Reference

#include <Edge.hpp>

Public Types

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

Public Member Functions

 Edge ()
 Creates a null edge. More...
 
 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. More...
 
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. More...
 
template<typename R >
const R & operator->* (R EdgeContent::*ptr) const
 Constant access to the data via pointer to member. More...
 
Edgeoperator= (const Edge &other)
 Change the reference help by the object. 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 operator< (const Edge &other) const
 Comparison operators. More...
 
bool isNull () const
 Test if an edge is null. More...
 
 operator bool () const
 Convert an edge to true if it is not null. More...
 
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. More...
 

Static Public Attributes

static Edge null
 

Protected Attributes

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

Detailed Description

template<typename EdgeContent>
class mgx::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 42 of file Edge.hpp.

Member Typedef Documentation

◆ content_t

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

Type of the content of the edge.

Definition at line 52 of file Edge.hpp.

◆ identity_t

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

Type of the identity of a vertex.

Definition at line 47 of file Edge.hpp.

◆ pointer

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

Type of the equivalent pointer.

Definition at line 57 of file Edge.hpp.

Constructor & Destructor Documentation

◆ Edge() [1/3]

template<typename EdgeContent >
mgx::Edge< EdgeContent >::Edge

Creates a null edge.

Definition at line 212 of file Edge.hpp.

◆ Edge() [2/3]

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

Definition at line 228 of file Edge.hpp.

◆ Edge() [3/3]

template<typename EdgeContent >
mgx::Edge< EdgeContent >::Edge ( const Edge< EdgeContent > &  copy)

Get a new weak reference on the copy.

Definition at line 220 of file Edge.hpp.

Member Function Documentation

◆ clear()

template<typename EdgeContent >
void mgx::Edge< EdgeContent >::clear ( )
inline

Reset an edge weak pointer to null.

Definition at line 185 of file Edge.hpp.

◆ isNull()

template<typename EdgeContent >
bool mgx::Edge< EdgeContent >::isNull ( ) const
inline

Test if an edge is null.

Definition at line 154 of file Edge.hpp.

◆ operator bool()

template<typename EdgeContent >
mgx::Edge< EdgeContent >::operator bool ( ) const
inline

Convert an edge to true if it is not null.

Definition at line 161 of file Edge.hpp.

◆ operator!=()

template<typename EdgeContent >
bool mgx::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 131 of file Edge.hpp.

◆ operator*()

template<typename EdgeContent >
EdgeContent& mgx::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 96 of file Edge.hpp.

◆ operator->()

template<typename EdgeContent >
EdgeContent* mgx::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 86 of file Edge.hpp.

◆ operator->*() [1/2]

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

Access to the data via pointer to member.

Definition at line 103 of file Edge.hpp.

◆ operator->*() [2/2]

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

Constant access to the data via pointer to member.

Definition at line 109 of file Edge.hpp.

◆ operator<()

template<typename EdgeContent >
bool mgx::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 147 of file Edge.hpp.

◆ operator=()

template<typename EdgeContent >
Edge< EdgeContent > & mgx::Edge< EdgeContent >::operator= ( const Edge< EdgeContent > &  other)

Change the reference help by the object.

Definition at line 235 of file Edge.hpp.

◆ operator==()

template<typename EdgeContent >
bool mgx::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 123 of file Edge.hpp.

◆ operator>()

template<typename EdgeContent >
bool mgx::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 139 of file Edge.hpp.

◆ source()

template<typename EdgeContent >
identity_t mgx::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 169 of file Edge.hpp.

◆ target()

template<typename EdgeContent >
identity_t mgx::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 178 of file Edge.hpp.

Member Data Documentation

◆ _content

template<typename EdgeContent >
EdgeContent* mgx::Edge< EdgeContent >::_content
protected

Content of the edge.

Definition at line 206 of file Edge.hpp.

◆ _source

template<typename EdgeContent >
identity_t mgx::Edge< EdgeContent >::_source
protected

Identity of the source of the edge.

Definition at line 198 of file Edge.hpp.

◆ _target

template<typename EdgeContent >
identity_t mgx::Edge< EdgeContent >::_target
protected

Identity of the target of the edge.

Definition at line 202 of file Edge.hpp.

◆ null

template<typename EdgeContent >
Edge< EdgeContent > mgx::Edge< EdgeContent >::null
static

Definition at line 192 of file Edge.hpp.


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