All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SimulationStatus.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  \file SimulationStatus.hpp
35  \brief Header of ...
36 
37  \author Jean-Christophe FABRE <fabrejc@supagro.inra.fr>
38  */
39 
40 
41 #ifndef __SIMULATIONSTATUS_HPP__
42 #define __SIMULATIONSTATUS_HPP__
43 
44 
45 #include <openfluid/dllexport.hpp>
47 
48 
49 namespace openfluid { namespace base {
50 
51 
52 // =====================================================================
53 // =====================================================================
54 
55 
57 {
58  public:
59 
60  enum SimulationStage { PRE, INITPARAMS, PREPAREDATA, CHECKCONSISTENCY, INITIALIZERUN, RUNSTEP, FINALIZERUN, POST, UNKNOWN };
61 
62  enum SchedulingConstraint { SCHED_NONE, SCHED_DTCHECKED, SCHED_DTFORCED };
63 
64  private:
65 
66  openfluid::core::DateTime m_BeginDate;
67 
68  openfluid::core::DateTime m_EndDate;
69 
70  openfluid::core::Duration_t m_Duration;
71 
72  openfluid::core::DateTime m_CurrentDate;
73 
74  openfluid::core::TimeIndex_t m_CurrentTimeIndex;
75 
76  openfluid::core::Duration_t m_DefaultDeltaT;
77 
78  SchedulingConstraint m_SchedConstraint;
79 
80  SimulationStage m_CurrentStage;
81 
82  public:
83 
85  const openfluid::core::DateTime& End,
86  const openfluid::core::Duration_t DeltaT,
87  const SchedulingConstraint& SConst = SCHED_NONE);
88 
90 
91  inline openfluid::core::DateTime getBeginDate() const { return m_BeginDate; }
92 
93  inline openfluid::core::DateTime getEndDate() const { return m_EndDate; }
94 
95  inline openfluid::core::DateTime getCurrentDate() const { return m_CurrentDate; }
96 
97  inline openfluid::core::Duration_t getDefaultDeltaT() const { return m_DefaultDeltaT; }
98 
99  inline openfluid::core::Duration_t getSimulationDuration() const { return m_Duration; }
100 
101  inline openfluid::core::TimeIndex_t getCurrentTimeIndex() const { return m_CurrentTimeIndex; }
102 
103  inline SchedulingConstraint getSchedulingConstraint() const { return m_SchedConstraint; }
104 
105  inline bool isFirstTimeIndex() const { return m_CurrentTimeIndex == 0; }
106 
107  void setCurrentTimeIndex(const openfluid::core::TimeIndex_t& Index);
108 
109  inline SimulationStage getCurrentStage() const { return m_CurrentStage; }
110 
111  void setCurrentStage(const SimulationStage& Stage);
112 
113 };
114 
115 } } // namespaces
116 
117 
118 #endif /* __SIMULATIONSTATUS_HPP__ */
unsigned long long TimeIndex_t
Definition: DateTime.hpp:62
bool isFirstTimeIndex() const
Definition: SimulationStatus.hpp:105
openfluid::core::DateTime getEndDate() const
Definition: SimulationStatus.hpp:93
Class for management of date and time information.
Definition: DateTime.hpp:131
openfluid::core::DateTime getBeginDate() const
Definition: SimulationStatus.hpp:91
openfluid::core::DateTime getCurrentDate() const
Definition: SimulationStatus.hpp:95
~SimulationStatus()
Definition: SimulationStatus.hpp:89
openfluid::core::Duration_t getSimulationDuration() const
Definition: SimulationStatus.hpp:99
openfluid::core::TimeIndex_t getCurrentTimeIndex() const
Definition: SimulationStatus.hpp:101
SchedulingConstraint getSchedulingConstraint() const
Definition: SimulationStatus.hpp:103
SimulationStage getCurrentStage() const
Definition: SimulationStatus.hpp:109
SchedulingConstraint
Definition: SimulationStatus.hpp:62
Definition: SimulationStatus.hpp:56
SimulationStage
Definition: SimulationStatus.hpp:60
unsigned long long Duration_t
Definition: DateTime.hpp:68
openfluid::core::Duration_t getDefaultDeltaT() const
Definition: SimulationStatus.hpp:97
#define DLLEXPORT
Definition: dllexport.hpp:51