Medical Imaging Interaction Toolkit  2024.06.99-fe296c79
Medical Imaging Interaction Toolkit
berryExpression.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 BERRYEXPRESSION_H_
14 #define BERRYEXPRESSION_H_
15 
16 #include "berryExpressionInfo.h"
18 #include "berryEvaluationResult.h"
20 
21 #include <berryMacros.h>
22 #include <berryObject.h>
23 
24 
25 namespace berry {
26 
38 
39 
40 public:
42 
47  static const uint HASH_CODE_NOT_COMPUTED;
48 
52  static const uint HASH_FACTOR;
53 
57  static const QString ATT_VALUE;
58 
59 private:
60 
65  mutable uint fHashCode;
66 
67 protected:
68 
82  static bool Equals(const QList<Expression::Pointer>& leftArray,
83  const QList<Expression::Pointer>& rightArray);
84 
85  static bool Equals(const QList<Object::Pointer>& leftArray,
86  const QList<Object::Pointer>& rightArray);
87 
98  static uint HashCode(Expression::Pointer object);
99 
109  static uint HashCode(const QList<Expression::Pointer>& array);
110 
111  static uint HashCode(const QList<Object::Pointer>& array);
112 
123  virtual uint ComputeHashCode() const;
124 
125 
126 public:
127 
132 
137 
138  Expression();
139  ~Expression() override;
140 
141  uint HashCode() const override;
142 
154  virtual SmartPointer<const EvaluationResult> Evaluate(IEvaluationContext* context) const = 0;
155 
165  virtual const ExpressionInfo* ComputeExpressionInfo() const;
166 
175  virtual void CollectExpressionInfo(ExpressionInfo* info) const;
176 
177  QString ToString() const override;
178 
179  bool operator==(const Object* object) const override;
180 
181 };
182 
184 {
185 public:
187  {
189  }
190 
191  void CollectExpressionInfo(ExpressionInfo* /*info*/) const override {}
192 };
193 
195 {
196 public:
198  {
200  }
201 
202  void CollectExpressionInfo(ExpressionInfo* /*info*/) const override {}
203 };
204 
205 } // namespace berry
206 
207 #endif /*BERRYEXPRESSION_H_*/
berry::EvaluationResult::TRUE_EVAL
static const SmartPointer< const EvaluationResult > TRUE_EVAL
Definition: berryEvaluationResult.h:132
berry::ExpressionInfo
Definition: berryExpressionInfo.h:35
berry::IEvaluationContext
Definition: berryIEvaluationContext.h:36
berry::Expression::TRUE_EVAL
static const Expression::Pointer TRUE_EVAL
Definition: berryExpression.h:131
berryMacros.h
berryIEvaluationContext.h
berry::SmartPointer
Implements transparent reference counting.
Definition: berryICommandCategoryListener.h:21
org_blueberry_core_expressions_Export.h
berry::TRUE_EVALExpression::Evaluate
SmartPointer< const EvaluationResult > Evaluate(IEvaluationContext *) const override
Definition: berryExpression.h:186
berry::Object
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
berry::TRUE_EVALExpression::CollectExpressionInfo
void CollectExpressionInfo(ExpressionInfo *) const override
Definition: berryExpression.h:191
mitk::operator==
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
berry::Expression
Definition: berryExpression.h:37
berry::FALSE_EVALExpression::CollectExpressionInfo
void CollectExpressionInfo(ExpressionInfo *) const override
Definition: berryExpression.h:202
berry::EvaluationResult::FALSE_EVAL
static const SmartPointer< const EvaluationResult > FALSE_EVAL
Definition: berryEvaluationResult.h:130
berry::FALSE_EVALExpression::Evaluate
SmartPointer< const EvaluationResult > Evaluate(IEvaluationContext *) const override
Definition: berryExpression.h:197
berry::FALSE_EVALExpression
Definition: berryExpression.h:194
berry::Expression::FALSE_EVAL
static const Expression::Pointer FALSE_EVAL
Definition: berryExpression.h:136
berryExpressionInfo.h
berry::TRUE_EVALExpression
Definition: berryExpression.h:183
berry::Expression::ATT_VALUE
static const QString ATT_VALUE
Definition: berryExpression.h:57
berryObjectMacro
#define berryObjectMacro(...)
Definition: berryMacros.h:31
BERRY_EXPRESSIONS
#define BERRY_EXPRESSIONS
Definition: org_blueberry_core_expressions_Export.h:26
berry::Expression::HASH_FACTOR
static const uint HASH_FACTOR
Definition: berryExpression.h:52
berry::Expression::HASH_CODE_NOT_COMPUTED
static const uint HASH_CODE_NOT_COMPUTED
Definition: berryExpression.h:47
berryObject.h
berryEvaluationResult.h
berry
Definition: QmitkPropertyItemModel.h:24