SEBagValveMask.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/properties/SEScalar.h"
6#include "cdm/system/equipment/SEEquipment.h"
9class SESubstance;
12
13class CDM_DECL SEBagValveMask : public SEEquipment
14{
15 friend class PBBagValveMask;//friend the serialization class
16protected:
18public:
19
20 SEBagValveMask(Logger* logger);
21 virtual ~SEBagValveMask();
22
23 void Clear() override;
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, const SESubstanceManager& subMgr);
28 bool SerializeFromFile(const std::string& filename, const SESubstanceManager& subMgr);
29
30protected:
31
37 virtual void StateChange(){};
38 virtual void Merge(const SEBagValveMask& from, SESubstanceManager& subMgr);
39 virtual void ProcessConfiguration(SEBagValveMaskConfiguration& config, SESubstanceManager& subMgr);
40
41public:
42
43 const SEScalar* GetScalar(const std::string& name) override;
44
45 virtual eBreathState GetBreathState() const;
46 virtual void SetBreathState(eBreathState c);
47
48 virtual eSwitch GetConnection() const;
49 virtual void SetConnection(eSwitch c);
50
51 virtual bool HasBagResistance() const;
52 virtual SEScalarPressureTimePerVolume& GetBagResistance();
53 virtual double GetBagResistance(const PressureTimePerVolumeUnit& unit) const;
54
55 virtual bool HasFilterResistance() const;
56 virtual SEScalarPressureTimePerVolume& GetFilterResistance();
57 virtual double GetFilterResistance(const PressureTimePerVolumeUnit& unit) const;
58
59 virtual bool HasSealResistance() const;
60 virtual SEScalarPressureTimePerVolume& GetSealResistance();
61 virtual double GetSealResistance(const PressureTimePerVolumeUnit& unit) const;
62
63 virtual bool HasFilterVolume() const;
64 virtual SEScalarVolume& GetFilterVolume();
65 virtual double GetFilterVolume(const VolumeUnit& unit) const;
66
67 virtual bool HasConnectionVolume() const;
68 virtual SEScalarVolume& GetConnectionVolume();
69 virtual double GetConnectionVolume(const VolumeUnit& unit) const;
70
71 virtual bool HasValveVolume() const;
72 virtual SEScalarVolume& GetValveVolume();
73 virtual double GetValveVolume(const VolumeUnit& unit) const;
74
75 virtual bool HasValveResistance() const;
76 virtual SEScalarPressureTimePerVolume& GetValveResistance();
77 virtual double GetValveResistance(const PressureTimePerVolumeUnit& unit) const;
78
79 virtual bool HasValvePositiveEndExpiratoryPressure() const;
80 virtual SEScalarPressure& GetValvePositiveEndExpiratoryPressure();
81 virtual double GetValvePositiveEndExpiratoryPressure(const PressureUnit& unit) const;
82
83 bool HasFractionInspiredGas() const;
84 bool HasFractionInspiredGas(const SESubstance& substance) const;
85 const std::vector<SESubstanceFraction*>& GetFractionInspiredGases();
86 const std::vector<const SESubstanceFraction*>& GetFractionInspiredGases() const;
87 SESubstanceFraction& GetFractionInspiredGas(const SESubstance& substance);
88 const SESubstanceFraction* GetFractionInspiredGas(const SESubstance& substance) const;
89 void RemoveFractionInspiredGas(const SESubstance& substance);
90 void RemoveFractionInspiredGases();
91
92 bool HasConcentrationInspiredAerosol() const;
93 bool HasConcentrationInspiredAerosol(const SESubstance& substance) const;
94 const std::vector<SESubstanceConcentration*>& GetConcentrationInspiredAerosols();
95 const std::vector<const SESubstanceConcentration*>& GetConcentrationInspiredAerosols() const;
96 SESubstanceConcentration& GetConcentrationInspiredAerosol(const SESubstance& substance);
97 const SESubstanceConcentration* GetConcentrationInspiredAerosol(const SESubstance& substance) const;
98 void RemoveConcentrationInspiredAerosol(const SESubstance& substance);
99 void RemoveConcentrationInspiredAerosols();
100
101protected:
104
113
114 std::vector<SESubstanceFraction*> m_FractionInspiredGases;
115 std::vector<const SESubstanceFraction*> m_cFractionInspiredGases;
116
117 std::vector<SESubstanceConcentration*> m_ConcentrationInspiredAerosols;
118 std::vector<const SESubstanceConcentration*> m_cConcentrationInspiredAerosols;
119};
Definition: Logger.h:71
Definition: PBBagValveMask.h:9
static bool SerializeToString(const SEBagValveMask &src, std::string &output, eSerializationFormat m)
Definition: PBBagValveMask.cpp:117
static bool SerializeFromString(const std::string &src, SEBagValveMask &dst, eSerializationFormat m, const SESubstanceManager &subMgr)
Definition: PBBagValveMask.cpp:130
static bool SerializeFromFile(const std::string &filename, SEBagValveMask &dst, const SESubstanceManager &subMgr)
Definition: PBBagValveMask.cpp:138
static bool SerializeToFile(const SEBagValveMask &src, const std::string &filename)
Definition: PBBagValveMask.cpp:123
Definition: SEScalarPressureTimePerVolume.h:8
Definition: SEScalarPressure.h:8
Definition: SEBagValveMaskConfiguration.h:9
Definition: SEBagValveMask.h:14
SEScalarVolume * m_FilterVolume
Definition: SEBagValveMask.h:108
std::vector< SESubstanceFraction * > m_FractionInspiredGases
Definition: SEBagValveMask.h:114
SEScalarPressureTimePerVolume * m_FilterResistance
Definition: SEBagValveMask.h:106
SEScalarPressureTimePerVolume * m_SealResistance
Definition: SEBagValveMask.h:107
SEScalarEnum< eBreathState > m_BreathState
Definition: SEBagValveMask.h:102
SEScalarEnum< eSwitch > m_Connection
Definition: SEBagValveMask.h:103
SEScalarVolume * m_ValveVolume
Definition: SEBagValveMask.h:110
SEScalarVolume * m_ConnectionVolume
Definition: SEBagValveMask.h:109
SEScalarPressureTimePerVolume * m_BagResistance
Definition: SEBagValveMask.h:105
std::vector< const SESubstanceFraction * > m_cFractionInspiredGases
Definition: SEBagValveMask.h:115
SEScalarPressureTimePerVolume * m_ValveResistance
Definition: SEBagValveMask.h:112
virtual void StateChange()
Definition: SEBagValveMask.h:37
friend SEBagValveMaskConfiguration
Definition: SEBagValveMask.h:17
std::vector< const SESubstanceConcentration * > m_cConcentrationInspiredAerosols
Definition: SEBagValveMask.h:118
SEScalarPressure * m_ValvePositiveEndExpiratoryPressure
Definition: SEBagValveMask.h:111
std::vector< SESubstanceConcentration * > m_ConcentrationInspiredAerosols
Definition: SEBagValveMask.h:117
Definition: SEEquipment.h:9
void Clear() override
Definition: SEEquipment.cpp:17
Definition: SEEventManager.h:73
Definition: SEScalar.h:19
Definition: SEScalarPressure.h:29
Definition: SEScalarPressureTimePerVolume.h:29
Definition: SEScalarVolume.h:28
Definition: SESubstanceConcentration.h:11
Definition: SESubstanceFraction.h:10
Definition: SESubstance.h:15
Definition: SESubstanceManager.h:9
virtual const SEScalar * GetScalar(const std::string &name)=0
Definition: SEScalarVolume.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.