OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
BeamSequence.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: BeamSequence.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.1.1.1 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: BeamSequence
10 // The abstract base class for all OPAL beam sequences (LINE and SEQUENCE).
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2000/03/27 09:33:34 $
15 // $Author: Andreas Adelmann $
16 //
17 // ------------------------------------------------------------------------
18 
22 
23 
24 // Class BeamSequence
25 // ------------------------------------------------------------------------
26 
28 {}
29 
30 
31 const std::string BeamSequence::getCategory() const {
32  return "SEQUENCE";
33 }
34 
35 
36 BeamSequence *BeamSequence::find(const std::string &name) {
38  BeamSequence *bs = dynamic_cast<BeamSequence *>(opal->find(name));
39  if(bs == 0) {
40  throw OpalException("BeamSequence::find()",
41  "Beam line or sequence \"" + name + "\" not found.");
42  }
43  return bs;
44 }
45 
46 
47 BeamSequence::BeamSequence(int size, const char *name, const char *help):
48  Element(size, name, help)
49 {}
50 
51 
52 BeamSequence::BeamSequence(const std::string &name, BeamSequence *parent):
53  Element(name, parent)
54 {}
const std::string name
The base class for all OPAL beam lines and sequences.
Definition: BeamSequence.h:32
virtual const std::string getCategory() const
Return the object category as a string.
virtual ~BeamSequence()
static BeamSequence * find(const std::string &name)
Find a BeamSequence by name.
The global OPAL structure.
Definition: OpalData.h:49
Object * find(const std::string &name)
Find entry.
Definition: OpalData.cpp:565
static OpalData * getInstance()
Definition: OpalData.cpp:195
The base class for all OPAL exceptions.
Definition: OpalException.h:28