OPAL (Object Oriented Parallel Accelerator Library)  2024.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 
23 class ElementBase;
24 class WakeFunction;
25 
26 class OpalWake: public Definition {
27 
28 public:
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 
58 private:
59  enum class OpalWakeType: unsigned short {
60  CSR,
61  CSRIGF,
64  };
65 
66  // Not implemented.
67  OpalWake(const OpalWake&);
68  void operator=(const OpalWake&);
69 
70  // Clone constructor.
71  OpalWake(const std::string& name, OpalWake* parent);
72 };
73 
74 inline std::ostream& operator<<(std::ostream& os, const OpalWake& b) {
75  b.print(os);
76  return os;
77 }
78 
79 #endif // OPAL_Wake_HH
WakeFunction * wf_m
Definition: OpalWake.h:56
The base class for all OPAL objects.
Definition: Object.h:48
OpalWakeType
Definition: OpalWake.h:59
void operator=(const OpalWake &)
std::ostream & operator<<(std::ostream &os, const Attribute &attr)
Definition: Attribute.cpp:169
virtual ~OpalWake()
Definition: OpalWake.cpp:106
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
Definition: OpalWake.cpp:111
OpalWake()
Exemplar constructor.
Definition: OpalWake.cpp:50
void initWakefunction(const ElementBase &element)
Definition: OpalWake.cpp:147
virtual void update()
Update the WAKE data.
Definition: OpalWake.cpp:141
const std::string name
void print(std::ostream &os) const
Print the object.
Definition: OpalWake.cpp:234
The base class for all OPAL definitions.
Definition: Definition.h:30
int getNumberOfBins()
Definition: OpalWake.cpp:136
virtual OpalWake * clone(const std::string &name)
Make clone.
Definition: OpalWake.cpp:117
virtual void execute()
Check the WAKE data.
Definition: OpalWake.cpp:122
static OpalWake * find(const std::string &name)
Find named WAKE.
Definition: OpalWake.cpp:127