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

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.