SESubstance.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
9 
10 // Keep enums in sync with appropriate schema/cdm/SubstanceEnums.proto file !!
11 enum class eSubstance_State { NullState = 0, Solid, Liquid, Gas, Molecular };
12 extern const std::string& eSubstance_State_Name(eSubstance_State m);
13 
14 class CDM_DECL SESubstance : public Loggable
15 {
16  friend class PBSubstance;//friend the serialization class
17 public:
18 
19  SESubstance(Logger* logger);
20  virtual ~SESubstance();
21 
22  virtual void Clear();
23 
24  bool SerializeToString(std::string& output, SerializationFormat m) const;
25  bool SerializeToFile(const std::string& filename, SerializationFormat m) const;
26  bool SerializeFromString(const std::string& src, SerializationFormat m);
27  bool SerializeFromFile(const std::string& filename, SerializationFormat m);
28 
29  virtual const SEScalar* GetScalar(const std::string& name);
30 
31  virtual std::string GetName() const;
32  virtual void SetName(const std::string& name);
33  virtual bool HasName() const;
34  virtual void InvalidateName();
35 
36  virtual eSubstance_State GetState() const;
37  virtual void SetState(eSubstance_State state);
38  virtual bool HasState() const;
39  virtual void InvalidateState();
40 
41  virtual bool HasDensity() const;
42  virtual SEScalarMassPerVolume& GetDensity();
43  virtual double GetDensity(const MassPerVolumeUnit& unit) const;
44 
45  virtual bool HasMolarMass() const;
46  virtual SEScalarMassPerAmount& GetMolarMass();
47  virtual double GetMolarMass(const MassPerAmountUnit& unit) const;
48 
49  // Diffusion-ish
50  virtual bool HasMaximumDiffusionFlux() const;
51  virtual SEScalarMassPerAreaTime& GetMaximumDiffusionFlux();
52  virtual double GetMaximumDiffusionFlux(const MassPerAreaTimeUnit& unit) const;
53 
54  virtual bool HasMichaelisCoefficient() const;
55  virtual SEScalar& GetMichaelisCoefficient();
56  virtual double GetMichaelisCoefficient() const;
57 
58  // Liquid-ish
59  virtual bool HasAerosolization() const;
60  virtual SESubstanceAerosolization& GetAerosolization();
61  virtual const SESubstanceAerosolization* GetAerosolization() const;
62  virtual void RemoveAerosolization();
63 
64  virtual bool HasBloodConcentration() const;
65  virtual SEScalarMassPerVolume& GetBloodConcentration();
66  virtual double GetBloodConcentration(const MassPerVolumeUnit& unit) const;
67 
68  virtual bool HasMassInBody() const;
69  virtual SEScalarMass& GetMassInBody();
70  virtual double GetMassInBody(const MassUnit& unit) const;
71 
72  virtual bool HasMassInBlood() const;
73  virtual SEScalarMass& GetMassInBlood();
74  virtual double GetMassInBlood(const MassUnit& unit) const;
75 
76  virtual bool HasMassInTissue() const;
77  virtual SEScalarMass& GetMassInTissue();
78  virtual double GetMassInTissue(const MassUnit& unit) const;
79 
80  virtual bool HasPlasmaConcentration() const;
81  virtual SEScalarMassPerVolume& GetPlasmaConcentration();
82  virtual double GetPlasmaConcentration(const MassPerVolumeUnit& unit) const;
83 
84  virtual bool HasSystemicMassCleared() const;
85  virtual SEScalarMass& GetSystemicMassCleared();
86  virtual double GetSystemicMassCleared(const MassUnit& unit) const;
87 
88  virtual bool HasTissueConcentration() const;
89  virtual SEScalarMassPerVolume& GetTissueConcentration();
90  virtual double GetTissueConcentration(const MassPerVolumeUnit& unit) const;
91 
92  // Gas-ish
93  virtual bool HasAlveolarTransfer() const;
94  virtual SEScalarVolumePerTime& GetAlveolarTransfer();
95  virtual double GetAlveolarTransfer(const VolumePerTimeUnit& unit) const;
96 
97  virtual bool HasDiffusingCapacity() const;
98  virtual SEScalarVolumePerTimePressure& GetDiffusingCapacity();
99  virtual double GetDiffusingCapacity(const VolumePerTimePressureUnit& unit) const;
100 
101  virtual bool HasEndTidalFraction() const;
102  virtual SEScalar0To1& GetEndTidalFraction();
103  virtual double GetEndTidalFraction() const;
104 
105  virtual bool HasEndTidalPressure() const;
106  virtual SEScalarPressure& GetEndTidalPressure();
107  virtual double GetEndTidalPressure(const PressureUnit& unit) const;
108 
109  virtual bool HasRelativeDiffusionCoefficient() const;
110  virtual SEScalar& GetRelativeDiffusionCoefficient();
111  virtual double GetRelativeDiffusionCoefficient() const;
112 
113  virtual bool HasSolubilityCoefficient() const;
114  virtual SEScalarInversePressure& GetSolubilityCoefficient();
115  virtual double GetSolubilityCoefficient(const InversePressureUnit& unit) const;
116 
117  virtual bool HasClearance() const;
118  virtual SESubstanceClearance& GetClearance();
119  virtual const SESubstanceClearance* GetClearance() const;
120  virtual void RemoveClearance();
121 
122  virtual bool HasPK() const;
123  virtual SESubstancePharmacokinetics& GetPK();
124  virtual const SESubstancePharmacokinetics* GetPK() const;
125  virtual void RemovePK();
126 
127  virtual bool HasPD() const;
128  virtual SESubstancePharmacodynamics& GetPD();
129  virtual const SESubstancePharmacodynamics* GetPD() const;
130  virtual void RemovePD();
131 
132 
133 protected:
134 
135  std::string m_Name;
136  eSubstance_State m_State;
139 
142 
151 
158 
162 };
SEScalarVolumePerTime * m_AlveolarTransfer
Definition: SESubstance.h:152
SEScalarMass * m_MassInBody
Definition: SESubstance.h:145
Definition: SEScalarMass.h:23
Definition: SEScalarVolumePerTimePressure.h:7
Definition: SEScalar.h:19
static bool SerializeToString(const SESubstance &src, std::string &output, SerializationFormat m)
Definition: PBSubstance.cpp:595
SEScalarMassPerAreaTime * m_MaximumDiffusionFlux
Definition: SESubstance.h:140
static bool SerializeFromString(const std::string &src, SESubstance &dst, SerializationFormat m)
Definition: PBSubstance.cpp:610
Definition: Logger.h:61
Definition: SESubstancePharmacokinetics.h:8
Definition: SEScalarMassPerVolume.h:32
std::string m_Name
Definition: SESubstance.h:135
Definition: SEScalarPressure.h:23
Definition: SEScalarMassPerVolume.h:7
SEScalarMassPerVolume * m_Density
Definition: SESubstance.h:137
SEScalarMassPerVolume * m_BloodConcentration
Definition: SESubstance.h:144
static bool SerializeToFile(const SESubstance &src, const std::string &filename, SerializationFormat m)
Definition: PBSubstance.cpp:601
SEScalarPressure * m_EndTidalPressure
Definition: SESubstance.h:155
SEScalarMass * m_MassInTissue
Definition: SESubstance.h:147
Definition: SEScalarMassPerAmount.h:7
Definition: SEScalarVolumePerTimePressure.h:22
Definition: SEScalarVolumePerTime.h:7
Definition: SEScalarMassPerAreaTime.h:19
Definition: Logger.h:11
SESubstancePharmacokinetics * m_PK
Definition: SESubstance.h:160
Definition: SEScalarPressure.h:7
SESubstanceClearance * m_Clearance
Definition: SESubstance.h:159
SEScalarMass * m_MassInBlood
Definition: SESubstance.h:146
SESubstanceAerosolization * m_Aerosolization
Definition: SESubstance.h:143
Definition: SEScalarVolumePerTime.h:26
SESubstancePharmacodynamics * m_PD
Definition: SESubstance.h:161
SEScalarMass * m_SystemicMassCleared
Definition: SESubstance.h:149
Definition: SEScalarInversePressure.h:22
SEScalarMassPerVolume * m_PlasmaConcentration
Definition: SESubstance.h:148
SEScalarMassPerAmount * m_MolarMass
Definition: SESubstance.h:138
Definition: SEScalarInversePressure.h:7
SEScalarInversePressure * m_SolubilityCoefficient
Definition: SESubstance.h:157
Definition: SESubstanceAerosolization.h:6
Definition: SEScalarMassPerAmount.h:29
SEScalar * m_RelativeDiffusionCoefficient
Definition: SESubstance.h:156
SEScalar0To1 * m_EndTidalFraction
Definition: SESubstance.h:154
static bool SerializeFromFile(const std::string &filename, SESubstance &dst, SerializationFormat m)
Definition: PBSubstance.cpp:618
eSubstance_State m_State
Definition: SESubstance.h:136
Definition: PBSubstance.h:18
SEScalarMassPerVolume * m_TissueConcentration
Definition: SESubstance.h:150
Definition: SEScalarMass.h:7
Definition: SESubstanceClearance.h:8
Definition: SESubstance.h:14
Definition: SESubstancePharmacodynamics.h:7
Definition: SEScalar0To1.h:7
SEScalar * m_MichaelisCoefficient
Definition: SESubstance.h:141
SEScalarVolumePerTimePressure * m_DiffusingCapacity
Definition: SESubstance.h:153
Definition: SEScalarMassPerAreaTime.h:7