Medical Imaging Interaction Toolkit  2018.4.99-701c8286
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 
80  // static bool Equals(final Object left, final Object right);
81 
95  static bool Equals(const QList<Expression::Pointer>& leftArray,
96  const QList<Expression::Pointer>& rightArray);
97 
98  static bool Equals(const QList<Object::Pointer>& leftArray,
99  const QList<Object::Pointer>& rightArray);
100 
111  static uint HashCode(Expression::Pointer object);
112 
122  static uint HashCode(const QList<Expression::Pointer>& array);
123 
124  static uint HashCode(const QList<Object::Pointer>& array);
125 
136  virtual uint ComputeHashCode() const;
137 
138 
139 public:
140 
145 
150 
151  Expression();
152  ~Expression() override;
153 
154  uint HashCode() const override;
155 
167  virtual SmartPointer<const EvaluationResult> Evaluate(IEvaluationContext* context) const = 0;
168 
178  virtual const ExpressionInfo* ComputeExpressionInfo() const;
179 
188  virtual void CollectExpressionInfo(ExpressionInfo* info) const;
189 
190  QString ToString() const override;
191 
192  bool operator==(const Object* object) const override;
193 
194 };
195 
197 {
198 public:
200  {
202  }
203 
204  void CollectExpressionInfo(ExpressionInfo* /*info*/) const override {}
205 };
206 
208 {
209 public:
211  {
213  }
214 
215  void CollectExpressionInfo(ExpressionInfo* /*info*/) const override {}
216 };
217 
218 } // namespace berry
219 
220 #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