OPAL (Object Oriented Parallel Accelerator Library)  2024.1
OPAL
CCollimatorRep.cpp
Go to the documentation of this file.
1 //
2 // Class CCollimatorRep
3 // Representation for a collimator.
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 //
20 
21 
22 namespace {
23  struct Entry {
24  const char *name;
25  double(CCollimatorRep::*get)() const;
26  void (CCollimatorRep::*set)(double);
27  };
28 
29  const Entry entries[] = {
30  {
31  "L",
34  },
35  { 0, 0, 0 }
36  };
37 }
38 
39 
41  CCollimator(),
42  geometry(0.0)
43 {}
44 
45 
47  CCollimator(right),
48  geometry(right.geometry)
49 {}
50 
51 
53  CCollimator(name),
54  geometry()
55 {}
56 
57 
59 {}
60 
61 
63  return new CCollimatorRep(*this);
64 }
65 
66 
67 Channel *CCollimatorRep::getChannel(const std::string &aKey, bool create) {
68  for(const Entry *entry = entries; entry->name != 0; ++entry) {
69  if(aKey == entry->name) {
70  return new IndirectChannel<CCollimatorRep>(*this, entry->get, entry->set);
71  }
72  }
73 
74  return ElementBase::getChannel(aKey, create);
75 }
76 
77 
79  return field;
80 }
81 
83  return field;
84 }
85 
86 
88  return geometry;
89 }
90 
92  return geometry;
93 }
94 
95 
96 
97 /*
98 double CCollimatorRep::getXsize() const
99 {
100  return xSize;
101 }
102 
103 double CCollimatorRep::getYsize() const
104 {
105  return ySize;
106 }
107 
108 void CCollimatorRep::setXsize(double size)
109 {
110  INFOMSG("void CCollimatorRep::setXsize(double size) " << xSize << endl;);
111  xSize = size;
112 }
113 
114 void CCollimatorRep::setYsize(double size)
115 {
116  ySize = size;
117 }
118 */
A geometry representing a straight line.
virtual StraightGeometry & getGeometry()
Get geometry.
StraightGeometry geometry
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
NullField field
virtual NullField & getField()
Get field.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
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 double getElementLength() const
Get design length.
Definition: ElementBase.h:415
virtual ElementBase * clone() const
Return clone.
const std::string name
virtual ~CCollimatorRep()
virtual void setElementLength(double length)
Set design length.
Definition: ElementBase.h:419
A zero electromagnetic field.
Definition: NullField.h:30