OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
MatchOption.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: MatchOption.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.1.1.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: MatchOption
10 // The class for the OPAL OPTION command.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/03/27 09:33:44 $
15 // $Author: Andreas Adelmann $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include "Match/MatchOption.h"
20 #include "Attributes/Attributes.h"
21 #include "Match/Match.h"
22 #include "Utilities/Round.h"
23 
24 
25 // Class MatchOption
26 // ------------------------------------------------------------------------
27 
29  Action(1, "OPTION",
30  "The \"OPTION\" sub-command sets matching options.") {
32  ("LEVEL", "The desired verbosity for output", 0.0);
33 
35 }
36 
37 
38 MatchOption::MatchOption(const std::string &name, MatchOption *parent):
39  Action(name, parent)
40 {}
41 
42 
44 {}
45 
46 
47 MatchOption *MatchOption::clone(const std::string &name) {
48  return new MatchOption(name, this);
49 }
50 
51 
53  int level = int(Round(Attributes::getReal(itsAttr[0])));
55 }
double Round(double value)
Round the double argument.
Definition: Round.cpp:23
virtual ~MatchOption()
Definition: MatchOption.cpp:43
void setPrintLevel(int)
Set the flag for printing.
Definition: Match.cpp:208
The base class for all OPAL actions.
Definition: Action.h:30
static Match * block
The block of match data.
Definition: Match.h:100
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
virtual void execute()
Execute the command.
Definition: MatchOption.cpp:52
MatchOption()
Exemplar constructor.
Definition: MatchOption.cpp:28
const std::string name
double getReal(const Attribute &attr)
Return real value.
Definition: Attributes.cpp:217
The OPTION command for matching.
Definition: MatchOption.h:31
Attribute makeReal(const std::string &name, const std::string &help)
Make real attribute.
Definition: Attributes.cpp:205
virtual MatchOption * clone(const std::string &name)
Make clone.
Definition: MatchOption.cpp:47