OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
RangeSelector.h
Go to the documentation of this file.
1//
2// Class RangeSelector
3// This abstract class runs through a beam line and calls the pure
4// virtual methods RangeSelector::handleXXX() for each element or
5// beamline in a range.
6//
7// Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
8// All rights reserved
9//
10// This file is part of OPAL.
11//
12// OPAL is free software: you can redistribute it and/or modify
13// it under the terms of the GNU General Public License as published by
14// the Free Software Foundation, either version 3 of the License, or
15// (at your option) any later version.
16//
17// You should have received a copy of the GNU General Public License
18// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
19//
20#ifndef OPAL_RangeSelector_HH
21#define OPAL_RangeSelector_HH
22
25
26class Beamline;
27
28
30
31public:
32
34 // Attach visitor to a beamline, remember the range.
35 RangeSelector(const Beamline &, const RangeRep &range);
36
37 virtual ~RangeSelector();
38
40 virtual void execute();
41
43 virtual void visitFlaggedElmPtr(const FlaggedElmPtr &);
44
45protected:
46
48 // When overriding, make sure the beamline members are handled.
49 virtual void handleBeamline(const FlaggedElmPtr &);
50
52 virtual void handleElement(const FlaggedElmPtr &);
53
56
57private:
58
59 // Not implemented.
62 void operator=(const RangeSelector &);
63};
64
65#endif // OPAL_RangeSelector_HH
Representation of a range within a beam line or sequence.
Definition: RangeRep.h:34
An abstract sequence of beam line components.
Definition: Beamline.h:34
A section of a beam line.
Definition: FlaggedElmPtr.h:36
virtual void handleElement(const FlaggedElmPtr &)
The operation to be done for elements.
virtual ~RangeSelector()
virtual void visitFlaggedElmPtr(const FlaggedElmPtr &)
Apply the visitor to an FlaggedElmPtr.
RangeSelector(const RangeSelector &)
virtual void handleBeamline(const FlaggedElmPtr &)
The operation to be done for beamlines.
virtual void execute()
Execute the algorithm.
void operator=(const RangeSelector &)
RangeRep itsRange
Working data for range.
Definition: RangeSelector.h:55