OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
Selector.h
Go to the documentation of this file.
1 #ifndef OPAL_Selector_HH
2 #define OPAL_Selector_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: Selector.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.2 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: Selector
13 //
14 // ------------------------------------------------------------------------
15 //
16 // $Date: 2001/08/13 15:25:22 $
17 // $Author: jowett $
18 //
19 // ------------------------------------------------------------------------
20 
21 #include "Tables/RangeSelector.h"
22 #include <string>
23 
24 class Element;
25 class RangeRep;
26 class RegularExpression;
27 
28 
29 // Class Selector
30 // ------------------------------------------------------------------------
32 
33 class Selector: public RangeSelector {
34 
35 public:
36 
38  // Attach visitor to [b]bl[/b]. Remember range [b]range[/b],
39  // class name [b]cName[/b], type name [b]tName[/b], and pattern
40  // string [b]pString[/b].
41  Selector(const Beamline &, const RangeRep &range, const std::string &cName,
42  const std::string &tName, const std::string &pString);
43 
44  virtual ~Selector();
45 
47  virtual void execute();
48 
50  int getCount() const;
51 
52 protected:
53 
55  virtual void handleElement(const FlaggedElmPtr &);
56 
57 private:
58 
59  // Not implemented.
60  Selector();
61  Selector(const Selector &);
62  void operator=(const Selector &);
63 
64  // Class of "SELECT", or zero.
65  const Element *itsClass;
66 
67  // Type name of "SELECT".
68  const std::string itsType;
69 
70  // Pattern of "SELECT", or zero.
72 
73  // The count of selected elements.
74  int itsCount;
75 };
76 
77 #endif // OPAL_Selector_HH
const Element * itsClass
Definition: Selector.h:65
virtual ~Selector()
Definition: Selector.cpp:53
A regular expression.
An abstract visitor which calls the pure virtual method.
Definition: RangeSelector.h:32
Set selection flags for a given range in a beam line.
Definition: Selector.h:33
const RegularExpression * itsPattern
Definition: Selector.h:71
The base class for all OPAL elements.
Definition: Element.h:46
void operator=(const Selector &)
const std::string itsType
Definition: Selector.h:68
Representation of a range within a beam line or sequence.
Definition: RangeRep.h:34
An abstract sequence of beam line components.
Definition: Beamline.h:37
virtual void handleElement(const FlaggedElmPtr &)
The operation to be done for elements.
Definition: Selector.cpp:64
virtual void execute()
Execute the selection.
Definition: Selector.cpp:58
int getCount() const
Return the count of selected elements.
Definition: Selector.cpp:91
int itsCount
Definition: Selector.h:74
A section of a beam line.
Definition: FlaggedElmPtr.h:36