OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
OpalMarker.cpp
Go to the documentation of this file.
1 // ------------------------------------------------------------------------
2 // $RCSfile: OpalMarker.cpp,v $
3 // ------------------------------------------------------------------------
4 // $Revision: 1.4 $
5 // ------------------------------------------------------------------------
6 // Copyright: see Copyright.readme
7 // ------------------------------------------------------------------------
8 //
9 // Class: OpalMarker
10 // The class of OPAL markers.
11 //
12 // ------------------------------------------------------------------------
13 //
14 // $Date: 2002/01/22 15:16:02 $
15 // $Author: jsberg $
16 //
17 // ------------------------------------------------------------------------
18 
19 #include "Elements/OpalMarker.h"
21 #include "Utilities/Options.h"
22 #include "BeamlineCore/MarkerRep.h"
23 
24 #include <iostream>
25 
26 
27 // Class OpalMarker
28 // ------------------------------------------------------------------------
29 
31  OpalElement(COMMON, "MARKER",
32  "The \"MARKER\" element defines a marker.") {
33  setElement(new MarkerRep("MARKER"));
34 
35  // Construct the begin marker for beam lines.
36  OpalMarker *S = new OpalMarker("#S", this);
37  S->getElement()->makeSharable();
38  S->builtin = true;
40 
41  // Construct the end marker for beam lines.
42  OpalMarker *E = new OpalMarker("#E", this);
43  E->getElement()->makeSharable();
44  E->builtin = true;
46 }
47 
48 
49 OpalMarker::OpalMarker(const std::string &name, OpalMarker *parent):
50  OpalElement(name, parent) {
52 }
53 
54 
56 {}
57 
58 
59 OpalMarker *OpalMarker::clone(const std::string &name) {
60  return new OpalMarker(name, this);
61 }
62 
63 
64 void OpalMarker::print(std::ostream &os) const {
66 }
67 
68 
70  // Transmit "unknown" attributes.
71  MarkerRep *mark = dynamic_cast<MarkerRep *>(getElement());
73 }
const std::string name
ElementBase * getElement() const
Return the embedded CLASSIC element.
Definition: Element.h:120
void setElement(ElementBase *)
Assign new CLASSIC element.
Definition: Element.h:125
bool builtin
Built-in flag.
Definition: Object.h:233
void create(Object *newObject)
Create new object.
Definition: OpalData.cpp:475
static OpalData * getInstance()
Definition: OpalData.cpp:195
virtual void makeSharable()
Set sharable flag.
Representation for a marker element.
Definition: MarkerRep.h:32
virtual void updateUnknown(ElementBase *)
Transmit the `‘unknown’' (not known to OPAL) attributes to CLASSIC.
virtual void print(std::ostream &) const
Print the object.
The MARKER element.
Definition: OpalMarker.h:28
virtual OpalMarker * clone(const std::string &name)
Make clone.
Definition: OpalMarker.cpp:59
OpalMarker()
Exemplar constructor.
Definition: OpalMarker.cpp:30
virtual ~OpalMarker()
Definition: OpalMarker.cpp:55
virtual void update()
Update the embedded CLASSIC marker.
Definition: OpalMarker.cpp:69
virtual void print(std::ostream &) const
Print the element.
Definition: OpalMarker.cpp:64