OPAL (Object Oriented Parallel Accelerator Library)  2.2.0
OPAL
MonitorRep.h
Go to the documentation of this file.
1 #ifndef CLASSIC_MonitorRep_HH
2 #define CLASSIC_MonitorRep_HH
3 
4 // ------------------------------------------------------------------------
5 // $RCSfile: MonitorRep.h,v $
6 // ------------------------------------------------------------------------
7 // $Revision: 1.1.1.1 $
8 // ------------------------------------------------------------------------
9 // Copyright: see Copyright.readme
10 // ------------------------------------------------------------------------
11 //
12 // Class: MonitorRep
13 //
14 // ------------------------------------------------------------------------
15 // Class category: BeamlineCore
16 // ------------------------------------------------------------------------
17 //
18 // $Date: 2000/03/27 09:32:33 $
19 // $Author: fci $
20 //
21 // ------------------------------------------------------------------------
22 
23 #include "AbsBeamline/Monitor.h"
25 #include "Fields/NullField.h"
26 
27 // Class MonitorRep
28 // ------------------------------------------------------------------------
30 // The base class observes both planes.
31 
32 class MonitorRep: public Monitor {
33 
34 public:
35 
37  explicit MonitorRep(const std::string &name);
38 
39  MonitorRep();
40  MonitorRep(const MonitorRep &);
41  virtual ~MonitorRep();
42 
44  // Return an identical deep copy of the element.
45  virtual ElementBase *clone() const;
46 
48  // This method constructs a Channel permitting read/write access to
49  // the attribute [b]aKey[/b] and returns it.
50  // If the attribute does not exist, it returns NULL.
51  virtual Channel *getChannel(const std::string &aKey, bool = false);
52 
54  // Version for non-constant object.
55  virtual NullField &getField();
56 
58  // Version for constant object.
59  virtual const NullField &getField() const;
60 
62  // Return the element geometry.
63  // Version for non-constant object.
64  virtual StraightGeometry &getGeometry();
65 
67  // Return the element geometry.
68  // Version for constant object.
69  virtual const StraightGeometry &getGeometry() const;
70 
72  // Return the image of the element, containing the name and type string
73  // of the element, and a copy of the user-defined attributes.
74  virtual ElementImage *getImage() const;
75 
77  // Return the plane(s) observed by this monitor.
78  virtual Plane getPlane() const;
79 
81  // If [b]flag[/b] is true, the monitor is activated, otherwise it is
82  // deactivated.
83  virtual void setActive(bool = true);
84 
85 protected:
86 
89 
92 
94  bool active;
95 
96 private:
97 
98  // Not implemented.
99  void operator=(const MonitorRep &);
100 };
101 
102 #endif // CLASSIC_MonitorRep_HH
Interface for basic beam line object.
Definition: ElementBase.h:128
NullField field
The zero magnetic field.
Definition: MonitorRep.h:88
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
Definition: MonitorRep.cpp:75
Interface for beam position monitors.
Definition: Monitor.h:41
virtual Plane getPlane() const
Get planes.
Definition: MonitorRep.cpp:115
virtual NullField & getField()
Get field.
Definition: MonitorRep.cpp:86
StraightGeometry geometry
The monitor geometry.
Definition: MonitorRep.h:91
virtual StraightGeometry & getGeometry()
Get geometry.
Definition: MonitorRep.cpp:95
A zero electromagnetic field.
Definition: NullField.h:30
virtual ElementImage * getImage() const
Construct an image.
Definition: MonitorRep.cpp:104
An image of an element.
Definition: ElementImage.h:35
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition: Channel.h:32
const std::string name
virtual ~MonitorRep()
Definition: MonitorRep.cpp:66
Representation for an orbit position monitor.
Definition: MonitorRep.h:32
virtual ElementBase * clone() const
Return clone.
Definition: MonitorRep.cpp:70
bool active
The active/inactive flag.
Definition: MonitorRep.h:94
virtual void setActive(bool=true)
Set active flag.
Definition: MonitorRep.cpp:120
void operator=(const MonitorRep &)
Plane
Plane selection.
Definition: Monitor.h:46