OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
RangeRep.h
Go to the documentation of this file.
1#ifndef OPAL_RangeRep_HH
2#define OPAL_RangeRep_HH
3
4// ------------------------------------------------------------------------
5// $RCSfile: RangeRep.h,v $
6// ------------------------------------------------------------------------
7// $Revision: 1.1.1.1 $
8// ------------------------------------------------------------------------
9// Copyright: see Copyright.readme
10// ------------------------------------------------------------------------
11//
12// Class: RangeRep
13//
14// ------------------------------------------------------------------------
15//
16// $Date: 2000/03/27 09:33:35 $
17// $Author: Andreas Adelmann $
18//
19// ------------------------------------------------------------------------
20
22
23class FlaggedElmPtr;
24
25// Class RangeRep
26// ------------------------------------------------------------------------
28// This representation holds two places, defining the beginning and ending
29// of the range. It keeps track wether we are before, within, or after
30// the range.
31// The value may also be "FULL", denoting the complete beam line.
32
33class RangeRep {
34public:
36 // Construct range for full line (value "FULL").
37 RangeRep();
38
41
42 RangeRep(const RangeRep&);
43 ~RangeRep();
44 const RangeRep& operator=(const RangeRep&);
45
47 // Sets the internal state to the beginning of the beam line.
48 void initialize();
49
51 // Return true, if we are within the specified range.
52 bool isActive() const;
53
55 // Sets the internal state to active, when we enter the specified range.
56 void enter(const FlaggedElmPtr&) const;
57
59 // Sets the internal state to inactive, when we leave the specified range.
60 void leave(const FlaggedElmPtr&) const;
61
63 void print(std::ostream& os) const;
64
65private:
66 // The begin/end Place structures.
69
70 // Flag for full range. If true the places are not looked at.
72
73 // If true we are within this range.
74 mutable bool status;
75};
76
77inline std::ostream& operator<<(std::ostream& os, const RangeRep& val) {
78 val.print(os);
79 return os;
80}
81
82#endif // OPAL_RangeRep_HH
std::ostream & operator<<(std::ostream &os, const RangeRep &val)
Definition RangeRep.h:77
A section of a beam line.
Representation of a place within a beam line or sequence.
Definition PlaceRep.h:40
Representation of a range within a beam line or sequence.
Definition RangeRep.h:33
PlaceRep first
Definition RangeRep.h:67
bool isActive() const
Test for active range.
Definition RangeRep.cpp:52
const RangeRep & operator=(const RangeRep &)
Definition RangeRep.cpp:35
void initialize()
Initialise data for search.
Definition RangeRep.cpp:42
PlaceRep last
Definition RangeRep.h:68
bool fullRange
Definition RangeRep.h:71
void print(std::ostream &os) const
Print in input format.
Definition RangeRep.cpp:72
void leave(const FlaggedElmPtr &) const
Leave an element or line.
Definition RangeRep.cpp:63
bool status
Definition RangeRep.h:74
RangeRep()
Default constructor.
Definition RangeRep.cpp:26
void enter(const FlaggedElmPtr &) const
Enter an element or line.
Definition RangeRep.cpp:54