OPALX (Object Oriented Parallel Accelerator Library for Exascal) MINIorX
OPALX
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 Drift;
45class Marker;
46class Monitor;
47class Multipole;
48class MultipoleT;
52class RFCavity;
53class TravelingWave;
54class Ring;
55class Solenoid;
57class Offset;
59class Probe;
60
62public:
64 virtual ~BeamlineVisitor();
65
67 virtual void execute() = 0;
68
70 virtual void visitBeamline(const Beamline&) = 0;
71
73 virtual void visitComponent(const Component&) = 0;
74
76 virtual void visitDrift(const Drift&) = 0;
77
79 virtual void visitFlaggedElmPtr(const FlaggedElmPtr&) = 0;
80
82 virtual void visitMarker(const Marker&) = 0;
83
85 virtual void visitMonitor(const Monitor&) = 0;
86
88 virtual void visitMultipole(const Multipole&) = 0;
89
91 virtual void visitMultipoleT(const MultipoleT&) = 0;
92
95
98
101
103 virtual void visitOffset(const Offset&) = 0;
104
106 virtual void visitRFCavity(const RFCavity&) = 0;
107
108 virtual void visitScalingFFAMagnet(const ScalingFFAMagnet&) = 0;
109
111 virtual void visitRing(const Ring&) = 0;
112
114 virtual void visitSolenoid(const Solenoid&) = 0;
115
117 virtual void visitTravelingWave(const TravelingWave&) = 0;
118
121
123 virtual void visitProbe(const Probe&) = 0;
124
125private:
126 // Not implemented.
129};
130
131#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 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 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 visitMultipoleTCurvedConstRadius(const MultipoleTCurvedConstRadius &)=0
Apply the algorithm to an arbitrary curved multipole of constant radius.
virtual void visitMultipoleTStraight(const MultipoleTStraight &)=0
Apply the algorithm to an arbitrary straight multipole.
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 element.
virtual ~BeamlineVisitor()
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 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 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.
Interface for a single beam element.
Definition Component.h:50
Interface for drift space.
Definition Drift.h:31
Interface for a marker.
Definition Marker.h:32
Interface for general multipole.
Definition Multipole.h:45
Definition Probe.h:28
Ring describes a ring type geometry for tracking.
Definition Ring.h:62
Interface for solenoids.
Definition Solenoid.h:34
An abstract sequence of beam line components.
Definition Beamline.h:34
A section of a beam line.