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
@@ -0,0 +1,34 @@
#include "data/graph/token_component/TokenComponentAbstraction.h"
TokenComponentAbstraction::TokenComponentAbstraction(AbstractionType abstraction)
: m_abstraction(abstraction)
{
}
TokenComponentAbstraction::~TokenComponentAbstraction()
{
}
std::shared_ptr<TokenComponent> TokenComponentAbstraction::copy() const
{
return std::make_shared<TokenComponentAbstraction>(*this);
}
TokenComponentAbstraction::AbstractionType TokenComponentAbstraction::getAbstraction() const
{
return m_abstraction;
}
std::string TokenComponentAbstraction::getAbstractionString() const
{
switch (m_abstraction)
{
case ABSTRACTION_VIRTUAL:
return "virtual";
case ABSTRACTION_PURE_VIRTUAL:
return "pure virtual";
case ABSTRACTION_NONE:
return "";
}
return "";
}
@@ -0,0 +1,31 @@
#ifndef TOKEN_COMPONENT_ABSTRACTION_H
#define TOKEN_COMPONENT_ABSTRACTION_H
#include <string>
#include "data/graph/token_component/TokenComponent.h"
class TokenComponentAbstraction
: public TokenComponent
{
public:
enum AbstractionType
{
ABSTRACTION_VIRTUAL,
ABSTRACTION_PURE_VIRTUAL,
ABSTRACTION_NONE
};
TokenComponentAbstraction(AbstractionType abstraction);
virtual ~TokenComponentAbstraction();
virtual std::shared_ptr<TokenComponent> copy() const;
AbstractionType getAbstraction() const;
std::string getAbstractionString() const;
private:
const AbstractionType m_abstraction;
};
#endif // TOKEN_COMPONENT_ABSTRACTION_H
@@ -1,5 +1,5 @@
#ifndef TOKEN_COMPONENT_ACCESS
#define TOKEN_COMPONENT_ACCESS
#ifndef TOKEN_COMPONENT_ACCESS_H
#define TOKEN_COMPONENT_ACCESS_H
#include <string>
@@ -23,11 +23,10 @@ public:
virtual std::shared_ptr<TokenComponent> copy() const;
AccessType getAccess() const;
std::string getAccessString() const;
private:
const AccessType m_access;
};
#endif // TOKEN_COMPONENT_ACCESS
#endif // TOKEN_COMPONENT_ACCESS_H
@@ -1,5 +1,5 @@
#ifndef TOKEN_COMPONENT_CONST
#define TOKEN_COMPONENT_CONST
#ifndef TOKEN_COMPONENT_CONST_H
#define TOKEN_COMPONENT_CONST_H
#include "data/graph/token_component/TokenComponent.h"
@@ -10,4 +10,4 @@ public:
virtual std::shared_ptr<TokenComponent> copy() const;
};
#endif // TOKEN_COMPONENT_CONST
#endif // TOKEN_COMPONENT_CONST_H
@@ -1,5 +1,5 @@
#ifndef TOKEN_COMPONENT_DATA_TYPE
#define TOKEN_COMPONENT_DATA_TYPE
#ifndef TOKEN_COMPONENT_DATA_TYPE_H
#define TOKEN_COMPONENT_DATA_TYPE_H
#include "data/graph/token_component/TokenComponent.h"
#include "data/type/DataTypeModifierStack.h"
@@ -24,4 +24,4 @@ private:
const DataTypeModifierStack m_modifierStack;
};
#endif // TOKEN_COMPONENT_DATA_TYPE
#endif // TOKEN_COMPONENT_DATA_TYPE_H
@@ -1,5 +1,5 @@
#ifndef TOKEN_COMPONENT_SIGNATURE
#define TOKEN_COMPONENT_SIGNATURE
#ifndef TOKEN_COMPONENT_SIGNATURE_H
#define TOKEN_COMPONENT_SIGNATURE_H
#include <string>
@@ -20,4 +20,4 @@ private:
const std::string m_signature;
};
#endif // TOKEN_COMPONENT_SIGNATURE
#endif // TOKEN_COMPONENT_SIGNATURE_H
@@ -1,5 +1,5 @@
#ifndef TOKEN_COMPONENT_STATIC
#define TOKEN_COMPONENT_STATIC
#ifndef TOKEN_COMPONENT_STATIC_H
#define TOKEN_COMPONENT_STATIC_H
#include "data/graph/token_component/TokenComponent.h"
@@ -10,4 +10,4 @@ public:
virtual std::shared_ptr<TokenComponent> copy() const;
};
#endif // TOKEN_COMPONENT_STATIC
#endif // TOKEN_COMPONENT_STATIC_H