SEEngineInitialization.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "PhysiologyEngine.h"
7
8class CDM_DECL SEEngineInitialization : public Loggable
9{
10 friend class PBEngine;//friend the serialization class
11public:
12 explicit SEEngineInitialization(Logger* logger=nullptr);
14
17
18 virtual void Copy(const SEEngineInitialization& from, const SESubstanceManager& subMgr);
19 virtual void Clear(); //clear memory
20
21 bool SerializeToString(std::string& output, eSerializationFormat m) const;
22 bool SerializeFromString(const std::string& src, eSerializationFormat m, const SESubstanceManager& subMgr);
23 static bool SerializeFromString(const std::string& src, std::vector<SEEngineInitialization*>& dst, eSerializationFormat m, const SESubstanceManager& subMgr);
24
25 virtual bool IsValid()const;
26
27 virtual int GetID() const;
28 virtual void SetID(int id);
29
30 virtual bool HasPatientConfiguration() const;
31 virtual SEPatientConfiguration& GetPatientConfiguration();
32 virtual const SEPatientConfiguration* GetPatientConfiguration() const;
33
34 virtual bool HasStateFilename() const;
35 virtual std::string GetStateFilename() const;
36 virtual void SetStateFilename(const std::string& filename);
37
38 virtual bool HasState() const;
39 virtual std::string GetState() const;
40 virtual void SetState(const std::string& s, eSerializationFormat fmt);
41 virtual eSerializationFormat GetStateFormat() const;
42
43 virtual bool HasDataRequestManager() const;
44 virtual SEDataRequestManager& GetDataRequestManager();
45 virtual const SEDataRequestManager* GetDataRequestManager() const;
46
47 virtual bool HasLogFilename() const;
48 virtual std::string GetLogFilename() const;
49 virtual void SetLogFilename(const std::string& filename);
50
51 virtual bool KeepLogMessages() const;
52 virtual void KeepLogMessages(bool b);
53
54 virtual bool KeepEventChanges() const;
55 virtual void KeepEventChanges(bool b);
56
57protected:
58 int m_ID;
60 std::string m_StateFilename;
61 std::string m_State;
62 eSerializationFormat m_StateFormat;
64 std::string m_LogFilename;
67};
68
70{
71 friend class PBEngine;//friend the serialization class
72public:
75
76 virtual void Clear();
77 void Copy(const SEEngineInitializationStatus& src);
78
79 virtual bool SerializeToString(std::string& output, eSerializationFormat m, Logger*) const;
80 virtual bool SerializeFromString(const std::string& src, eSerializationFormat m, Logger*);
81
82 eEngineInitializationState GetEngineInitializationState() const { return m_EngineInitializationState; }
83 void SetEngineInitializationState(eEngineInitializationState s) { m_EngineInitializationState = s; }
84
85 bool HasCSVFilename() const { return !m_CSVFilename.empty(); }
86 std::string GetCSVFilename() const { return m_CSVFilename; }
87 void SetCSVFilename(const std::string& fn) { m_CSVFilename = fn; }
88
89 bool HasLogFilename() const { return !m_LogFilename.empty(); }
90 std::string GetLogFilename() const { return m_LogFilename; }
91 void SetLogFilename(const std::string& fn) { m_LogFilename = fn; }
92
93 double GetStabilizationTime_s() const { return m_StabilizationTime_s; }
94 void SetStabilizationTime_s(double t) { m_StabilizationTime_s = t; }
95
96protected:
97 eEngineInitializationState m_EngineInitializationState;
98 std::string m_CSVFilename;
99 std::string m_LogFilename;
101};
Definition: Logger.h:23
Definition: Logger.h:60
Definition: Logger.h:71
Definition: PBEngine.h:31
static bool SerializeFromString(const std::string &src, LogMessages &dst, eSerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:135
static void Copy(const SEDataRequest &src, SEDataRequest &dst)
Definition: PBEngine.cpp:513
static bool SerializeToString(const LogMessages &src, std::string &output, eSerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:163
Definition: SEDataRequestManager.h:10
Definition: SEEngineInitialization.h:9
SEEngineInitialization operator=(const SEEngineInitialization &)=delete
bool m_KeepEventChanges
Definition: SEEngineInitialization.h:66
SEDataRequestManager * m_DataRequestManager
Definition: SEEngineInitialization.h:63
eSerializationFormat m_StateFormat
Definition: SEEngineInitialization.h:62
std::string m_LogFilename
Definition: SEEngineInitialization.h:64
bool m_KeepLogMessages
Definition: SEEngineInitialization.h:65
SEEngineInitialization(const SEEngineInitialization &)=delete
SEPatientConfiguration * m_PatientConfiguration
Definition: SEEngineInitialization.h:59
std::string m_State
Definition: SEEngineInitialization.h:61
int m_ID
Definition: SEEngineInitialization.h:58
std::string m_StateFilename
Definition: SEEngineInitialization.h:60
Definition: SEEngineInitialization.h:70
void SetEngineInitializationState(eEngineInitializationState s)
Definition: SEEngineInitialization.h:83
bool HasLogFilename() const
Definition: SEEngineInitialization.h:89
std::string m_CSVFilename
Definition: SEEngineInitialization.h:98
void SetLogFilename(const std::string &fn)
Definition: SEEngineInitialization.h:91
void SetStabilizationTime_s(double t)
Definition: SEEngineInitialization.h:94
eEngineInitializationState m_EngineInitializationState
Definition: SEEngineInitialization.h:97
double m_StabilizationTime_s
Definition: SEEngineInitialization.h:100
eEngineInitializationState GetEngineInitializationState() const
Definition: SEEngineInitialization.h:82
std::string GetCSVFilename() const
Definition: SEEngineInitialization.h:86
double GetStabilizationTime_s() const
Definition: SEEngineInitialization.h:93
void SetCSVFilename(const std::string &fn)
Definition: SEEngineInitialization.h:87
bool HasCSVFilename() const
Definition: SEEngineInitialization.h:85
std::string m_LogFilename
Definition: SEEngineInitialization.h:99
std::string GetLogFilename() const
Definition: SEEngineInitialization.h:90
Definition: SEPatientConfiguration.h:11
Definition: SESubstanceManager.h:9

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.