openPSTD  2.0
Open source simulation for sound propagation in urban environments
BaseOperation.h
1 // This file is part of openPSTD. //
3 // //
4 // openPSTD is free software: you can redistribute it and/or modify //
5 // it under the terms of the GNU General Public License as published by //
6 // the Free Software Foundation, either version 3 of the License, or //
7 // (at your option) any later version. //
8 // //
9 // openPSTD is distributed in the hope that it will be useful, //
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of //
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the //
12 // GNU General Public License for more details. //
13 // //
14 // You should have received a copy of the GNU General Public License //
15 // along with openPSTD. If not, see <http://www.gnu.org/licenses/>. //
16 // //
18 
20 //
21 // Date:
22 //
23 //
24 // Authors:
25 //
26 //
27 // Purpose:
28 //
29 //
31 
32 //
33 // Created by michiel on 18-7-2015.
34 //
35 
36 #ifndef OPENPSTD_BASEOPERATION_H
37 #define OPENPSTD_BASEOPERATION_H
38 
39 namespace OpenPSTD
40 {
41  namespace GUI
42  {
43  class OperationRunner;
44  class Reciever;
45  class BaseOperation;
46  }
47 }
48 #include "../Model.h"
49 #include <memory>
50 
51 namespace OpenPSTD
52 {
53  namespace GUI
54  {
56  {
57  public:
58  virtual void RunOperation(std::shared_ptr<BaseOperation> operation) = 0;
59  };
60 
61  class Reciever
62  {
63  public:
64  std::shared_ptr<Model> model;
65  std::shared_ptr<OperationRunner> operationRunner;
66  };
67 
69  {
70  public:
71  virtual void Run(const Reciever &reciever) = 0;
72  };
73 
75  {
76  private:
77  std::function<void(const Reciever &)> _func;
78 
79  public:
80  LambdaOperation(std::function<void(const Reciever &)> func);
81 
82  virtual void Run(const Reciever &reciever) override;
83  };
84 
85  }
86 }
87 
88 #endif //OPENPSTD_BASEOPERATION_H
This is the general namespace of the OpenPSTD application.
Definition: Boundary.cpp:33
Definition: BaseOperation.h:61
Definition: BaseOperation.h:55
Definition: BaseOperation.h:74
Definition: BaseOperation.h:68