data: Saving virtual abstraction of methods as TokenComponentAbstraction

This commit is contained in:
Eberhard Graether
2014-08-01 05:27:09 +02:00
parent 5893d0c776
commit 8950d679e1
14 changed files with 153 additions and 16 deletions
+17
View File
@@ -2,6 +2,7 @@
#include <sstream>
#include "data/graph/token_component/TokenComponentAbstraction.h"
#include "data/graph/token_component/TokenComponentConst.h"
#include "data/graph/token_component/TokenComponentStatic.h"
#include "data/graph/token_component/TokenComponentSignature.h"
@@ -196,6 +197,22 @@ bool Node::isEdge() const
return false;
}
void Node::addComponentAbstraction(std::shared_ptr<TokenComponentAbstraction> component)
{
if (getComponent<TokenComponentAbstraction>())
{
LOG_ERROR("TokenComponentAbstraction has been set before!");
}
else if (!isType(NODE_METHOD))
{
LOG_ERROR("TokenComponentAbstraction can't be set on node of type: " + getTypeString());
}
else
{
addComponent(component);
}
}
void Node::addComponentConst(std::shared_ptr<TokenComponentConst> component)
{
if (getComponent<TokenComponentConst>())