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

Definition at line 36 of file Vertex.cpp.

te::graph::Vertex::Vertex ( te::graph::Vertex rhs)

Copy constructor.

Definition at line 40 of file Vertex.cpp.

References getAttributes(), getId(), getNeighborhood(), getPredecessors(), and getSuccessors().

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

Default destructor.

Definition at line 60 of file Vertex.cpp.

References te::common::FreeContents().

Member Function Documentation

bool te::graph::Vertex::isDirty ( )

Used to verify the vertex state.

Returns
Boolean value used to indicate the vertex state

Definition at line 121 of file Vertex.cpp.

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

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

Definition at line 126 of file Vertex.cpp.

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

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

Remove a attribute associated with this element.

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

Definition at line 94 of file Vertex.cpp.

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

Definition at line 116 of file Vertex.cpp.

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

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