Medical Imaging Interaction Toolkit  2021.10.99-fd647480
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_*/
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
static const SmartPointer< const EvaluationResult > TRUE_EVAL
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:72
void CollectExpressionInfo(ExpressionInfo *) const override
Implements transparent reference counting.
static const uint HASH_CODE_NOT_COMPUTED
SmartPointer< const EvaluationResult > Evaluate(IEvaluationContext *) const override
berry::SmartPointer< Self > Pointer
Definition: berryObject.h:82
#define berryObjectMacro(...)
Definition: berryMacros.h:33
void CollectExpressionInfo(ExpressionInfo *) const override
static const QString ATT_VALUE
SmartPointer< const EvaluationResult > Evaluate(IEvaluationContext *) const override
static const Expression::Pointer FALSE_EVAL
static const uint HASH_FACTOR
static const SmartPointer< const EvaluationResult > FALSE_EVAL
static const Expression::Pointer TRUE_EVAL