data: storing type modifiers in edges
- ASTVisitor uses DataType instead of string to pass on type information. - Edges can have EdgeComponents. - EdgeComponentDataType stores information that modifies the type a ...TYPE_OF edge points to. - EdgeComponentDataType can create a complete DataType using it's internal information. - Fixed a bug where DataTypeModifiers did not apply their qualifiers.
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
#include <sstream>
|
||||
|
||||
#include "data/graph/edgeComponent/EdgeComponent.h"
|
||||
#include "data/graph/Node.h"
|
||||
#include "utility/logging/logging.h"
|
||||
|
||||
@@ -33,6 +34,11 @@ std::shared_ptr<Edge> Edge::createPlainCopy(Node* from, Node* to) const
|
||||
|
||||
edge->setAccess(m_access);
|
||||
|
||||
for (std::shared_ptr<EdgeComponent> component: m_components)
|
||||
{
|
||||
edge->addComponent(component); // Todo: create a deep copy here
|
||||
}
|
||||
|
||||
return edge;
|
||||
}
|
||||
|
||||
@@ -132,6 +138,12 @@ std::string Edge::getAsString() const
|
||||
return str.str();
|
||||
}
|
||||
|
||||
void Edge::addComponent(std::shared_ptr<EdgeComponent> component)
|
||||
{
|
||||
m_components.push_back(component);
|
||||
component->setEdge(this);
|
||||
}
|
||||
|
||||
Edge::Edge(Id id, EdgeType type, Node* from, Node* to)
|
||||
: Token(id)
|
||||
, m_type(type)
|
||||
|
||||
Reference in New Issue
Block a user