All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
te::graph::UndirectedGraph Class Reference

This is a implementation of a UndirectedGraph Graph. By definition a undirected graph has no direction information about his edges. More...

#include <UndirectedGraph.h>

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

Public Member Functions

virtual void flush ()
 Function used to clear the memory cache, all elements was released from memory, if any element was changes it will be saved. More...
 
virtual te::graph::GraphMetadatagetMetadata ()
 Function used to access the graph metadata. More...
 
 UndirectedGraph ()
 constructor. More...
 
 UndirectedGraph (GraphMetadata *metadata)
 Constructor. More...
 
 UndirectedGraph (AbstractCachePolicy *cp, AbstractGraphLoaderStrategy *ls)
 Constructor. More...
 
 ~UndirectedGraph ()
 Virtual destructor. More...
 
Vertex Access Methods

Method used to access vertex elements from a graph.

virtual std::vector
< te::graph::Vertex * > 
getVertexNeighborhood (int id)
 The neighborhood of a vertex v is an induced subgraph of the graph, formed by all vertices adjacent to v. More...
 
virtual bool isIsolateVertex (int id, bool &flag)
 This function indicates if a desired element is a isolated vertex. More...
 
Edge Access Methods

Method used to access edge elements from a graph.

virtual void add (Edge *e)
 Add a new edge element to a graph. More...
 
virtual void removeEdge (int id)
 This function removes the edge element from graph, also was removed in data source. More...
 
virtual std::vector
< te::graph::Edge * > 
getEdges (int vId)
 It returns all edges that belongs to a vertex. More...
 
Vertex Access Methods

Method used to access vertex elements from a graph.

virtual void add (Vertex *v)
 Add a new vertex element to a graph. More...
 
virtual void update (Vertex *v)
 Update the vertex element. More...
 
virtual void removeVertex (int id)
 This function removes the vertex element from graph, also was removed in data source. More...
 
virtual te::graph::VertexgetVertex (int id)
 It returns the vertex element if it's exist. More...
 
virtual void addVertexProperty (te::dt::Property *p)
 Add a new property associated to the vertex element. More...
 
virtual void removeVertexProperty (int idx)
 Remove a property associated to the vertex element. More...
 
virtual te::dt::PropertygetVertexProperty (int idx)
 Get a vertex property given a index. More...
 
virtual int getVertexPropertySize ()
 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 update (Edge *e)
 Update the edge element. More...
 
virtual te::graph::EdgegetEdge (int id)
 It returns the edge element if it's exist. More...
 
virtual void addEdgeProperty (te::dt::Property *p)
 Add a new property associated to the edge element. More...
 
virtual void removeEdgeProperty (int idx)
 Remove a property associated to the edge element. More...
 
virtual te::dt::PropertygetEdgeProperty (int idx)
 Get a edge property given a index. More...
 
virtual int getEdgePropertySize ()
 Used to verify the number of properties associated to edge elements. More...
 

Public Attributes

GraphDatam_graphData
 This class has the graph data and properties. More...
 

Protected Attributes

GraphDataManagerm_dataManager
 Used to load and save GraphData information from a DataSource. More...
 
GraphCachem_graphCache
 Class used to keep all graph data loaded. More...
 
GraphMetadatam_metadata
 Graph Data loader strategy. More...
 

Detailed Description

This is a implementation of a UndirectedGraph Graph. By definition a undirected graph has no direction information about his edges.

See also
Graph, GraphData, GraphCache

Definition at line 56 of file UndirectedGraph.h.

Constructor & Destructor Documentation

te::graph::UndirectedGraph::UndirectedGraph ( )

constructor.

Definition at line 40 of file UndirectedGraph.cpp.

te::graph::UndirectedGraph::UndirectedGraph ( GraphMetadata metadata)

Constructor.

Parameters
metadataA pointer to a graph metadata implementation

Definition at line 44 of file UndirectedGraph.cpp.

te::graph::UndirectedGraph::UndirectedGraph ( AbstractCachePolicy cp,
AbstractGraphLoaderStrategy ls 
)

Constructor.

Parameters
cpA pointer to a cache policy implementation
lsA pointer to a loader strategy implementation

Definition at line 49 of file UndirectedGraph.cpp.

te::graph::UndirectedGraph::~UndirectedGraph ( )

Virtual destructor.

Definition at line 54 of file UndirectedGraph.cpp.

Member Function Documentation

void te::graph::Graph::add ( Vertex v)
virtualinherited

Add a new vertex element to a graph.

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

Implements te::graph::AbstractGraph.

Definition at line 98 of file Graph.cpp.

Referenced by te::graph::DirectedGraph::add(), add(), and te::graph::BidirectionalGraph::add().

void te::graph::UndirectedGraph::add ( Edge e)
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.

Reimplemented from te::graph::Graph.

Definition at line 117 of file UndirectedGraph.cpp.

References te::graph::Graph::add(), te::graph::Edge::getId(), te::graph::Edge::getIdFrom(), te::graph::Edge::getIdTo(), and te::graph::Vertex::getNeighborhood().

void te::graph::Graph::addEdgeProperty ( te::dt::Property p)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 254 of file Graph.cpp.

void te::graph::Graph::addVertexProperty ( te::dt::Property p)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 158 of file Graph.cpp.

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

void te::graph::Graph::flush ( )
virtualinherited

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

Returns

Implements te::graph::AbstractGraph.

Definition at line 295 of file Graph.cpp.

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

te::graph::Edge * te::graph::Graph::getEdge ( int  id)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 234 of file Graph.cpp.

Referenced by te::graph::AddDeepAttribute::calculateDeepValue(), te::graph::GetSubGraph::getPredecessor(), and te::graph::GetSubGraph::GetSubGraph().

te::dt::Property * te::graph::Graph::getEdgeProperty ( int  idx)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 270 of file Graph.cpp.

int te::graph::Graph::getEdgePropertySize ( )
virtualinherited

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

Returns
Integer value with the number of properties.

Implements te::graph::AbstractGraph.

Definition at line 280 of file Graph.cpp.

std::vector< te::graph::Edge * > te::graph::UndirectedGraph::getEdges ( int  vId)
virtual

It returns all edges that belongs to a vertex.

Parameters
vIdThe attribute used to identify the vertex element
Returns
A vector with edge elements.

Definition at line 211 of file UndirectedGraph.cpp.

References te::graph::Vertex::getNeighborhood().

te::graph::GraphMetadata * te::graph::Graph::getMetadata ( )
virtualinherited

Function used to access the graph metadata.

Returns
A pointer to a class that defines the graph metadata

Implements te::graph::AbstractGraph.

Definition at line 290 of file Graph.cpp.

te::graph::Vertex * te::graph::Graph::getVertex ( int  id)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 138 of file Graph.cpp.

Referenced by te::graph::AddDeepAttribute::calculateDeepValue(), te::graph::GetSubGraph::getPredecessor(), and te::graph::GetSubGraph::GetSubGraph().

std::vector< te::graph::Vertex * > te::graph::UndirectedGraph::getVertexNeighborhood ( int  id)
virtual

The neighborhood of a vertex v is an induced subgraph of the graph, formed by all vertices adjacent to v.

Parameters
idThe attribute used to identify the vertex element
Returns
A vector with vertex elements.

Definition at line 58 of file UndirectedGraph.cpp.

References te::graph::Edge::getIdFrom(), te::graph::Edge::getIdTo(), and te::graph::Vertex::getNeighborhood().

te::dt::Property * te::graph::Graph::getVertexProperty ( int  idx)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 174 of file Graph.cpp.

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

int te::graph::Graph::getVertexPropertySize ( )
virtualinherited

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

Returns
Integer value with the number of properties.

Implements te::graph::AbstractGraph.

Definition at line 184 of file Graph.cpp.

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

bool te::graph::UndirectedGraph::isIsolateVertex ( int  id,
bool &  flag 
)
virtual

This function indicates if a desired element is a isolated vertex.

Parameters
idThe attribute used to identify the vertex element
flagFlag used to indicating if the element is a isolated vertex.
Returns
True if the vertex element was found and false in other case

Definition at line 97 of file UndirectedGraph.cpp.

References te::graph::Vertex::getNeighborhood().

void te::graph::UndirectedGraph::removeEdge ( int  id)
virtual

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

Parameters
idEdge identification

Reimplemented from te::graph::Graph.

Definition at line 161 of file UndirectedGraph.cpp.

References te::graph::Edge::getIdFrom(), te::graph::Edge::getIdTo(), te::graph::Vertex::getNeighborhood(), and te::graph::Graph::removeEdge().

void te::graph::Graph::removeEdgeProperty ( int  idx)
virtualinherited

Remove a property associated to the edge element.

Parameters
idxIndex of the property

Implements te::graph::AbstractGraph.

Definition at line 262 of file Graph.cpp.

void te::graph::Graph::removeVertex ( int  id)
virtualinherited

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

Parameters
idVertex identification

Implements te::graph::AbstractGraph.

Definition at line 120 of file Graph.cpp.

void te::graph::Graph::removeVertexProperty ( int  idx)
virtualinherited

Remove a property associated to the vertex element.

Parameters
idxIndex of the property

Implements te::graph::AbstractGraph.

Definition at line 166 of file Graph.cpp.

void te::graph::Graph::update ( Vertex v)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 113 of file Graph.cpp.

References te::graph::Vertex::setDirty().

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

void te::graph::Graph::update ( Edge e)
virtualinherited

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.

Implements te::graph::AbstractGraph.

Definition at line 209 of file Graph.cpp.

References te::graph::Edge::setDirty().

Member Data Documentation

GraphDataManager* te::graph::Graph::m_dataManager
protectedinherited

Used to load and save GraphData information from a DataSource.

Definition at line 290 of file Graph.h.

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

GraphCache* te::graph::Graph::m_graphCache
protectedinherited

Class used to keep all graph data loaded.

Definition at line 292 of file Graph.h.

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

GraphData* te::graph::Graph::m_graphData
inherited

This class has the graph data and properties.

Definition at line 298 of file Graph.h.

Referenced by te::graph::Graph::Graph(), and te::graph::MemoryIterator::MemoryIterator().

GraphMetadata* te::graph::Graph::m_metadata
protectedinherited

Graph Data loader strategy.

Definition at line 294 of file Graph.h.

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


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