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"
75 task.
setMessage(
"Add Deep Attribute Operation");
81 std::set<int> vertexIdSet;
83 vertexIdSet.insert(vertex->
getId());
117 std::set<int> predecessors;
121 std::set<int>::iterator it = predecessors.begin();
123 while(it != predecessors.end())
133 std::set<int>::iterator itSet = vertexIdSet.find(vFrom->
getId());
135 if(itSet == vertexIdSet.end())
137 vertexIdSet.insert(vFrom->
getId());
139 calculateDeepValue(vFrom, g, deepValue, vertexIdSet);
virtual te::graph::Vertex * getFirstVertex()
It returns a pointer to the first vertex element of a graph.
void setMessage(const std::string &message)
Set the task message.
An atomic property like an integer or double.
std::set< int > & getPredecessors()
Returns the Predecessors vector.
This class can be used to inform the progress of a task.
virtual te::graph::Edge * getEdge(int id)
It returns the edge element if it's exist.
From the point of view of graph theory, vertices are treated as featureless and indivisible objects...
void setTotalSteps(int value)
Set the task total stepes.
void setId(unsigned int id)
It sets the property identifier.
Class used to define the edge struct of a graph. Its compose with a identifier, the vertex origin and...
virtual te::dt::Property * getVertexProperty(int idx)
Get a vertex property given a index.
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 int getVertexPropertySize()
Used to verify the number of properties associated to vertex elements.
virtual void flush()
Function used to clear the memory cache, all elements was released from memory, if any element was ch...
AddDeepAttribute(te::graph::BidirectionalGraph *graph, std::string attributeName)
Default constructor.
void pulse()
Calls setCurrentStep() function using getCurrentStep() + 1.
int getIdFrom()
It returns the vertex origin identification.
virtual te::graph::Vertex * getNextVertex()
It returns a pointer to the next vertex element of a graph.
virtual void addVertexProperty(te::dt::Property *p)
Add a new property associated to the vertex element.
virtual size_t getVertexInteratorCount()
It returns the number of elements of this iterator.
virtual te::graph::Vertex * getVertex(int id)
It returns the vertex element if it's exist.
int getId()
It returns the vertex id.
void addAttribute(int idx, te::dt::AbstractData *ad)
Add a new attribute to this element.
virtual ~AddDeepAttribute()
Virtual destructor.
This is a implementation of a Bidirectional Graph. By convention a bidirectional graph provides acces...
A template for atomic data types (integers, floats, strings and others).
This class defines a function used to add to a graph the deep information attribute.
virtual void update(Vertex *v)
Update the vertex element.
virtual bool isVertexIteratorAfterEnd()
Used to check the iterator position.
const std::string & getName() const
It returns the property name.
void setParent(Property *p)
It associate this property to the informed parent.