All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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

Definition at line 34 of file Edge.cpp.

te::graph::Edge::Edge ( te::graph::Edge rhs)

Copy constructor.

Definition at line 43 of file Edge.cpp.

References getAttributes(), getId(), getIdFrom(), and getIdTo().

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

Default destructor.

Definition at line 61 of file Edge.cpp.

References te::common::FreeContents().

Member Function Documentation

std::vector< te::dt::AbstractData * > & te::graph::Edge::getAttributes ( )
int te::graph::Edge::getId ( )

It returns the edge identification.

Returns
Integer value with the edge Id

Definition at line 66 of file Edge.cpp.

Referenced by te::graph::DirectedGraph::add(), te::graph::UndirectedGraph::add(), te::graph::BidirectionalGraph::add(), te::graph::GraphData::addEdge(), Edge(), and te::sa::SkaterPartition::edgeToRemove().

bool te::graph::Edge::isDirty ( )

Used to verify the edge state.

Returns
Boolean value used to indicate the edge state

Definition at line 113 of file Edge.cpp.

Referenced by te::graph::GraphData::addEdge().

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

Definition at line 118 of file Edge.cpp.

Referenced by te::graph::GraphData::addEdge().

void te::graph::Edge::removeAttribute ( int  idx)

Remove a attribute associated with this element.

Parameters
idxIndex of the attribute (must be a valid position)

Definition at line 101 of file Edge.cpp.

void te::graph::Edge::setAttributeVecSize ( int  size)
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

Definition at line 108 of file Edge.cpp.

Referenced by te::graph::Graph::update().

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 files: