OPAL (Object Oriented Parallel Accelerator Library) 2024.2
OPAL
FlexibleCollimatorRep.cpp
Go to the documentation of this file.
1//
2// Class FlexibleCollimatorRep
3// Representation for a flexible 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
21namespace {
22 struct Entry {
23 const char *name;
24 double(FlexibleCollimatorRep::*get)() const;
25 void (FlexibleCollimatorRep::*set)(double);
26 };
27
28 const Entry entries[] = {
29 {
30 "L",
33 },
34 { 0, 0, 0 }
35 };
36}
37
38
43
44
49
50
55
56
59
60
64
65
66Channel *FlexibleCollimatorRep::getChannel(const std::string &aKey, bool create) {
67 for(const Entry *entry = entries; entry->name != 0; ++entry) {
68 if(aKey == entry->name) {
69 return new IndirectChannel<FlexibleCollimatorRep>(*this, entry->get, entry->set);
70 }
71 }
72
73 return ElementBase::getChannel(aKey, create);
74}
75
76
80
82 return field;
83}
84
85
89
const SingleMultipole< 4 >::Entry SingleMultipole< 4 >::entries[]
Definition Octupole.cpp:33
const std::string name
virtual Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
virtual double getElementLength() const
Get design length.
virtual void setElementLength(double length)
Set design length.
ElementBase(const std::string &name)
Constructor with given name.
FlexibleCollimator(const std::string &name)
Constructor with given name.
virtual ElementBase * clone() const
Return clone.
virtual StraightGeometry & getGeometry()
Get geometry.
FlexibleCollimatorRep(const std::string &name)
Constructor with given name.
virtual NullField & getField()
Get field.
virtual Channel * getChannel(const std::string &aKey, bool=false)
Construct a read/write channel.
A geometry representing a straight line.
Abstract interface for read/write access to variable.
Definition Channel.h:32
Access to a [b]double[/b] data member.
A zero electromagnetic field.
Definition NullField.h:30