SEScenarioExec.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <string>
15 
16 #include <biogears/cdm/CommonDataModel.h>
17 
18 CDM_BIND_DECL(ScenarioData)
19 
20 namespace biogears {
21 class SEAction;
22 class SEScenario;
23 class PhysiologyEngine;
24 
25 class BIOGEARS_API SEScenarioCustomExec {
26 public:
27  virtual void CustomExec(double time_s, PhysiologyEngine* engine) = 0;
28 };
29 
30 class BIOGEARS_API SEScenarioExec : public Loggable {
31 public:
33  virtual ~SEScenarioExec();
34 
35  virtual PhysiologyEngine& GetEngine() { return m_Engine; }
36 
37  virtual void Cancel();
38 
39  virtual bool Execute(const char* scenarioFile, const char* resultsFile, SEScenarioCustomExec* cExec = nullptr);
40  virtual bool Execute(SEScenario const& scenario, const char* resultsFile, SEScenarioCustomExec* cExec = nullptr);
41  virtual bool Execute(const std::string& scenarioFile, const std::string& resultsFile, SEScenarioCustomExec* cExec = nullptr);
42  virtual bool Execute(SEScenario const& scenarioFile, const std::string& resultsFile, SEScenarioCustomExec* cExec = nullptr);
43 
44 protected:
45  virtual bool ProcessActions(SEScenario& scenario);
49  virtual bool ProcessAction(const SEAction& action);
50 
51  bool m_Cancel;
54 
55  std::stringstream m_ss;
56 };
57 }
bool m_Cancel
Definition: SEScenarioExec.h:51
std::stringstream m_ss
Definition: SEScenarioExec.h:55
Definition: SEAction.h:22
Definition: SEScenarioExec.h:25
Definition: Logger.h:27
Definition: PhysiologyEngine.h:68
SEScenarioCustomExec * m_CustomExec
Definition: SEScenarioExec.h:52
PhysiologyEngine & m_Engine
Definition: SEScenarioExec.h:53
Definition: SEScenarioExec.h:30
Definition: SEScenario.h:27
Definition: SEElectricalCircuit.h:18
virtual PhysiologyEngine & GetEngine()
Definition: SEScenarioExec.h:35