te::graph::DirectedGraph Class Reference

This is a implementation of a Directed Graph. By convention a directed graph provides access to out-edges only. More...

#include <DirectedGraph.h>

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

Public Member Functions

 DirectedGraph ()
 constructor. More...
 
 DirectedGraph (GraphMetadata *metadata)
 Constructor. More...
 
 DirectedGraph (AbstractCachePolicy *cp, AbstractGraphLoaderStrategy *ls)
 Constructor. More...
 
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...
 
 ~DirectedGraph ()
 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 isSinkVertex (int id, bool &flag)
 This function indicates if a desired element is a sink 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 * > getOutEdges (int vId)
 It returns all edges that came out 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 Directed Graph. By convention a directed graph provides access to out-edges only.

See also
Graph, GraphData, GraphCache

Definition at line 54 of file DirectedGraph.h.

Constructor & Destructor Documentation

te::graph::DirectedGraph::DirectedGraph ( )

constructor.

te::graph::DirectedGraph::DirectedGraph ( GraphMetadata metadata)

Constructor.

Parameters
metadataA pointer to a graph metadata implementation
te::graph::DirectedGraph::DirectedGraph ( AbstractCachePolicy cp,
AbstractGraphLoaderStrategy ls 
)

Constructor.

Parameters
cpA pointer to a cache policy implementation
lsA pointer to a loader strategy implementation
te::graph::DirectedGraph::~DirectedGraph ( )

Virtual destructor.

Member Function Documentation

virtual 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.

virtual void te::graph::DirectedGraph::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.

virtual 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.

virtual 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.

virtual 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.

virtual 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.

virtual 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.

virtual 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.

virtual 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.

virtual std::vector<te::graph::Edge*> te::graph::DirectedGraph::getOutEdges ( int  vId)
virtual

It returns all edges that came out a vertex.

Parameters
vIdThe attribute used to identify the vertex element
Returns
A vector with edge elements.
virtual 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.

virtual std::vector<te::graph::Vertex*> te::graph::DirectedGraph::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.
virtual 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.

virtual 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.

virtual bool te::graph::DirectedGraph::isSinkVertex ( int  id,
bool &  flag 
)
virtual

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

Parameters
idThe attribute used to identify the vertex element
flagFlag used to indicating if the element is a sink vertex.
Returns
True if the vertex element was found and false in other case
virtual void te::graph::DirectedGraph::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.

virtual 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.

virtual 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.

virtual 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.

virtual 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.

virtual 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.

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.

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

Class used to keep all graph data loaded.

Definition at line 292 of file Graph.h.

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

This class has the graph data and properties.

Definition at line 298 of file Graph.h.

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

Graph Data loader strategy.

Definition at line 294 of file Graph.h.


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