OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
MonitorRep.h
Go to the documentation of this file.
1 //
2 // Class MonitorRep
3 // Representation for an orbit position monitor.
4 // The base class observes both planes.
5 //
6 // Copyright (c) 200x - 2020, Paul Scherrer Institut, Villigen PSI, Switzerland
7 // All rights reserved
8 //
9 // This file is part of OPAL.
10 //
11 // OPAL is free software: you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation, either version 3 of the License, or
14 // (at your option) any later version.
15 //
16 // You should have received a copy of the GNU General Public License
17 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
18 //
19 #ifndef CLASSIC_MonitorRep_HH
20 #define CLASSIC_MonitorRep_HH
21 
22 #include "AbsBeamline/Monitor.h"
24 #include "Fields/NullField.h"
25 
26 class MonitorRep: public Monitor {
27 
28 public:
29 
31  explicit MonitorRep(const std::string &name);
32 
33  MonitorRep();
34  MonitorRep(const MonitorRep &);
35  virtual ~MonitorRep();
36 
38  // Return an identical deep copy of the element.
39  virtual ElementBase *clone() const;
40 
42  // This method constructs a Channel permitting read/write access to
43  // the attribute [b]aKey[/b] and returns it.
44  // If the attribute does not exist, it returns NULL.
45  virtual Channel *getChannel(const std::string &aKey, bool = false);
46 
48  // Version for non-constant object.
49  virtual NullField &getField();
50 
52  // Version for constant object.
53  virtual const NullField &getField() const;
54 
56  // Return the element geometry.
57  // Version for non-constant object.
58  virtual StraightGeometry &getGeometry();
59 
61  // Return the element geometry.
62  // Version for constant object.
63  virtual const StraightGeometry &getGeometry() const;
64 
66  // Return the plane(s) observed by this monitor.
67  virtual Plane getPlane() const;
68 
70  // If [b]flag[/b] is true, the monitor is activated, otherwise it is
71  // deactivated.
72  virtual void setActive(bool = true);
73 
74 protected:
75 
78 
81 
83  bool active;
84 
85 private:
86 
87  // Not implemented.
88  void operator=(const MonitorRep &);
89 };
90 
91 #endif // CLASSIC_MonitorRep_HH
const std::string name
Plane
Plane selection.
Definition: Monitor.h:37
NullField field
The zero magnetic field.
Definition: MonitorRep.h:77
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: MonitorRep.cpp:64
virtual ElementBase * clone() const
Return clone.
Definition: MonitorRep.cpp:59
virtual NullField & getField()
Get field.
Definition: MonitorRep.cpp:75
StraightGeometry geometry
The monitor geometry.
Definition: MonitorRep.h:80
virtual StraightGeometry & getGeometry()
Get geometry.
Definition: MonitorRep.cpp:84
virtual Plane getPlane() const
Get planes.
Definition: MonitorRep.cpp:93
void operator=(const MonitorRep &)
virtual void setActive(bool=true)
Set active flag.
Definition: MonitorRep.cpp:98
bool active
The active/inactive flag.
Definition: MonitorRep.h:83
virtual ~MonitorRep()
Definition: MonitorRep.cpp:55
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
A zero electromagnetic field.
Definition: NullField.h:30