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