OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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"
22#include "Utilities/Options.h"
23
24#include <iostream>
25
26// Class OpalMarker
27// ------------------------------------------------------------------------
28
30 : OpalElement(COMMON, "MARKER", "The \"MARKER\" element defines a marker.") {
31 setElement(new MarkerRep("MARKER"));
32
33 // Construct the begin marker for beam lines.
34 OpalMarker* S = new OpalMarker("#S", this);
36 S->builtin = true;
38
39 // Construct the end marker for beam lines.
40 OpalMarker* E = new OpalMarker("#E", this);
42 E->builtin = true;
44}
45
46OpalMarker::OpalMarker(const std::string& name, OpalMarker* parent) : OpalElement(name, parent) {
47 setElement(new MarkerRep(name));
48}
49
51
52OpalMarker* OpalMarker::clone(const std::string& name) { return new OpalMarker(name, this); }
53
54void OpalMarker::print(std::ostream& os) const { OpalElement::print(os); }
55
57 // Transmit "unknown" attributes.
58 MarkerRep* mark = static_cast<MarkerRep*>(getElement());
60}
virtual void makeSharable()
Set sharable flag.
ElementBase * getElement() const
Return the embedded OPALX element.
Definition Element.h:119
void setElement(ElementBase *)
Assign new OPALX element.
Definition Element.h:123
Representation for a marker element.
Definition MarkerRep.h:31
bool builtin
Built-in flag.
Definition Object.h:226
void create(Object *newObject)
Create new object.
Definition OpalData.cpp:387
static OpalData * getInstance()
Definition OpalData.cpp:193
virtual void updateUnknown(ElementBase *)
Transmit the `‘unknown’' (not known to OPALX) attributes to OPALX.
virtual void print(std::ostream &) const
Print the object.
The MARKER element.
Definition OpalMarker.h:27
virtual OpalMarker * clone(const std::string &name)
Make clone.
OpalMarker()
Exemplar constructor.
virtual ~OpalMarker()
virtual void update()
Update the embedded OPALX marker.
virtual void print(std::ostream &) const
Print the element.