OPAL (Object Oriented Parallel Accelerator Library) 2022.1
OPAL
OpalWake.h
Go to the documentation of this file.
1//
2// Class OpalWake
3// The class for the OPAL WAKE command.
4//
5// Copyright (c) 2008 - 2022, 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 OPAL_Wake_HH
19#define OPAL_Wake_HH
20
22
23class ElementBase;
24class WakeFunction;
25
26class OpalWake: public Definition {
27
28public:
30 OpalWake();
31
32 virtual ~OpalWake();
33
35 // Can replace only by another WAKE.
36 virtual bool canReplaceBy(Object* object);
37
39 virtual OpalWake* clone(const std::string& name);
40
42 virtual void execute();
43
45 static OpalWake* find(const std::string& name);
46
48 virtual void update();
49
50 void print(std::ostream& os) const;
51
52 int getNumberOfBins();
53
54 void initWakefunction(const ElementBase& element);
55
57
58private:
59 enum class OpalWakeType: unsigned short {
60 CSR,
61 CSRIGF,
62 LONGSHORTRANGE,
63 TRANSVSHORTRANGE
64 };
65
66 // Not implemented.
68 void operator=(const OpalWake&);
69
70 // Clone constructor.
71 OpalWake(const std::string& name, OpalWake* parent);
72};
73
74inline std::ostream& operator<<(std::ostream& os, const OpalWake& b) {
75 b.print(os);
76 return os;
77}
78
79#endif // OPAL_Wake_HH
std::ostream & operator<<(std::ostream &os, const OpalWake &b)
Definition: OpalWake.h:74
const std::string name
The base class for all OPAL definitions.
Definition: Definition.h:30
The base class for all OPAL objects.
Definition: Object.h:48
void print(std::ostream &os) const
Print the object.
Definition: OpalWake.cpp:234
WakeFunction * wf_m
Definition: OpalWake.h:56
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
Definition: OpalWake.cpp:111
OpalWake()
Exemplar constructor.
Definition: OpalWake.cpp:50
static OpalWake * find(const std::string &name)
Find named WAKE.
Definition: OpalWake.cpp:127
virtual ~OpalWake()
Definition: OpalWake.cpp:106
void initWakefunction(const ElementBase &element)
Definition: OpalWake.cpp:147
void operator=(const OpalWake &)
virtual void update()
Update the WAKE data.
Definition: OpalWake.cpp:141
OpalWakeType
Definition: OpalWake.h:59
OpalWake(const OpalWake &)
int getNumberOfBins()
Definition: OpalWake.cpp:136
virtual void execute()
Check the WAKE data.
Definition: OpalWake.cpp:122
virtual OpalWake * clone(const std::string &name)
Make clone.
Definition: OpalWake.cpp:117