te::graph::Vertex Class Reference

From the point of view of graph theory, vertices are treated as featureless and indivisible objects, although they may have additional structure depending on the application from which the graph arises;for instance, a semantic network is a graph in which the vertices represent concepts or classes of objects. More...

#include <Vertex.h>

Public Member Functions

int getId ()
 It returns the vertex id. More...
 
 Vertex (int id, bool isNew=true)
 Constructor. More...
 
 Vertex (te::graph::Vertex *rhs)
 Copy constructor. More...
 
 ~Vertex ()
 Default destructor. More...
 
Vertex Attribute Methods

Method used to manager attributes from vertex object.

std::vector< te::dt::AbstractData * > & getAttributes ()
 It returns the vector of attributes associated with this element. More...
 
void setAttributeVecSize (int size)
 This function is used to set the number of attributes associated with the vertex elements. More...
 
void addAttribute (int idx, te::dt::AbstractData *ad)
 Add a new attribute to this element. More...
 
void removeAttribute (int idx)
 Remove a attribute associated with this element. More...
 
std::set< int > & getPredecessors ()
 Returns the Predecessors vector. More...
 
std::set< int > & getSuccessors ()
 Returns the Successors vector. More...
 
std::set< int > & getNeighborhood ()
 Returns the Neighborhood vector. More...
 
void setDirty (bool flag)
 Flag used to indicate that this element was changed. More...
 
bool isDirty ()
 Used to verify the vertex state. More...
 
bool isNew ()
 Flag used to indicate that this element was a new one. More...
 

Protected Attributes

std::vector< te::dt::AbstractData * > m_attrs
 This is the list of all vertex attributes. More...
 
bool m_dirty
 Flag used to indicate that vertex was changed. More...
 
std::set< int > m_neighborhood
 List of all neighbors edges (used in undirectional graph). More...
 
bool m_new
 Flag used to indicate if this element is a new one. More...
 
std::set< int > m_predecessors
 List of all input edges (used in bidirectional graph). More...
 
std::set< int > m_successors
 List of all output edges (used in directional graph). More...
 
int m_vertexId
 This is the vertex unique identifier. More...
 

Detailed Description

From the point of view of graph theory, vertices are treated as featureless and indivisible objects, although they may have additional structure depending on the application from which the graph arises;for instance, a semantic network is a graph in which the vertices represent concepts or classes of objects.

Note
The neighbour informartion has to be defined in a appropriated graph implementation.

Definition at line 68 of file Vertex.h.

Constructor & Destructor Documentation

te::graph::Vertex::Vertex ( int  id,
bool  isNew = true 
)

Constructor.

Parameters
idThe vertex identifier
isNewFlag used to indicate that the element is new
te::graph::Vertex::Vertex ( te::graph::Vertex rhs)

Copy constructor.

te::graph::Vertex::~Vertex ( )

Default destructor.

Member Function Documentation

void te::graph::Vertex::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::Vertex::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::Vertex::getId ( )

It returns the vertex id.

Returns
Integer with the vertex identifier
std::set<int>& te::graph::Vertex::getNeighborhood ( )

Returns the Neighborhood vector.

Note
This information only will be defined in the apropriated graph type
Returns
std::vector<int> reference
std::set<int>& te::graph::Vertex::getPredecessors ( )

Returns the Predecessors vector.

Note
This information only will be defined in the apropriated graph type
Returns
std::vector<int> reference
std::set<int>& te::graph::Vertex::getSuccessors ( )

Returns the Successors vector.

Note
This information only will be defined in the apropriated graph type
Returns
std::vector<int> reference
bool te::graph::Vertex::isDirty ( )

Used to verify the vertex state.

Returns
Boolean value used to indicate the vertex state
bool te::graph::Vertex::isNew ( )

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

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

Remove a attribute associated with this element.

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

This function is used to set the number of attributes associated with the vertex 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::Vertex::setDirty ( bool  flag)

Flag used to indicate that this element was changed.

Parameters
flagBoolean value used to indicate the vertex state

Member Data Documentation

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

This is the list of all vertex attributes.

Definition at line 193 of file Vertex.h.

bool te::graph::Vertex::m_dirty
protected

Flag used to indicate that vertex was changed.

Definition at line 201 of file Vertex.h.

std::set<int> te::graph::Vertex::m_neighborhood
protected

List of all neighbors edges (used in undirectional graph).

Definition at line 199 of file Vertex.h.

bool te::graph::Vertex::m_new
protected

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

Definition at line 203 of file Vertex.h.

std::set<int> te::graph::Vertex::m_predecessors
protected

List of all input edges (used in bidirectional graph).

Definition at line 195 of file Vertex.h.

std::set<int> te::graph::Vertex::m_successors
protected

List of all output edges (used in directional graph).

Definition at line 197 of file Vertex.h.

int te::graph::Vertex::m_vertexId
protected

This is the vertex unique identifier.

Definition at line 191 of file Vertex.h.


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