Schim
entity.h
Go to the documentation of this file.
1 #ifndef ENTITY_H
3 #define ENTITY_H
4 
5 #include "variable.h"
6 
32 class Entity
33 {
34 public:
38  explicit Entity(Entity *parent = nullptr);
42  virtual ~Entity() = default;
43 
44  // GETTERS
45  QString getName() const;
46  QString getFileName() const;
52  VariableSet getVariables() const;
53  VariableSet &getLocalVariables();
54  VariableSet getLocalVariables() const;
55  Entity *getParent() const;
56 
57  // SETTERS
58  void setName(const QString &name);
59  void setFileName(const QString &name);
60  void setVariables(const VariableSet &vars);
61  void addVariable(const Variable &variable);
62  void addVariables(const VariableSet &variables);
63  void setParent(Entity *parent);
64 
65 protected:
67  QString name;
69  QString fileName;
73  Entity* parent{};
74 };
75 
76 #endif // ENTITY_H
QString fileName
The name of the source file where the entity is defined.
Definition: entity.h:69
Definition: variableset.h:4
Entity * parent
The parent of this entity.
Definition: entity.h:73
Entity(Entity *parent=nullptr)
Construct an empty entity with an optional parent.
Base class for entities.
Definition: entity.h:32
VariableSet getVariables() const
Return the variables defined for this entity.
QString name
The name of the entity.
Definition: entity.h:67
VariableSet variables
The variables associated with this entity.
Definition: entity.h:71
virtual ~Entity()=default
Default destructor that makes this class virtual.
A model representation of a variable.
Definition: variable.h:24