23 : fParent(parent), fDefaultVariable(defaultVariable), fAllowPluginActivation(-1)
25 poco_assert(defaultVariable != 0);
30 const std::vector<IVariableResolver*>& resolvers)
31 : fParent(parent), fDefaultVariable(defaultVariable),
32 fVariableResolvers(resolvers), fAllowPluginActivation(-1)
34 poco_assert(defaultVariable != 0);
35 poco_assert(resolvers.size() != 0);
45 if (fParent ==
nullptr)
52 return fDefaultVariable;
57 fAllowPluginActivation= value ? 1 : 0;
62 if (fAllowPluginActivation < 0)
70 return fAllowPluginActivation;
76 poco_assert(name.size() != 0);
79 fVariables[name] = value;
85 poco_assert(name.size() != 0);
88 fVariables.remove(name);
95 poco_assert(name.size() != 0);
99 QHash<QString, Object::ConstPointer>::const_iterator iter(fVariables.find(name));
100 if (iter != fVariables.end())
102 result = iter.value();
105 if (!result.IsNull())
108 if (fParent !=
nullptr)
117 if (fVariableResolvers.size() > 0) {
118 for (
unsigned int i= 0; i < fVariableResolvers.size(); ++i) {
121 if (!variable.IsNull())
126 if (fParent !=
nullptr)
virtual Object::Pointer Resolve(const QString &name, const QList< Object::Pointer > &args)=0
IEvaluationContext * GetRoot() const override
Object::ConstPointer ResolveVariable(const QString &name, const QList< Object::Pointer > &args) const override
bool GetAllowPluginActivation() const override
virtual IEvaluationContext * GetRoot() const =0
IEvaluationContext * GetParent() const override
Object::ConstPointer GetVariable(const QString &name) const override
berry::SmartPointer< Self > Pointer
void SetAllowPluginActivation(bool value) override
virtual bool GetAllowPluginActivation() const =0
EvaluationContext(IEvaluationContext *parent, const Object::ConstPointer &defaultVariable)
Object::ConstPointer GetDefaultVariable() const override
void AddVariable(const QString &name, const Object::ConstPointer &value) override
virtual Object::ConstPointer ResolveVariable(const QString &name, const QList< Object::Pointer > &args) const =0
Object::ConstPointer RemoveVariable(const QString &name) override
virtual Object::ConstPointer GetVariable(const QString &name) const =0