te::graph::Edge Class Reference

Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and destiny information, a set of properties if exist and flags to inform his state (new or dirty). More...

#include <Edge.h>

Public Member Functions

void addAttribute (int idx, te::dt::AbstractData *ad)
 Add a new attribute to this element. More...
 
 Edge (int id, int vFrom, int vTo, bool isNew=true)
 Constructor. More...
 
 Edge (te::graph::Edge *rhs)
 Copy constructor. More...
 
std::vector< te::dt::AbstractData * > & getAttributes ()
 It returns the vector of attributes associated with this element. More...
 
int getId ()
 It returns the edge identification. More...
 
int getIdFrom ()
 It returns the vertex origin identification. More...
 
int getIdTo ()
 It returns the vertex destiny identification. More...
 
bool isDirty ()
 Used to verify the edge state. More...
 
bool isNew ()
 Flag used to indicate that this element was a new one. More...
 
void removeAttribute (int idx)
 Remove a attribute associated with this element. More...
 
void setAttributeVecSize (int size)
 This function is used to set the number of attributes associated with the edge elements. More...
 
void setDirty (bool flag)
 Flag used to indicate that this element was changed. More...
 
 ~Edge ()
 Default destructor. More...
 

Protected Attributes

std::vector< te::dt::AbstractData * > m_attrs
 This is the list of all edge attributes. More...
 
bool m_dirty
 Flag used to indicate that edge was changed. More...
 
int m_edgeId
 This is the edge unique identifier. More...
 
bool m_new
 Flag used to indicate if this element is a new one. More...
 
int m_vertexIdFrom
 Origin vertex identifier from this edge. More...
 
int m_vertexIdTo
 Destiny vertex identifier from this edge. More...
 

Detailed Description

Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and destiny information, a set of properties if exist and flags to inform his state (new or dirty).

See also
AbstractGraph

Definition at line 58 of file Edge.h.

Constructor & Destructor Documentation

te::graph::Edge::Edge ( int  id,
int  vFrom,
int  vTo,
bool  isNew = true 
)

Constructor.

Parameters
idEdge identifier
vFromThe vertex origin Id
vToThe vertex destiny Id
isNewFlag used to indicate that the element is new
te::graph::Edge::Edge ( te::graph::Edge rhs)

Copy constructor.

te::graph::Edge::~Edge ( )

Default destructor.

Member Function Documentation

void te::graph::Edge::addAttribute ( int  idx,
te::dt::AbstractData ad 
)

Add a new attribute to this element.

Parameters
idxIndex of the new attribute (must be a valid position)
adAbstractData (can be any type of data)
std::vector<te::dt::AbstractData*>& te::graph::Edge::getAttributes ( )

It returns the vector of attributes associated with this element.

Returns
A vector of AbstractData (can be any type of data)
int te::graph::Edge::getId ( )

It returns the edge identification.

Returns
Integer value with the edge Id
int te::graph::Edge::getIdFrom ( )

It returns the vertex origin identification.

Returns
Integer value with the vertex Id
int te::graph::Edge::getIdTo ( )

It returns the vertex destiny identification.

Returns
Integer value with the vertex Id
bool te::graph::Edge::isDirty ( )

Used to verify the edge state.

Returns
Boolean value used to indicate the edge state
bool te::graph::Edge::isNew ( )

Flag used to indicate that this element was a new one.

Returns
Boolean value used to indicate the edge state
void te::graph::Edge::removeAttribute ( int  idx)

Remove a attribute associated with this element.

Parameters
idxIndex of the attribute (must be a valid position)
void te::graph::Edge::setAttributeVecSize ( int  size)

This function is used to set the number of attributes associated with the edge elements.

Parameters
sizeInteger value to define the attribute size
Note
Its important to use this method after a new property was associated to a edge Function defined in AbstractGraph addEdgeProperty.
void te::graph::Edge::setDirty ( bool  flag)

Flag used to indicate that this element was changed.

Parameters
flagBoolean value used to indicate the edge state

Member Data Documentation

std::vector<te::dt::AbstractData*> te::graph::Edge::m_attrs
protected

This is the list of all edge attributes.

Definition at line 168 of file Edge.h.

bool te::graph::Edge::m_dirty
protected

Flag used to indicate that edge was changed.

Definition at line 170 of file Edge.h.

int te::graph::Edge::m_edgeId
protected

This is the edge unique identifier.

Definition at line 162 of file Edge.h.

bool te::graph::Edge::m_new
protected

Flag used to indicate if this element is a new one.

Definition at line 172 of file Edge.h.

int te::graph::Edge::m_vertexIdFrom
protected

Origin vertex identifier from this edge.

Definition at line 164 of file Edge.h.

int te::graph::Edge::m_vertexIdTo
protected

Destiny vertex identifier from this edge.

Definition at line 166 of file Edge.h.


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