OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
Constraint.cpp
Go to the documentation of this file.
3
4namespace {
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
20Constraint::Constraint(const std::string &name, Constraint *parent):
21 Definition(name, parent)
22{ }
23
25{ }
26
28
29}
30
31std::string Constraint::getExpression() const {
32 std::string expr = Attributes::getString(itsAttr[EXPR]);
33
34 return expr;
35}
@ SIZE
Definition: IndexMap.cpp:174
const std::string name
std::string getString(const Attribute &attr)
Get string value.
Definition: Attributes.cpp:343
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Definition: Attributes.cpp:332
The base class for all OPAL definitions.
Definition: Definition.h:30
void registerOwnership(const AttributeHandler::OwnerType &itsClass) const
Definition: Object.cpp:191
std::vector< Attribute > itsAttr
The object attributes.
Definition: Object.h:216
std::string getExpression() const
Definition: Constraint.cpp:31
virtual void execute()
Execute the command.
Definition: Constraint.cpp:27