OPAL (Object Oriented Parallel Accelerator Library)  2021.1.99
OPAL
SampleCmd.h
Go to the documentation of this file.
1 //
2 // Class SampleCmd
3 // This class defines the SAMPLE command.
4 //
5 // Copyright (c) 2018, Matthias Frey, Paul Scherrer Institut, Villigen PSI, Switzerland
6 // All rights reserved
7 //
8 // Implemented as part of the PhD thesis
9 // "Precise Simulations of Multibunches in High Intensity Cyclotrons"
10 //
11 // This file is part of OPAL.
12 //
13 // OPAL is free software: you can redistribute it and/or modify
14 // it under the terms of the GNU General Public License as published by
15 // the Free Software Foundation, either version 3 of the License, or
16 // (at your option) any later version.
17 //
18 // You should have received a copy of the GNU General Public License
19 // along with OPAL. If not, see <https://www.gnu.org/licenses/>.
20 //
21 #ifndef OPAL_SampleCmd_HH
22 #define OPAL_SampleCmd_HH
23 
24 #include "AbstractObjects/Action.h"
25 
26 #include <string>
27 
28 class SampleCmd: public Action {
29 
30 public:
31 
33  SampleCmd();
34 
35  virtual ~SampleCmd();
36 
38  virtual SampleCmd *clone(const std::string &name);
39 
41  virtual void execute();
42 
43 private:
44 
45  // Not implemented.
46  SampleCmd(const SampleCmd &) = delete;
47  void operator=(const SampleCmd &) = delete;
48 
49  // Clone constructor.
50  SampleCmd(const std::string &name, SampleCmd *parent);
51 
52  void stashEnvironment();
53  void popEnvironment();
54 };
55 
56 #endif
const std::string name
The base class for all OPAL actions.
Definition: Action.h:30
virtual void execute()
Execute the command.
Definition: SampleCmd.cpp:148
void stashEnvironment()
Definition: SampleCmd.cpp:496
SampleCmd()
Exemplar constructor.
Definition: SampleCmd.cpp:92
SampleCmd(const SampleCmd &)=delete
virtual SampleCmd * clone(const std::string &name)
Make clone.
Definition: SampleCmd.cpp:144
virtual ~SampleCmd()
Definition: SampleCmd.cpp:141
void popEnvironment()
Definition: SampleCmd.cpp:503
void operator=(const SampleCmd &)=delete