All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
te::graph::AbstractGraph Class Referenceabstract

Abstract class used to define the main functions of graph struct. All graph implementations must used this class. More...

#include <AbstractGraph.h>

Inheritance diagram for te::graph::AbstractGraph:
te::graph::Graph te::graph::BidirectionalGraph te::graph::DirectedGraph te::graph::UndirectedGraph

Public Member Functions

 AbstractGraph ()
 Default constructor. More...
 
virtual void flush ()=0
 Function used to clear the memory cache, all elements was released from memory, if any element was changes it will be saved. More...
 
te::graph::AbstractIteratorgetIterator ()
 Used to get a iterator associated to graph. More...
 
virtual te::graph::GraphMetadatagetMetadata ()=0
 Function used to access the graph metadata. More...
 
void setIterator (te::graph::AbstractIterator *i)
 Used to associate a iterator to graph. More...
 
virtual ~AbstractGraph ()
 Virtual destructor. More...
 
Vertex Access Methods

Method used to access vertex elements from a graph.

virtual void add (Vertex *v)=0
 Add a new vertex element to a graph. More...
 
virtual void update (Vertex *v)=0
 Update the vertex element. More...
 
virtual void removeVertex (int id)=0
 This function removes the vertex element from graph, also was removed in data source. More...
 
virtual te::graph::VertexgetVertex (int id)=0
 It returns the vertex element if it's exist. More...
 
virtual te::graph::VertexgetFirstVertex ()
 It returns a pointer to the first vertex element of a graph. More...
 
virtual te::graph::VertexgetNextVertex ()
 It returns a pointer to the next vertex element of a graph. More...
 
virtual te::graph::VertexgetPreviousVertex ()
 It returns a pointer to the previous vertex element of a graph. More...
 
virtual void addVertexProperty (te::dt::Property *p)=0
 Add a new property associated to the vertex element. More...
 
virtual void removeVertexProperty (int idx)=0
 Remove a property associated to the vertex element. More...
 
virtual te::dt::PropertygetVertexProperty (int idx)=0
 Get a vertex property given a index. More...
 
virtual int getVertexPropertySize ()=0
 Used to verify the number of properties associated to vertex elements. More...
 
Edge Access Methods

Method used to access edge elements from a graph.

virtual void add (Edge *e)=0
 Add a new edge element to a graph. More...
 
virtual void update (Edge *e)=0
 Update the edge element. More...
 
virtual void removeEdge (int id)=0
 This function removes the edge element from graph, also was removed in data source. More...
 
virtual te::graph::EdgegetEdge (int id)=0
 It returns the edge element if it's exist. More...
 
te::graph::EdgegetFirstEdge ()
 It returns a pointer to the first edge element of a graph. More...
 
te::graph::EdgegetNextEdge ()
 It returns a pointer to the next edge element of a graph. More...
 
te::graph::EdgegetPreviousEdge ()
 It returns a pointer to the previous edge element of a graph. More...
 
virtual void addEdgeProperty (te::dt::Property *p)=0
 Add a new property associated to the edge element. More...
 
virtual void removeEdgeProperty (int idx)=0
 Remove a property associated to the edge element. More...
 
virtual te::dt::PropertygetEdgeProperty (int idx)=0
 Get a edge property given a index. More...
 
virtual int getEdgePropertySize ()=0
 Used to verify the number of properties associated to edge elements. More...
 

Protected Attributes

te::graph::AbstractIteratorm_iterator
 Iterator attribute. More...
 

Detailed Description

Abstract class used to define the main functions of graph struct. All graph implementations must used this class.

Definition at line 56 of file AbstractGraph.h.

Constructor & Destructor Documentation

te::graph::AbstractGraph::AbstractGraph ( )

Default constructor.

Definition at line 34 of file AbstractGraph.cpp.

te::graph::AbstractGraph::~AbstractGraph ( )
virtual

Virtual destructor.

Definition at line 39 of file AbstractGraph.cpp.

Member Function Documentation

virtual void te::graph::AbstractGraph::add ( Vertex v)
pure virtual
virtual void te::graph::AbstractGraph::add ( Edge e)
pure virtual

Add a new edge element to a graph.

Parameters
eEdge element
Note
This function turns the dirty flag of current GraphData to true, the new flag of the edge turns to true.

Implemented in te::graph::Graph, te::graph::BidirectionalGraph, te::graph::UndirectedGraph, and te::graph::DirectedGraph.

virtual void te::graph::AbstractGraph::addEdgeProperty ( te::dt::Property p)
pure virtual

Add a new property associated to the edge element.

param p New property to be associated with edge elements.

Note
It's important before using this function call the flush() function, its necessary to force the memory clear and the elements will be loaded with the right size of properties.

Implemented in te::graph::Graph.

virtual void te::graph::AbstractGraph::addVertexProperty ( te::dt::Property p)
pure virtual

Add a new property associated to the vertex element.

param p New property to be associated with vertex elements.

Note
It's important before using this function call the flush() function, its necessary to force the memory clear and the elements will be loaded with the right size of properties.

Implemented in te::graph::Graph.

Referenced by te::graph::AddRasterAttribute::AddRasterAttribute().

virtual void te::graph::AbstractGraph::flush ( )
pure virtual

Function used to clear the memory cache, all elements was released from memory, if any element was changes it will be saved.

Returns

Implemented in te::graph::Graph.

Referenced by te::graph::AddRasterAttribute::AddRasterAttribute().

virtual te::graph::Edge* te::graph::AbstractGraph::getEdge ( int  id)
pure virtual

It returns the edge element if it's exist.

Parameters
idVertex identification
Returns
A valid vertex point if the element was found and a null pointer in other case.

Implemented in te::graph::Graph.

virtual te::dt::Property* te::graph::AbstractGraph::getEdgeProperty ( int  idx)
pure virtual

Get a edge property given a index.

Parameters
idxIndex of the property
Returns
A property associated to the edge element if the index is right and a null pointer in other case.

Implemented in te::graph::Graph.

Referenced by te::graph::LayerRenderer::checkEdgeGeometryProperty().

virtual int te::graph::AbstractGraph::getEdgePropertySize ( )
pure virtual

Used to verify the number of properties associated to edge elements.

Returns
Integer value with the number of properties.

Implemented in te::graph::Graph.

Referenced by te::graph::QueryGraphBuilder::build(), and te::graph::LayerRenderer::checkEdgeGeometryProperty().

te::graph::Edge * te::graph::AbstractGraph::getFirstEdge ( )

It returns a pointer to the first edge element of a graph.

Note
This function is not implemented here, it's just a call to a iterator function.
Returns
A valid edge point if the element was found and a null pointer in other case.

Definition at line 73 of file AbstractGraph.cpp.

References TR_GRAPH.

Referenced by te::graph::QueryGraphBuilder::build(), and te::graph::LayerRenderer::draw().

te::graph::Vertex * te::graph::AbstractGraph::getFirstVertex ( )
virtual

It returns a pointer to the first vertex element of a graph.

Note
This function is not implemented here, it's just a call to a iterator function.
Returns
A valid vertex point if the element was found and a null pointer in other case.

Definition at line 43 of file AbstractGraph.cpp.

References TR_GRAPH.

Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), and te::graph::QueryGraphBuilder::build().

te::graph::AbstractIterator * te::graph::AbstractGraph::getIterator ( )

Used to get a iterator associated to graph.

Returns
Valid pointer to a iterator if exist and null pointer in other case

Definition at line 108 of file AbstractGraph.cpp.

Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), te::graph::QueryGraphBuilder::build(), and te::graph::LayerRenderer::draw().

te::graph::Edge * te::graph::AbstractGraph::getNextEdge ( )

It returns a pointer to the next edge element of a graph.

Note
This function is not implemented here, it's just a call to a iterator function.
Returns
A valid edge point if the element was found and a null pointer in other case.

Definition at line 83 of file AbstractGraph.cpp.

References TR_GRAPH.

Referenced by te::graph::QueryGraphBuilder::build(), and te::graph::LayerRenderer::draw().

te::graph::Vertex * te::graph::AbstractGraph::getNextVertex ( )
virtual

It returns a pointer to the next vertex element of a graph.

Note
This function is not implemented here, it's just a call to a iterator function.
Returns
A valid vertex point if the element was found and a null pointer in other case.

Definition at line 53 of file AbstractGraph.cpp.

References TR_GRAPH.

Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), and te::graph::QueryGraphBuilder::build().

te::graph::Edge * te::graph::AbstractGraph::getPreviousEdge ( )

It returns a pointer to the previous edge element of a graph.

Note
This function is not implemented here, it's just a call to a iterator function.
Returns
A valid edge point if the element was found and a null pointer in other case.

Definition at line 93 of file AbstractGraph.cpp.

References TR_GRAPH.

te::graph::Vertex * te::graph::AbstractGraph::getPreviousVertex ( )
virtual

It returns a pointer to the previous vertex element of a graph.

Note
This function is not implemented here, it's just a call to a iterator function.
Returns
A valid vertex point if the element was found and a null pointer in other case.

Definition at line 63 of file AbstractGraph.cpp.

References TR_GRAPH.

virtual te::graph::Vertex* te::graph::AbstractGraph::getVertex ( int  id)
pure virtual

It returns the vertex element if it's exist.

Parameters
idVertex identification
Returns
A valid vertex point if the element was found and a null pointer in other case.

Implemented in te::graph::Graph.

Referenced by te::graph::LayerRenderer::draw().

virtual te::dt::Property* te::graph::AbstractGraph::getVertexProperty ( int  idx)
pure virtual

Get a vertex property given a index.

Parameters
idxIndex of the property
Returns
A property associated to the vertex element if the index is right and a null pointer in other case.

Implemented in te::graph::Graph.

Referenced by te::graph::AddRasterAttribute::AddRasterAttribute(), and te::graph::LayerRenderer::checkVertexGeometryProperty().

virtual int te::graph::AbstractGraph::getVertexPropertySize ( )
pure virtual

Used to verify the number of properties associated to vertex elements.

Returns
Integer value with the number of properties.

Implemented in te::graph::Graph.

Referenced by te::graph::AddRasterAttribute::AddRasterAttribute(), te::graph::QueryGraphBuilder::build(), and te::graph::LayerRenderer::checkVertexGeometryProperty().

virtual void te::graph::AbstractGraph::removeEdge ( int  id)
pure virtual

This function removes the edge element from graph, also was removed in data source.

Parameters
idEdge identification

Implemented in te::graph::Graph, te::graph::BidirectionalGraph, te::graph::UndirectedGraph, and te::graph::DirectedGraph.

virtual void te::graph::AbstractGraph::removeEdgeProperty ( int  idx)
pure virtual

Remove a property associated to the edge element.

Parameters
idxIndex of the property

Implemented in te::graph::Graph.

virtual void te::graph::AbstractGraph::removeVertex ( int  id)
pure virtual

This function removes the vertex element from graph, also was removed in data source.

Parameters
idVertex identification

Implemented in te::graph::Graph.

virtual void te::graph::AbstractGraph::removeVertexProperty ( int  idx)
pure virtual

Remove a property associated to the vertex element.

Parameters
idxIndex of the property

Implemented in te::graph::Graph.

void te::graph::AbstractGraph::setIterator ( te::graph::AbstractIterator i)

Used to associate a iterator to graph.

Parameters
iValid pointer to a iterator

Definition at line 103 of file AbstractGraph.cpp.

Referenced by te::graph::AddDeepAttribute::AddDeepAttribute(), te::graph::AddRasterAttribute::AddRasterAttribute(), te::graph::QueryGraphBuilder::build(), and te::graph::LayerRenderer::draw().

virtual void te::graph::AbstractGraph::update ( Vertex v)
pure virtual

Update the vertex element.

Parameters
vVertex element
Note
This function turns the dirty flag of current GraphData to true and also the dirty flag of the vertex.

Implemented in te::graph::Graph.

Referenced by te::graph::AddRasterAttribute::AddRasterAttribute().

virtual void te::graph::AbstractGraph::update ( Edge e)
pure virtual

Update the edge element.

Parameters
eEdge element
Note
This function turns the dirty flag of current GraphData to true and also the dirty flag of the edge.

Implemented in te::graph::Graph.

Member Data Documentation

te::graph::AbstractIterator* te::graph::AbstractGraph::m_iterator
protected

Iterator attribute.

Definition at line 322 of file AbstractGraph.h.


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