MorphoGraphX
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
mgx::graph::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.
 
typedef EdgeContent content_t
 
typedef Edge< EdgeContent > edge_t
 

Public Member Functions

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

Protected Attributes

identity_t _source
 
identity_t _target
 
EdgeContent * main
 
EdgeContent * other
 

Detailed Description

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

Member Function Documentation

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

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