OPAL (Object Oriented Parallel Accelerator Library) 2022.1
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 Probe;
59class RBend;
60class RBend3D;
61class RFCavity;
62class Ring;
63class SBend;
64class SBend3D;
66class Septum;
67class Solenoid;
68class Source;
69class Stripper;
70class TravelingWave;
71#ifdef ENABLE_OPAL_FEL
72class Undulator;
73#endif
74class Vacuum;
78
80
81public:
82
84 virtual ~BeamlineVisitor();
85
87 virtual void execute() = 0;
88
90 virtual void visitBeamline(const Beamline &) = 0;
91
93 virtual void visitCCollimator(const CCollimator &) = 0;
94
96 virtual void visitComponent(const Component &) = 0;
97
99 virtual void visitCorrector(const Corrector &) = 0;
100
102 virtual void visitCyclotron(const Cyclotron &) = 0;
103
105 virtual void visitDegrader(const Degrader &) = 0;
106
108 virtual void visitDrift(const Drift &) = 0;
109
111 virtual void visitFlaggedElmPtr(const FlaggedElmPtr &) = 0;
112
115
117 virtual void visitMarker(const Marker &) = 0;
118
120 virtual void visitMonitor(const Monitor &) = 0;
121
123 virtual void visitMultipole(const Multipole &) = 0;
124
126 virtual void visitMultipoleT(const MultipoleT &) = 0;
127
130
133
136
138 virtual void visitOffset(const Offset &) = 0;
139
141 virtual void visitProbe(const Probe &) = 0;
142
144 virtual void visitRBend(const RBend &) = 0;
145
147 virtual void visitRBend3D(const RBend3D &);
148
150 virtual void visitRFCavity(const RFCavity &) = 0;
151
153 virtual void visitRing(const Ring &) = 0;
154
156 virtual void visitSBend(const SBend &) = 0;
157
159 virtual void visitSBend3D(const SBend3D &) = 0;
160
162 virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &) = 0;
163
165 virtual void visitSeptum(const Septum &) = 0;
166
168 virtual void visitSolenoid(const Solenoid &) = 0;
169
171 virtual void visitSource(const Source &) = 0;
172
174 virtual void visitStripper(const Stripper &) = 0;
175
177 virtual void visitTravelingWave(const TravelingWave &) = 0;
178
179#ifdef ENABLE_OPAL_FEL
181 virtual void visitUndulator(const Undulator &) = 0;
182#endif
183
185 virtual void visitVacuum(const Vacuum &) = 0;
186
188 virtual void visitVariableRFCavity(const VariableRFCavity &) = 0;
189
192 (const VariableRFCavityFringeField &) = 0;
193
195 virtual void visitVerticalFFAMagnet(const VerticalFFAMagnet &) = 0;
196
197private:
198
199 // Not implemented.
202};
203
204inline
206
207}
208
209#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 visitMultipoleTCurvedVarRadius(const MultipoleTCurvedVarRadius &)=0
Apply the algorithm to an arbitrary curved multipole of variable radius.
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 visitMultipoleTCurvedConstRadius(const MultipoleTCurvedConstRadius &)=0
Apply the algorithm to an arbitrary curved multipole of constant radius.
virtual void visitVariableRFCavityFringeField(const VariableRFCavityFringeField &)=0
Apply the algorithm to a variable RF cavity with Fringe Field.
virtual void visitMultipoleTStraight(const MultipoleTStraight &)=0
Apply the algorithm to an arbitrary straight multipole.
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 ~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: Offset.h:66
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:64
Definition: SBend.h:68
Definition: Septum.h:23
Interface for solenoids.
Definition: Solenoid.h:36
Definition: Source.h:30
Definition: Vacuum.h:61
An abstract sequence of beam line components.
Definition: Beamline.h:34
A section of a beam line.
Definition: FlaggedElmPtr.h:36