OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
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 OPALX_MonitorRep_HH
20#define OPALX_MonitorRep_HH
21
22#include "AbsBeamline/Monitor.h"
24#include "Fields/NullField.h"
25
26class MonitorRep : public Monitor {
27public:
29 explicit MonitorRep(const std::string& name);
30
31 MonitorRep();
32 MonitorRep(const MonitorRep&);
33 virtual ~MonitorRep();
34
36 // Return an identical deep copy of the element.
37 virtual ElementBase* clone() const;
38
40 // This method constructs a Channel permitting read/write access to
41 // the attribute [b]aKey[/b] and returns it.
42 // If the attribute does not exist, it returns nullptr.
43 virtual Channel* getChannel(const std::string& aKey, bool = false);
44
46 // Version for non-constant object.
47 virtual NullField& getField();
48
50 // Version for constant object.
51 virtual const NullField& getField() const;
52
54 // Return the element geometry.
55 // Version for non-constant object.
57
59 // Return the element geometry.
60 // Version for constant object.
61 virtual const StraightGeometry& getGeometry() const;
62
64 // Return the plane(s) observed by this monitor.
65 virtual Plane getPlane() const;
66
68 // If [b]flag[/b] is true, the monitor is activated, otherwise it is
69 // deactivated.
70 virtual void setActive(bool = true);
71
72protected:
75
78
80 bool active;
81
82private:
83 // Not implemented.
84 void operator=(const MonitorRep&);
85};
86
87#endif // OPALX_MonitorRep_HH
Abstract interface for read/write access to variable.
Definition Channel.h:30
NullField field
The zero magnetic field.
Definition MonitorRep.h:74
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
virtual ElementBase * clone() const
Return clone.
virtual NullField & getField()
Get field.
StraightGeometry geometry
The monitor geometry.
Definition MonitorRep.h:77
virtual StraightGeometry & getGeometry()
Get geometry.
virtual Plane getPlane() const
Get planes.
void operator=(const MonitorRep &)
virtual void setActive(bool=true)
Set active flag.
bool active
The active/inactive flag.
Definition MonitorRep.h:80
virtual ~MonitorRep()
Plane
Plane selection.
Definition Monitor.h:36
A zero electromagnetic field.
Definition NullField.h:29
A geometry representing a straight line.