SMTK  @SMTK_VERSION@
Simulation Modeling Tool Kit
InfixExpressionEvaluator.h
1 //=========================================================================
2 // Copyright (c) Kitware, Inc.
3 // All rights reserved.
4 // See LICENSE.txt for details.
5 //
6 // This software is distributed WITHOUT ANY WARRANTY; without even
7 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
8 // PURPOSE. See the above copyright notice for more information.
9 //=========================================================================
10 #ifndef smtk_attribute_InfixExpressionEvaluator_h
11 #define smtk_attribute_InfixExpressionEvaluator_h
12 
13 #include "smtk/CoreExports.h"
14 
15 #include "smtk/attribute/Attribute.h"
16 #include "smtk/attribute/Evaluator.h"
17 
19 
20 namespace smtk
21 {
22 namespace attribute
23 {
24 
25 // An Evaluator for infix math expressions.
27 {
28 public:
30 
32 
33  bool evaluate(
34  ValueType& result,
35  smtk::io::Logger& log,
36  const std::size_t& element,
37  const DependentEvaluationMode& evalutionMode) override;
38 
39  bool canEvaluate(smtk::io::Logger& log) override;
40 
41  bool doesEvaluate(std::size_t element) override;
42  bool doesEvaluate() override;
43 
44  std::size_t numberOfEvaluatableElements() override;
45 
46 private:
47  // Maps |err| to an error message and adds it as a record to |log|. Does
48  // nothing if |err| == smtk::common::InfixExpressionError::ERROR_NONE.
49  void logError(const smtk::common::InfixExpressionError& err, smtk::io::Logger& log) const;
50 };
51 
52 } // namespace attribute
53 } // namespace smtk
54 
55 #endif // smtk_attribute_InfixExpressionEvaluator_h
smtk
The main namespace for the Simulation Modeling Tool Kit (SMTK).
Definition: doc.h:33
smtk::attribute::InfixExpressionEvaluator
Definition: InfixExpressionEvaluator.h:26
smtk::io::Logger
Log messages for later presentation to a user or a file.
Definition: Logger.h:95
InfixExpressionError.h
smtk::attribute::Evaluator
Definition: Evaluator.h:32
smtk::attribute::ConstAttributePtr
smtk::shared_ptr< const smtk::attribute::Attribute > ConstAttributePtr
Definition: PublicPointerDefs.h:458
smtkTypenameMacro
#define smtkTypenameMacro(...)
Add typedefs to a class for identifcation.
Definition: SharedFromThis.h:68