Medical Imaging Interaction Toolkit  2021.02.99-00f000b3
Medical Imaging Interaction Toolkit
berryEvaluationContext.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BERRYEVALUATIONCONTEXT_H_
14 #define BERRYEVALUATIONCONTEXT_H_
15 
17 #include "berryIVariableResolver.h"
19 
20 #include "Poco/Any.h"
21 
22 #include <vector>
23 
24 #include <QHash>
25 
26 namespace berry {
27 
38 {
39 
40 private:
41  IEvaluationContext* const fParent;
42  Object::ConstPointer fDefaultVariable;
43  QHash<QString, Object::ConstPointer> fVariables;
44  std::vector<IVariableResolver*> fVariableResolvers;
45  int fAllowPluginActivation;
46 
47 public:
48 
56  EvaluationContext(IEvaluationContext* parent, const Object::ConstPointer& defaultVariable);
57 
69  EvaluationContext(IEvaluationContext* parent, const Object::ConstPointer& defaultVariable,
70  const std::vector<IVariableResolver*>& resolvers);
71 
72 
76  IEvaluationContext* GetParent() const override;
77 
81  IEvaluationContext* GetRoot() const override;
82 
86  Object::ConstPointer GetDefaultVariable() const override;
87 
91  void SetAllowPluginActivation(bool value) override;
92 
96  bool GetAllowPluginActivation() const override;
97 
101  void AddVariable(const QString& name, const Object::ConstPointer& value) override;
102 
106  Object::ConstPointer RemoveVariable(const QString& name) override;
107 
111  Object::ConstPointer GetVariable(const QString &name) const override;
112 
116  Object::ConstPointer ResolveVariable(const QString& name, const QList<Object::Pointer>& args) const override;
117 };
118 
119 } // namespace berry
120 
121 #endif /*BERRYEVALUATIONCONTEXT_H_*/
Implements transparent reference counting.