OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
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 - 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 //
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:
29 
31  OpalWake();
32 
33  virtual ~OpalWake();
34 
36  // Can replace only by another WAKE.
37  virtual bool canReplaceBy(Object *object);
38 
40  virtual OpalWake *clone(const std::string &name);
41 
43  virtual void execute();
44 
46  static OpalWake *find(const std::string &name);
47 
49  virtual void update();
50 
51  void print(std::ostream &os) const;
52 
53  int getNumberOfBins();
54 
55  void initWakefunction(const ElementBase &element);
56 
58 
59 private:
60 
61  // Not implemented.
62  OpalWake(const OpalWake &);
63  void operator=(const OpalWake &);
64 
65  // Clone constructor.
66  OpalWake(const std::string &name, OpalWake *parent);
67 };
68 
69 inline std::ostream &operator<<(std::ostream &os, const OpalWake &b) {
70  b.print(os);
71  return os;
72 }
73 
74 #endif // OPAL_Wake_HH
std::ostream & operator<<(std::ostream &os, const OpalWake &b)
Definition: OpalWake.h:69
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:219
WakeFunction * wf_m
Definition: OpalWake.h:57
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
Definition: OpalWake.cpp:109
OpalWake()
Exemplar constructor.
Definition: OpalWake.cpp:49
static OpalWake * find(const std::string &name)
Find named WAKE.
Definition: OpalWake.cpp:125
virtual ~OpalWake()
Definition: OpalWake.cpp:104
void initWakefunction(const ElementBase &element)
Definition: OpalWake.cpp:146
void operator=(const OpalWake &)
virtual void update()
Update the WAKE data.
Definition: OpalWake.cpp:140
OpalWake(const OpalWake &)
int getNumberOfBins()
Definition: OpalWake.cpp:135
virtual void execute()
Check the WAKE data.
Definition: OpalWake.cpp:120
virtual OpalWake * clone(const std::string &name)
Make clone.
Definition: OpalWake.cpp:115