28 #include "../../common/Translator.h"
29 #include "../../common/progress/TaskProgress.h"
30 #include "../../datatype/SimpleProperty.h"
31 #include "../../datatype/SimpleData.h"
32 #include "../../datatype/Enums.h"
33 #include "../core/Edge.h"
34 #include "../core/Vertex.h"
35 #include "../core/VertexProperty.h"
36 #include "../graphs/Graph.h"
37 #include "../graphs/BidirectionalGraph.h"
38 #include "../iterator/SequenceIterator.h"
39 #include "../Exception.h"
79 task.
setMessage(
"Add Deep Attribute Operation");
87 std::set<int> vertexIdSet;
89 vertexIdSet.insert(vertex->
getId());
125 std::set<int> predecessors;
129 std::set<int>::iterator it = predecessors.begin();
131 while(it != predecessors.end())
141 std::set<int>::iterator itSet = vertexIdSet.find(vFrom->
getId());
143 if(itSet == vertexIdSet.end())
145 vertexIdSet.insert(vFrom->
getId());
147 calculateDeepValue(vFrom, g, deepValue, vertexIdSet);
Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and...
void setParent(Property *p)
It associate this property to the informed parent.
An atomic property like an integer or double.
void setIterator(te::graph::AbstractIterator *i)
Used to associate a iterator to graph.
void setTotalSteps(int value)
Set the task total stepes.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
int getIdFrom()
It returns the vertex origin identification.
A template for atomic data types (integers, floats, strings and others).
const std::string & getName() const
It returns the property name.
void setId(unsigned int id)
It sets the property identifier.
virtual te::graph::Vertex * getNextVertex()
It returns a pointer to the next vertex element of a graph.
void addAttribute(int idx, te::dt::AbstractData *ad)
Add a new attribute to this element.
virtual int getVertexPropertySize()
Used to verify the number of properties associated to vertex elements.
This class defines a function used to add to a graph the deep information attribute.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
This class defines a commun interface to represents a graph iterator class. The main diferency to ano...
int getId()
It returns the vertex id.
virtual te::dt::Property * getVertexProperty(int idx)
Get a vertex property given a index.
std::set< int > & getPredecessors()
Returns the Predecessors vector.
virtual te::graph::Edge * getEdge(int id)
It returns the edge element if it's exist.
virtual bool isVertexIteratorAfterEnd()
Used to check the iterator position.
virtual size_t getVertexInteratorCount()
It returns the number of elements of this iterator.
void setMessage(const std::string &message)
Set the task message.
This class can be used to inform the progress of a task.
AddDeepAttribute(te::graph::BidirectionalGraph *graph, std::string attributeName)
Default constructor.
This is a implementation of a Bidirectional Graph. By convention a bidirectional graph provides acces...
virtual void addVertexProperty(te::dt::Property *p)
Add a new property associated to the vertex element.
void calculateDeepValue(te::graph::Vertex *v, te::graph::BidirectionalGraph *g, int &deepValue, std::set< int > &vertexIdSet)
Recursive function used to calculate the deep attribute.
virtual void flush()
Function used to clear the memory cache, all elements was released from memory, if any element was ch...
virtual te::graph::Vertex * getVertex(int id)
It returns the vertex element if it's exist.
te::graph::AbstractIterator * getIterator()
Used to get a iterator associated to graph.
virtual ~AddDeepAttribute()
Virtual destructor.
virtual te::graph::Vertex * getFirstVertex()
It returns a pointer to the first vertex element of a graph.
virtual void update(Vertex *v)
Update the vertex element.