OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
ParticleMatterInteraction.h
Go to the documentation of this file.
1 //
2 // Class ParticleMatterInteraction
3 // The class for the OPAL PARTICLEMATTERINTERACTION command.
4 //
5 // Copyright (c) 2012-2021, Andreas Adelmann, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // Christof Metzger-Kraus, Helmholtz-Zentrum Berlin
7 // Pedro Calvo, CIEMAT, Spain
8 // All rights reserved
9 //
10 // Implemented as part of the PhD thesis
11 // "Optimizing the radioisotope production of the novel AMIT
12 // superconducting weak focusing cyclotron"
13 //
14 // This file is part of OPAL.
15 //
16 // OPAL is free software: you can redistribute it and/or modify
17 // it under the terms of the GNU General Public License as published by
18 // the Free Software Foundation, either version 3 of the License, or
19 // (at your option) any later version.
20 //
21 // You should have received a copy of the GNU General Public License
22 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
23 //
24 #ifndef OPAL_PARTICLEMATTERINTERACTION_HH
25 #define OPAL_PARTICLEMATTERINTERACTION_HH
26 
28 #include "Algorithms/PartData.h"
30 
31 class ElementBase;
32 class Inform;
33 
35 
36 public:
37 
40 
42 
44  virtual bool canReplaceBy(Object* object);
45 
47  virtual ParticleMatterInteraction* clone(const std::string& name);
48 
50  virtual void execute();
51 
53  static ParticleMatterInteraction* find(const std::string& name);
54 
56  virtual void update();
57 
58  void print(std::ostream& os) const;
59 
61 
62  void updateElement(ElementBase* element);
63 
65 
66 private:
67 
68  // Not implemented.
71 
72  // Clone constructor.
73  ParticleMatterInteraction(const std::string& name, ParticleMatterInteraction* parent);
74 };
75 
76 inline std::ostream& operator<<(std::ostream& os, const ParticleMatterInteraction& b) {
77  b.print(os);
78  return os;
79 }
80 
81 #endif // OPAL_PARTICLEMATTERINTERACTION_HH
std::ostream & operator<<(std::ostream &os, const ParticleMatterInteraction &b)
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
virtual void execute()
Check the PARTICLEMATTERINTERACTION data.
virtual ParticleMatterInteraction * clone(const std::string &name)
Make clone.
ParticleMatterInteraction(const ParticleMatterInteraction &)
virtual void update()
Update the PARTICLEMATTERINTERACTION data.
static ParticleMatterInteraction * find(const std::string &name)
Find named PARTICLEMATTERINTERACTION.
virtual bool canReplaceBy(Object *object)
Test if replacement is allowed.
ParticleMatterInteractionHandler * handler_m
ParticleMatterInteraction()
Exemplar constructor.
void operator=(const ParticleMatterInteraction &)
void initParticleMatterInteractionHandler(ElementBase &element)
void print(std::ostream &os) const
Print the object.
void updateElement(ElementBase *element)
Definition: Inform.h:42