OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
Selector.h
Go to the documentation of this file.
1//
2// Class Selector
3// Set selection flags for a given range in a beam line.
4//
5// Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
6// All rights reserved
7//
8// This file is part of OPAL.
9//
10// OPAL is free software: you can redistribute it and/or modify
11// it under the terms of the GNU General Public License as published by
12// the Free Software Foundation, either version 3 of the License, or
13// (at your option) any later version.
14//
15// You should have received a copy of the GNU General Public License
16// along with OPAL. If not, see <https://www.gnu.org/licenses/>.
17//
18#ifndef OPAL_Selector_HH
19#define OPAL_Selector_HH
20
21#include <string>
23
24class Element;
25class RangeRep;
27
28class Selector : public RangeSelector {
29public:
31 // Attach visitor to [b]bl[/b]. Remember range [b]range[/b],
32 // class name [b]cName[/b], type name [b]tName[/b], and pattern
33 // string [b]pString[/b].
35 const Beamline&, const RangeRep& range, const std::string& cName,
36 const std::string& tName, const std::string& pString);
37
38 virtual ~Selector();
39
41 virtual void execute();
42
44 int getCount() const;
45
46protected:
48 virtual void handleElement(const FlaggedElmPtr&);
49
50private:
51 // Not implemented.
54 void operator=(const Selector&);
55
56 // Class of "SELECT", or zero.
58
59 // Type name of "SELECT".
60 const std::string itsType;
61
62 // Pattern of "SELECT", or zero.
64
65 // The count of selected elements.
67};
68
69#endif // OPAL_Selector_HH
An abstract sequence of beam line components.
Definition Beamline.h:34
A section of a beam line.
Representation of a range within a beam line or sequence.
Definition RangeRep.h:33
A regular expression.
void operator=(const Selector &)
virtual void handleElement(const FlaggedElmPtr &)
The operation to be done for elements.
Definition Selector.cpp:53
int getCount() const
Return the count of selected elements.
Definition Selector.cpp:79
Selector(const Selector &)
virtual ~Selector()
Definition Selector.cpp:46
virtual void execute()
Execute the selection.
Definition Selector.cpp:48
const std::string itsType
Definition Selector.h:60
int itsCount
Definition Selector.h:66
const Element * itsClass
Definition Selector.h:57
const RegularExpression * itsPattern
Definition Selector.h:63