OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
BeamlineVisitor.h
Go to the documentation of this file.
1//
2// Class BeamlineVisitor
3// The abstract class BeamlineVisitor is the base class for all visitors
4// (algorithms) that can iterator over a beam line representation.
5// A BeamlineVisitor applies itself to the representation via the
6// ``Visitor'' pattern, see
7// [p]
8// E. Gamma, R. Helm, R. Johnson, and J. Vlissides,
9// [BR]
10// Design Patterns, Elements of Reusable Object-Oriented Software.
11// [p]
12// By using only pure abstract classes as an interface between the
13// BeamlineVisitor and the beam line representation,
14// we decouple the former from the implementation details of the latter.
15// [p]
16// The interface is defined in such a way that a visitor cannot modify the
17// structure of a beam line, but it can assign special data like misalignments
18// or integrators without problems.
19//
20// Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
21// All rights reserved
22//
23// This file is part of OPAL.
24//
25// OPAL is free software: you can redistribute it and/or modify
26// it under the terms of the GNU General Public License as published by
27// the Free Software Foundation, either version 3 of the License, or
28// (at your option) any later version.
29//
30// You should have received a copy of the GNU General Public License
31// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
32//
33#ifndef CLASSIC_BeamlineVisitor_HH
34#define CLASSIC_BeamlineVisitor_HH
35
36// Generic element classes interacting with a BeamlineVisitor.
37class Component;
38
39// Beam line structure classes.
40class Beamline;
41class FlaggedElmPtr;
42
43// Specific element classes interacting with a BeamlineVisitor
44class CCollimator;
45class Corrector;
46class Cyclotron;
47class Degrader;
48class Drift;
50class Marker;
51class Monitor;
52class Multipole;
53class MultipoleT;
57class Offset;
58class OutputPlane;
59class Probe;
60class RBend;
61class RBend3D;
62class RFCavity;
63class Ring;
64class SBend;
65class SBend3D;
67class Septum;
68class Solenoid;
69class Source;
70class Stripper;
71class TravelingWave;
72#ifdef ENABLE_OPAL_FEL
73class Undulator;
74#endif
75class Vacuum;
79
81
82public:
83
85 virtual ~BeamlineVisitor();
86
88 virtual void execute() = 0;
89
91 virtual void visitBeamline(const Beamline &) = 0;
92
94 virtual void visitCCollimator(const CCollimator &) = 0;
95
97 virtual void visitComponent(const Component &) = 0;
98
100 virtual void visitCorrector(const Corrector &) = 0;
101
103 virtual void visitCyclotron(const Cyclotron &) = 0;
104
106 virtual void visitDegrader(const Degrader &) = 0;
107
109 virtual void visitDrift(const Drift &) = 0;
110
112 virtual void visitFlaggedElmPtr(const FlaggedElmPtr &) = 0;
113
116
118 virtual void visitMarker(const Marker &) = 0;
119
121 virtual void visitMonitor(const Monitor &) = 0;
122
124 virtual void visitMultipole(const Multipole &) = 0;
125
127 virtual void visitMultipoleT(const MultipoleT &) = 0;
128
130 virtual void visitOffset(const Offset &) = 0;
131
133 virtual void visitOutputPlane(const OutputPlane &) = 0;
134
136 virtual void visitProbe(const Probe &) = 0;
137
139 virtual void visitRBend(const RBend &) = 0;
140
142 virtual void visitRBend3D(const RBend3D &);
143
145 virtual void visitRFCavity(const RFCavity &) = 0;
146
148 virtual void visitRing(const Ring &) = 0;
149
151 virtual void visitSBend(const SBend &) = 0;
152
154 virtual void visitSBend3D(const SBend3D &) = 0;
155
157 virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &) = 0;
158
160 virtual void visitSeptum(const Septum &) = 0;
161
163 virtual void visitSolenoid(const Solenoid &) = 0;
164
166 virtual void visitSource(const Source &) = 0;
167
169 virtual void visitStripper(const Stripper &) = 0;
170
172 virtual void visitTravelingWave(const TravelingWave &) = 0;
173
174#ifdef ENABLE_OPAL_FEL
176 virtual void visitUndulator(const Undulator &) = 0;
177#endif
178
180 virtual void visitVacuum(const Vacuum &) = 0;
181
183 virtual void visitVariableRFCavity(const VariableRFCavity &) = 0;
184
187 (const VariableRFCavityFringeField &) = 0;
188
190 virtual void visitVerticalFFAMagnet(const VerticalFFAMagnet &) = 0;
191
192private:
193
194 // Not implemented.
197};
198
199inline
201
202}
203
204#endif // CLASSIC_BeamlineVisitor_HH
void operator=(const BeamlineVisitor &)
virtual void visitVerticalFFAMagnet(const VerticalFFAMagnet &)=0
Apply the algorithm to a vertical FFA magnet.
virtual void visitSolenoid(const Solenoid &)=0
Apply the algorithm to a solenoid.
virtual void visitMultipole(const Multipole &)=0
Apply the algorithm to a multipole.
virtual void visitDegrader(const Degrader &)=0
Apply the algorithm to a degrader.
virtual void visitMarker(const Marker &)=0
Apply the algorithm to a marker.
virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &)=0
Apply the algorithm to a scaling FFA magnet.
virtual void visitSBend3D(const SBend3D &)=0
Apply the algorithm to a sector bend with 3D field map.
virtual void visitTravelingWave(const TravelingWave &)=0
Apply the algorithm to a traveling wave.
virtual void visitRBend3D(const RBend3D &)
Apply the algorithm to a rectangular bend.
virtual void visitProbe(const Probe &)=0
Apply the algorithm to a probe.
virtual void visitFlexibleCollimator(const FlexibleCollimator &)=0
Apply the algorithm to a flexible collimator.
virtual void visitVariableRFCavityFringeField(const VariableRFCavityFringeField &)=0
Apply the algorithm to a variable RF cavity with Fringe Field.
virtual void visitSource(const Source &)=0
Apply the algorithm to a source.
virtual void visitMonitor(const Monitor &)=0
Apply the algorithm to a beam position monitor.
BeamlineVisitor(const BeamlineVisitor &)
virtual void visitRing(const Ring &)=0
Apply the algorithm to a ring.
virtual void visitOutputPlane(const OutputPlane &)=0
Apply the algorithm to an outputplane.
virtual ~BeamlineVisitor()
virtual void visitSBend(const SBend &)=0
Apply the algorithm to a sector bend.
virtual void visitSeptum(const Septum &)=0
Apply the algorithm to a septum magnet.
virtual void execute()=0
Execute the algorithm on the attached beam line.
virtual void visitOffset(const Offset &)=0
Apply the algorithm to an offset (placement).
virtual void visitStripper(const Stripper &)=0
Apply the algorithm to a particle stripper.
virtual void visitDrift(const Drift &)=0
Apply the algorithm to a drift space.
virtual void visitComponent(const Component &)=0
Apply the algorithm to an arbitrary component.
virtual void visitCorrector(const Corrector &)=0
Apply the algorithm to a closed orbit corrector.
virtual void visitCCollimator(const CCollimator &)=0
Apply the algorithm to a collimator.
virtual void visitVacuum(const Vacuum &)=0
Apply the algorithm to a vacuum space.
virtual void visitBeamline(const Beamline &)=0
Apply the algorithm to a beam line.
virtual void visitRBend(const RBend &)=0
Apply the algorithm to a rectangular bend.
virtual void visitVariableRFCavity(const VariableRFCavity &)=0
Apply the algorithm to a variable RF cavity.
virtual void visitRFCavity(const RFCavity &)=0
Apply the algorithm to a RF cavity.
virtual void visitFlaggedElmPtr(const FlaggedElmPtr &)=0
Apply the algorithm to a FlaggedElmPtr.
virtual void visitCyclotron(const Cyclotron &)=0
Apply the algorithm to a cyclotron.
virtual void visitMultipoleT(const MultipoleT &)=0
Apply the algorithm to an arbitrary multipole.
Interface for a single beam element.
Definition Component.h:50
Interface for general corrector.
Definition Corrector.h:35
Interface for drift space.
Definition Drift.h:33
Interface for a marker.
Definition Marker.h:32
Interface for general multipole.
Definition Multipole.h:47
Definition Probe.h:28
Definition RBend.h:58
Interface for solenoids.
Definition RBend3D.h:39
Ring describes a ring type geometry for tracking.
Definition Ring.h:53
Definition SBend.h:68
Interface for solenoids.
Definition Solenoid.h:36
An abstract sequence of beam line components.
Definition Beamline.h:34
A section of a beam line.