OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Constraint.cpp
Go to the documentation of this file.
1 #include "Optimize/Constraint.h"
3 
4 namespace {
5  enum {
6  EXPR,
7  SIZE
8  };
9 }
10 
12  Definition(SIZE, "CONSTRAINT", "The CONSTRAINT statement defines a constraint for optimization")
13 {
14  itsAttr[EXPR] = Attributes::makeString("EXPR",
15  "Expression that should be fulfilled during optimization");
16 
18 }
19 
20 Constraint::Constraint(const std::string &name, Constraint *parent):
21  Definition(name, parent)
22 { }
23 
25 { }
26 
28 
29 }
30 
31 std::string Constraint::getExpression() const {
32  std::string expr = Attributes::getString(itsAttr[EXPR]);
33 
34  return expr;
35 }
std::string getExpression() const
Definition: Constraint.cpp:31
The base class for all OPAL definitions.
Definition: Definition.h:30
virtual void execute()
Execute the command.
Definition: Constraint.cpp:27
std::vector< Attribute > itsAttr
The object attributes (see Attribute.hh).
Definition: Object.h:214
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
Definition: Object.cpp:194
const std::string name
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Definition: Attributes.cpp:296
std::string getString(const Attribute &attr)
Get string value.
Definition: Attributes.cpp:307