OPALX (Object Oriented Parallel Accelerator Library for Exascal) master (dc2a29eed580)
OPALX
Loading...
Searching...
No Matches
ConstantEFieldCavityRep.cpp
Go to the documentation of this file.
3
4namespace {
5 struct Entry {
6 const char* name;
7 double (ConstantEFieldCavityRep::*get)() const;
8 void (ConstantEFieldCavityRep::*set)(double);
9 };
10
11 const Entry entries[] = {
15 {0, 0, 0}};
16} // namespace
17
19
21 : ConstantEFieldCavity(right), geometry(right.geometry), field(right.field) {}
22
24 : ConstantEFieldCavity(name), geometry(), field() {}
25
27
29
30Channel* ConstantEFieldCavityRep::getChannel(const std::string& aKey, bool create) {
31 for (const Entry* entry = entries; entry->name != 0; ++entry) {
32 if (aKey == entry->name) {
33 return new IndirectChannel<ConstantEFieldCavityRep>(*this, entry->get, entry->set);
34 }
35 }
36 return ElementBase::getChannel(aKey, create);
37}
38
40
42
44
46
48
Abstract interface for read/write access to variable.
Definition Channel.h:30
virtual void setEz(double)
Set component.
ElementBase * clone() const override
Return clone.
Channel * getChannel(const std::string &aKey, bool=false) override
Construct a read/write channel.
void setElementLength(double length) override
Set design length.
StraightGeometry & getGeometry() override
Get geometry.
ConstEzField & getField() override
Return field.
void setEz(double ez) override
Component applying a constant accelerating electric field (Ex,Ey,Ez).
virtual void setEz(double ez)
virtual Channel * getChannel(const std::string &aKey, bool create=false)
Construct a read/write channel.
virtual double getElementLength() const
Get design length.
Access to a [b]double[/b] data member.
A geometry representing a straight line.
virtual void setElementLength(double length)
Set design length.