OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
YCorrectorRep.cpp
Go to the documentation of this file.
1 //
2 // Class YCorrectorRep
3 // Representation for an orbit corrector.
4 // Acts on the vertical plane.
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 //
21 
22 namespace {
23  struct Entry {
24  const char *name;
25  double(YCorrectorRep::*get)() const;
26  void (YCorrectorRep::*set)(double);
27  };
28 
29  const Entry entries[] = {
30  {
31  "L",
34  },
35  {
36  "BX",
39  },
40  { 0, 0, 0 }
41  };
42 }
43 
44 
46  CorrectorRep()
47 {}
48 
49 
51  CorrectorRep(right)
52 {}
53 
54 
55 YCorrectorRep::YCorrectorRep(const std::string &name):
56  CorrectorRep(name)
57 {}
58 
59 
61 {}
62 
63 
65  return new YCorrectorRep(*this);
66 }
67 
68 
69 Channel *YCorrectorRep::getChannel(const std::string &aKey, bool create) {
70  for(const Entry *entry = entries; entry->name != 0; ++entry) {
71  if(aKey == entry->name) {
72  return new IndirectChannel<YCorrectorRep>(*this, entry->get, entry->set);
73  }
74  }
75 
76  return ElementBase::getChannel(aKey, create);
77 }
78 
79 
81  return Y;
82 }
83 
84 
85 double YCorrectorRep::getBy() const {
86  return 0.0;
87 }
88 
89 
90 void YCorrectorRep::setBy(double) {
91  // Do nothing.
92 }
virtual ElementBase * clone() const
Return clone.
Plane
Plane selection.
Definition: Corrector.h:40
virtual ~YCorrectorRep()
Corrector acts on y-plane.
Definition: Corrector.h:46
virtual void setBx(double)
Set horizontal field component in Teslas.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
virtual Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE:162
virtual double getBx() const
Get horizontal field component in Teslas.
set(_SRCS Action.cpp Attribute.cpp AttributeBase.cpp AttributeHandler.cpp BeamSequence.cpp Definition.cpp Directory.cpp Element.cpp Invalidator.cpp OpalData.cpp Object.cpp ObjectFunction.cpp PlaceRep.cpp RangeRep.cpp Table.cpp TableRowRep.cpp ValueDefinition.cpp) include_directories($
Definition: CMakeLists.txt:1
Abstract interface for read/write access to variable.
Definition: Channel.h:32
Access to a [b]double[/b] data member.
virtual void setBy(double)
Set field.
virtual double getElementLength() const
Get design length.
Definition: ElementBase.h:415
virtual double getBy() const
Get field.
const std::string name
virtual void setElementLength(double length)
Set design length.
Definition: ElementBase.h:419
virtual Plane getPlane() const
Get plane.