VPTissue Reference Manual
TimeSlicer.h
Go to the documentation of this file.
1 #ifndef SIM_STEP_CONTROLLER_H_INCLUDED
2 #define SIM_STEP_CONTROLLER_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "SimPhase.h"
23 
24 #include <mutex>
25 
26 namespace SimPT_Sim {
27 
28 class Sim;
29 
34 {
35 public:
37  TimeSlicer(std::mutex& time_step_mutex, Sim* sim);
38 
40  TimeSlicer(const TimeSlicer& other) =delete;
41 
43  TimeSlicer& operator=(const TimeSlicer& other) =delete;
44 
46  ~TimeSlicer();
47 
49  void IncrementStepCount();
50 
52  void Go(double time_slice, SimPhase phase = SimPhase::NONE);
53 
54 private:
55  std::lock_guard<std::mutex> m_guard;
56  Sim* m_sim;
57 };
58 
59 } // namespace
60 
61 #endif // end_of_include_guard
TimeSlicer & operator=(const TimeSlicer &other)=delete
No assignment operator.
void Go(double time_slice, SimPhase phase=SimPhase::NONE)
Actualy propagate over a time slice.
Definition: TimeSlicer.cpp:42
Simulator: mesh & parameters, model & algorithms.
Definition: Sim.h:50
TimeSlicer(std::mutex &time_step_mutex, Sim *sim)
Constructor does almost no initialization work.
Definition: TimeSlicer.cpp:26
Namespace for the core simulator.
Simulator: mesh & parameters, model & algorithms.
Definition: TimeSlicer.h:33
SimPhase enum class.
~TimeSlicer()
Destructor does some wrapping up.
Definition: TimeSlicer.cpp:32
void IncrementStepCount()
Increment time step count because slices have covered a full step.
Definition: TimeSlicer.cpp:37