Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
berryExpression.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 BERRYEXPRESSION_H_
18 #define BERRYEXPRESSION_H_
19 
20 #include "berryExpressionInfo.h"
22 #include "berryEvaluationResult.h"
24 
25 #include <berryMacros.h>
26 #include <berryObject.h>
27 
28 
29 namespace berry {
30 
42 
43 
44 public:
46 
52 
56  static const uint HASH_FACTOR;
57 
61  static const QString ATT_VALUE;
62 
63 private:
64 
69  mutable uint fHashCode;
70 
71 protected:
72 
84  // static bool Equals(final Object left, final Object right);
85 
99  static bool Equals(const QList<Expression::Pointer>& leftArray,
100  const QList<Expression::Pointer>& rightArray);
101 
102  static bool Equals(const QList<Object::Pointer>& leftArray,
103  const QList<Object::Pointer>& rightArray);
104 
115  static uint HashCode(Expression::Pointer object);
116 
126  static uint HashCode(const QList<Expression::Pointer>& array);
127 
128  static uint HashCode(const QList<Object::Pointer>& array);
129 
140  virtual uint ComputeHashCode() const;
141 
142 
143 public:
144 
149 
154 
155  Expression();
156  virtual ~Expression();
157 
158  virtual uint HashCode() const override;
159 
171  virtual SmartPointer<const EvaluationResult> Evaluate(IEvaluationContext* context) const = 0;
172 
182  virtual const ExpressionInfo* ComputeExpressionInfo() const;
183 
192  virtual void CollectExpressionInfo(ExpressionInfo* info) const;
193 
194  virtual QString ToString() const override;
195 
196  virtual bool operator==(const Object* object) const override;
197 
198 };
199 
201 {
202 public:
204  {
206  }
207 
208  void CollectExpressionInfo(ExpressionInfo* /*info*/) const override {}
209 };
210 
212 {
213 public:
215  {
217  }
218 
219  void CollectExpressionInfo(ExpressionInfo* /*info*/) const override {}
220 };
221 
222 } // namespace berry
223 
224 #endif /*BERRYEXPRESSION_H_*/
static const SmartPointer< const EvaluationResult > FALSE_EVAL
Light weight base class for most BlueBerry classes.
Definition: berryObject.h:78
void CollectExpressionInfo(ExpressionInfo *) const override
static const uint HASH_CODE_NOT_COMPUTED
MITKCORE_EXPORT bool operator==(const InteractionEvent &a, const InteractionEvent &b)
static void info(const char *fmt,...)
Definition: svm.cpp:100
SmartPointer< const EvaluationResult > Evaluate(IEvaluationContext *) const override
#define berryObjectMacro(...)
Definition: berryMacros.h:37
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 SmartPointer< const EvaluationResult > TRUE_EVAL
unsigned int uint
static const uint HASH_FACTOR
static const Expression::Pointer TRUE_EVAL