OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
MatchParser.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: MatchParser.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.2 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: MatchParser
10 // The parser class for the OPAL match module.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/04/19 12:09:33 $
15 // $Author: opal $
16 //
17 // JMJ: some changes
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "Match/MatchParser.h"
23 #include "Match/ConstraintCmd.h"
24 #include "Match/MatchEnd.h"
25 #include "Match/MatchOption.h"
26 #include "Match/LMDif.h"
27 #include "Match/Migrad.h"
28 #include "Match/Simplex.h"
29 #include "Match/VaryCmd.h"
30 
31 
32 // Class MatchParser
33 // ------------------------------------------------------------------------
34 
35 
37  MatchDirectory() {
38  // Matching commands.
39  MatchDirectory.insert("CONSTRAINT", new ConstraintCmd());
40  MatchDirectory.insert("ENDMATCH", new MatchEnd());
41  MatchDirectory.insert("LMDIF", new LMDif());
42  MatchDirectory.insert("MIGRAD", new Migrad());
43  MatchDirectory.insert("OPTION", new MatchOption());
44  MatchDirectory.insert("SIMPLEX", new Simplex());
45  MatchDirectory.insert("VARY", new VaryCmd());
46 
47  // Table commands: Use exemplars from main directory.
49  MatchDirectory.insert("SURVEY", opal->find("SURVEY"));
50  MatchDirectory.insert("TWISS", opal->find("TWISS"));
51  MatchDirectory.insert("TWISSTRACK", opal->find("TWISSTRACK"));
52  MatchDirectory.insert("TWISSTRACK", opal->find("TWISSTRACK"));
53  // JMJ 10/4/2000: added following commands here, seems harmless
54  MatchDirectory.insert("VALUE", opal->find("VALUE"));
55  MatchDirectory.insert("SYSTEM", opal->find("SYSTEM"));
56  // MatchDirectory.insert("OPTION", opal->find("OPTION")); // does not work
57 }
58 
59 
61 {}
62 
63 
64 Object *MatchParser::find(const std::string &name) const {
65  return MatchDirectory.find(name);
66 }
The global OPAL structure.
Definition: OpalData.h:54
virtual ~MatchParser()
Definition: MatchParser.cpp:60
The ENDMATCH command.
Definition: MatchEnd.h:30
The LMDIF command.
Definition: LMDif.h:45
static OpalData * getInstance()
Definition: OpalData.cpp:209
Directory MatchDirectory
Definition: MatchParser.h:51
The MIGRAD command.
Definition: Migrad.h:40
Object * find(const std::string &name) const
Find entry.
Definition: Directory.cpp:66
void insert(const std::string &name, Object *newObject)
Define new object.
Definition: Directory.cpp:77
The CONSTRAINT command.
Definition: ConstraintCmd.h:29
Object * find(const std::string &name)
Find entry.
Definition: OpalData.cpp:618
The base class for all OPAL objects.
Definition: Object.h:48
const std::string name
The OPTION command for matching.
Definition: MatchOption.h:31
virtual Object * find(const std::string &) const
Find object by name in the match command directory.
Definition: MatchParser.cpp:64
The VARY command.
Definition: VaryCmd.h:28
The SIMPLEX command.
Definition: Simplex.h:34