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

Type of a undirected edge (or arc) More...

#include <Edge.hpp>

Public Types

typedef edge_identity_t identity_t
 Type of the identity of a vertex. More...
 
typedef EdgeContent content_t
 
typedef Edge< EdgeContent > edge_t
 

Public Member Functions

 Arc ()
 Cosntruct an empty (null) arc. More...
 
 Arc (const Arc &copy)
 Copy constructor. More...
 
 Arc (identity_t src, identity_t tgt, EdgeContent *c1, EdgeContent *c2)
 Full constructor -> should never be called by the user. More...
 
 operator edge_t () const
 Convert the current arc into the corresponding edge. More...
 
Arc inv () const
 Synchronize the edges and returns the opposite arc. More...
 
Arc operator- () const
 Unary '-' operator synchronize edges and returns opposite arc. More...
 
 ~Arc ()
 Destroy and copy the content of the arcs. More...
 
bool isNull () const
 Test if the content is null. More...
 
 operator bool () const
 AN arc evaluates to true if it contains some data. More...
 
EdgeContent & operator* () const
 Reference the content of the arc. More...
 
EdgeContent * operator-> () const
 Reference the content of the arc as a pointer. 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 sync () const
 Synchronize both sides of the arc. More...
 

Protected Attributes

identity_t _source
 
identity_t _target
 
EdgeContent * main
 
EdgeContent * other
 

Detailed Description

template<typename EdgeContent>
struct mgx::Arc< EdgeContent >

Type of a undirected edge (or arc)

When an arc is destroyed, the content of the main edge is copied in the other one.

Note that you should never keep an arc! Is is meant for temporary usage. This is why there is no copy constructor or operator=.

Definition at line 260 of file Edge.hpp.

Member Typedef Documentation

◆ content_t

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

Definition at line 266 of file Edge.hpp.

◆ edge_t

template<typename EdgeContent >
typedef Edge<EdgeContent> mgx::Arc< EdgeContent >::edge_t

Definition at line 268 of file Edge.hpp.

◆ identity_t

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

Type of the identity of a vertex.

Definition at line 264 of file Edge.hpp.

Constructor & Destructor Documentation

◆ Arc() [1/3]

template<typename EdgeContent >
mgx::Arc< EdgeContent >::Arc

Cosntruct an empty (null) arc.

Definition at line 368 of file Edge.hpp.

◆ Arc() [2/3]

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

Copy constructor.

Definition at line 386 of file Edge.hpp.

◆ Arc() [3/3]

template<typename EdgeContent >
mgx::Arc< EdgeContent >::Arc ( identity_t  src,
identity_t  tgt,
EdgeContent *  c1,
EdgeContent *  c2 
)

Full constructor -> should never be called by the user.

Definition at line 377 of file Edge.hpp.

◆ ~Arc()

template<typename EdgeContent >
mgx::Arc< EdgeContent >::~Arc ( )
inline

Destroy and copy the content of the arcs.

Definition at line 305 of file Edge.hpp.

Member Function Documentation

◆ inv()

template<typename EdgeContent >
Arc< EdgeContent > mgx::Arc< EdgeContent >::inv

Synchronize the edges and returns the opposite arc.

Definition at line 394 of file Edge.hpp.

◆ isNull()

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

Test if the content is null.

Definition at line 312 of file Edge.hpp.

◆ operator bool()

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

AN arc evaluates to true if it contains some data.

Definition at line 319 of file Edge.hpp.

◆ operator edge_t()

template<typename EdgeContent >
mgx::Arc< EdgeContent >::operator edge_t ( ) const
inline

Convert the current arc into the corresponding edge.

Definition at line 288 of file Edge.hpp.

◆ operator*()

template<typename EdgeContent >
EdgeContent& mgx::Arc< EdgeContent >::operator* ( ) const
inline

Reference the content of the arc.

Definition at line 324 of file Edge.hpp.

◆ operator-()

template<typename EdgeContent >
Arc mgx::Arc< EdgeContent >::operator- ( ) const
inline

Unary '-' operator synchronize edges and returns opposite arc.

Definition at line 298 of file Edge.hpp.

◆ operator->()

template<typename EdgeContent >
EdgeContent* mgx::Arc< EdgeContent >::operator-> ( ) const
inline

Reference the content of the arc as a pointer.

Definition at line 330 of file Edge.hpp.

◆ source()

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

◆ sync()

template<typename EdgeContent >
void mgx::Arc< EdgeContent >::sync ( ) const
inline

Synchronize both sides of the arc.

Definition at line 356 of file Edge.hpp.

◆ target()

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

Member Data Documentation

◆ _source

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

Definition at line 363 of file Edge.hpp.

◆ _target

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

Definition at line 363 of file Edge.hpp.

◆ main

template<typename EdgeContent >
EdgeContent* mgx::Arc< EdgeContent >::main
mutableprotected

Definition at line 364 of file Edge.hpp.

◆ other

template<typename EdgeContent >
EdgeContent * mgx::Arc< EdgeContent >::other
protected

Definition at line 364 of file Edge.hpp.


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