OPAL (Object Oriented Parallel Accelerator Library) 2024.2
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
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.
Attribute makeString(const std::string &name, const std::string &help)
Make string attribute.
Definition(int size, const char *name, const char *help)
Constructor for exemplars.
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
virtual void execute()
Execute the command.