OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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 OPALX_BeamlineVisitor_HH
34#define OPALX_BeamlineVisitor_HH
35
36// Generic element classes interacting with a BeamlineVisitor.
37class Component;
39
40// Beam line structure classes.
41class Beamline;
42class FlaggedElmPtr;
43
44// Specific element classes interacting with a BeamlineVisitor
45class Drift;
46class Laser;
47class Marker;
48class Monitor;
49class Multipole;
50class MultipoleT;
51class RBend;
52class RFCavity;
54class TravelingWave;
55class Ring;
56class SBend;
57class Solenoid;
59class Offset;
61class Probe;
62
64public:
66 virtual ~BeamlineVisitor();
67
69 virtual void execute() = 0;
70
72 virtual void visitBeamline(const Beamline&) = 0;
73
75 virtual void visitComponent(const Component&) = 0;
76
79
81 virtual void visitDrift(const Drift&) = 0;
82
84 virtual void visitLaser(const Laser&) = 0;
85
87 virtual void visitFlaggedElmPtr(const FlaggedElmPtr&) = 0;
88
90 virtual void visitMarker(const Marker&) = 0;
91
93 virtual void visitMonitor(const Monitor&) = 0;
94
96 virtual void visitMultipole(const Multipole&) = 0;
97
99 virtual void visitMultipoleT(const MultipoleT&) = 0;
100
102 virtual void visitRBend(const RBend&) = 0;
103
105 virtual void visitRFCavity(const RFCavity&) = 0;
106
108 virtual void visitVariableRFCavity(const VariableRFCavity&) = 0;
109
110 virtual void visitScalingFFAMagnet(const ScalingFFAMagnet&) = 0;
111
113 virtual void visitRing(const Ring&) = 0;
114
116 virtual void visitSBend(const SBend&) = 0;
117
119 virtual void visitSolenoid(const Solenoid&) = 0;
120
122 virtual void visitTravelingWave(const TravelingWave&) = 0;
123
126
128 virtual void visitProbe(const Probe&) = 0;
129
130private:
131 // Not implemented.
134};
135
136#endif // OPALX_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 element.
virtual void visitMultipole(const Multipole &)=0
Apply the algorithm to a multipole.
virtual void visitMarker(const Marker &)=0
Apply the algorithm to a marker.
virtual void visitScalingFFAMagnet(const ScalingFFAMagnet &)=0
virtual void visitTravelingWave(const TravelingWave &)=0
Apply the algorithm to a traveling wave.
virtual void visitProbe(const Probe &)=0
Apply the algorithm to a Probe.
virtual void visitMonitor(const Monitor &)=0
Apply the algorithm to a beam position monitor.
virtual void visitConstantEFieldCavity(const ConstantEFieldCavity &)=0
Apply the algorithm to a constant E-field cavity element.
BeamlineVisitor(const BeamlineVisitor &)
virtual void visitRing(const Ring &)=0
Apply the algorithm to a Ring element.
virtual ~BeamlineVisitor()
virtual void visitSBend(const SBend &)=0
Apply the algorithm to a sector bend.
virtual void execute()=0
Execute the algorithm on the attached beam line.
virtual void visitLaser(const Laser &)=0
Apply the algorithm to a laser element.
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 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 visitMultipoleT(const MultipoleT &)=0
Apply the algorithm to an arbitrary multipole.
An abstract sequence of beam line components.
Definition Beamline.h:34
Component applying a constant accelerating electric field (Ex,Ey,Ez).
Interface for drift space.
Definition Drift.h:31
A section of a beam line.
Passive OPALX laser element.
Definition Laser.h:25
Interface for a marker.
Definition Marker.h:31
Interface for general multipole.
Definition Multipole.h:30
Definition Probe.h:28
Abstract rectangular bend with straight body and curved reference path.
Definition RBend.h:16
Interface for standing wave cavities.
Definition RFCavity.h:34
Ring describes a ring type geometry for tracking.
Definition Ring.h:62
Abstract sector bend with planar-arc body geometry.
Definition SBend.h:15
Abstract class for a solenoid magnet.
Definition Solenoid.h:33
Interface for traveling wave cavities.