Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryEvaluationContext.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRYEVALUATIONCONTEXT_H_
18 #define BERRYEVALUATIONCONTEXT_H_
19 
21 #include "berryIVariableResolver.h"
23 
24 #include "Poco/Any.h"
25 
26 #include <vector>
27 
28 #include <QHash>
29 
30 namespace berry {
31 
42 {
43 
44 private:
45  IEvaluationContext* const fParent;
46  Object::ConstPointer fDefaultVariable;
47  QHash<QString, Object::ConstPointer> fVariables;
48  std::vector<IVariableResolver*> fVariableResolvers;
49  int fAllowPluginActivation;
50 
51 public:
52 
60  EvaluationContext(IEvaluationContext* parent, const Object::ConstPointer& defaultVariable);
61 
73  EvaluationContext(IEvaluationContext* parent, const Object::ConstPointer& defaultVariable,
74  const std::vector<IVariableResolver*>& resolvers);
75 
76 
80  IEvaluationContext* GetParent() const override;
81 
85  IEvaluationContext* GetRoot() const override;
86 
90  Object::ConstPointer GetDefaultVariable() const override;
91 
95  void SetAllowPluginActivation(bool value) override;
96 
100  bool GetAllowPluginActivation() const override;
101 
105  void AddVariable(const QString& name, const Object::ConstPointer& value) override;
106 
110  Object::ConstPointer RemoveVariable(const QString& name) override;
111 
115  Object::ConstPointer GetVariable(const QString &name) const override;
116 
120  Object::ConstPointer ResolveVariable(const QString& name, const QList<Object::Pointer>& args) const override;
121 };
122 
123 } // namespace berry
124 
125 #endif /*BERRYEVALUATIONCONTEXT_H_*/