CompartmentManager.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5
6#include "engine/CommonDefs.h"
7#include "cdm/compartment/SECompartmentManager.h"
8
9namespace pulse
10{
11 class Data;
15 class PULSE_DECL CompartmentManager : public SECompartmentManager
16 {
17 friend class SubstanceManager;
18 public:
19
20 CompartmentManager(Data& data);
21 virtual ~CompartmentManager();
22
23 void Clear() override;
24
25 void StateChange() override;
26 virtual void UpdateAirwayGraph() { m_UpdateActiveAirwayGraph = true; m_UpdateActiveAerosolGraph = true; }
27
28 virtual SELiquidCompartmentGraph& GetActiveCardiovascularGraph();
29 virtual SELiquidCompartmentGraph& GetCardiovascularGraph();
30 virtual SELiquidCompartmentGraph& GetRenalGraph();
31
32 virtual SEGasCompartmentGraph& GetActiveRespiratoryGraph();
33 virtual SEGasCompartmentGraph& GetRespiratoryGraph();
34 virtual SEGasCompartmentGraph& GetRespiratoryAndAnesthesiaMachineGraph();
35 virtual SEGasCompartmentGraph& GetRespiratoryAndBagValveMaskGraph();
36 virtual SEGasCompartmentGraph& GetRespiratoryAndInhalerGraph();
37 virtual SEGasCompartmentGraph& GetRespiratoryAndNasalCannulaGraph();
38 virtual SEGasCompartmentGraph& GetRespiratoryAndSimpleMaskGraph();
39 virtual SEGasCompartmentGraph& GetRespiratoryAndNonRebreatherMaskGraph();
40 virtual SEGasCompartmentGraph& GetRespiratoryAndMechanicalVentilationGraph();
41 virtual SEGasCompartmentGraph& GetRespiratoryAndMechanicalVentilatorGraph();
42
43 virtual SEGasCompartmentGraph& GetAnesthesiaMachineGraph();
44 virtual SEGasCompartmentGraph& GetBagValveMaskGraph();
45 virtual SEGasCompartmentGraph& GetMechanicalVentilatorGraph();
46
47 virtual SELiquidCompartmentGraph& GetActiveAerosolGraph();
48 virtual SELiquidCompartmentGraph& GetAerosolGraph();
49 virtual SELiquidCompartmentGraph& GetAerosolAndBagValveMaskGraph();
50 virtual SELiquidCompartmentGraph& GetAerosolAndInhalerGraph();
51 virtual SELiquidCompartmentGraph& GetAerosolAndMechanicalVentilationGraph();
52 virtual SELiquidCompartmentGraph& GetAerosolAndMechanicalVentilatorGraph();
53
54 // Compartment Helpers
55 std::vector<SELiquidCompartment*>const& GetAerosolCompartments() { return m_AerosolCompartments; }
56 std::vector<SELiquidCompartment*>const& GetAerosolLeafCompartments() { return m_AerosolLeafCompartments; }
57
58 std::vector<SELiquidCompartment*>const& GetChymeCompartments() { return m_ChymeCompartments; }
59 std::vector<SELiquidCompartment*>const& GetChymeLeafCompartments() { return m_ChymeLeafCompartments; }
60
61 std::vector<SEGasCompartment*>const& GetPulmonaryCompartments() { return m_PulmonaryCompartments; }
62 std::vector<SEGasCompartment*>const& GetPulmonaryLeafCompartments() { return m_PulmonaryLeafCompartments; }
63
64 std::vector<SEGasCompartment*>const& GetExpandedPulmonaryCompartments() { return m_ExpandedPulmonaryCompartments; }
65 std::vector<SEGasCompartment*>const& GetExpandedPulmonaryLeafCompartments() { return m_ExpandedPulmonaryLeafCompartments; }
66
67 std::vector<SEThermalCompartment*>const& GetTemperatureCompartments() { return m_TemperatureCompartments; }
68 std::vector<SEThermalCompartment*>const& GetTemperatureLeafCompartments() { return m_TemperatureLeafCompartments; }
69
70 std::vector<SETissueCompartment*>const& GetTissueCompartments() override { return m_TissueCompartments; }
71 std::vector<SETissueCompartment*>const& GetTissueLeafCompartments() override { return m_TissueLeafCompartments; }
72
73 std::vector<SELiquidCompartment*>const& GetUrineCompartments() { return m_UrineCompartments; }
74 std::vector<SELiquidCompartment*>const& GetUrineLeafCompartments() { return m_UrineLeafCompartments; }
75
76 std::vector<SELiquidCompartment*>const& GetVascularCompartments() { return m_VascularCompartments; }
77 std::vector<SELiquidCompartment*>const& GetVascularLeafCompartments() { return m_VascularLeafCompartments; }
78
79 std::vector<SEGasCompartment*>const& GetAnesthesiaMachineCompartments() { return m_AnesthesiaMachineCompartments; }
80 std::vector<SEGasCompartment*>const& GetAnesthesiaMachineLeafCompartments() { return m_AnesthesiaMachineLeafCompartments; }
81
82 std::vector<SEGasCompartment*>const& GetBagValveMaskCompartments() { return m_BagValveMaskCompartments; }
83 std::vector<SEGasCompartment*>const& GetBagValveMaskLeafCompartments() { return m_BagValveMaskLeafCompartments; }
84
85 std::vector<SELiquidCompartment*>const& GetBagValveMaskAerosolCompartments() { return m_BagValveMaskAerosolCompartments; }
86 std::vector<SELiquidCompartment*>const& GetBagValveMaskAerosolLeafCompartments() { return m_BagValveMaskAerosolCompartments; }
87
88 std::vector<SEGasCompartment*>const& GetInhalerCompartments() { return m_InhalerCompartments; }
89 std::vector<SEGasCompartment*>const& GetInhalerLeafCompartments() { return m_InhalerLeafCompartments; }
90
91 std::vector<SELiquidCompartment*>const& GetInhalerAerosolCompartments() { return m_InhalerAerosolCompartments; }
92 std::vector<SELiquidCompartment*>const& GetInhalerAerosolLeafCompartments() { return m_InhalerAerosolLeafCompartments; }
93
94 std::vector<SEGasCompartment*>const& GetMechanicalVentilationCompartments() { return m_MechanicalVentilationCompartments; }
95 std::vector<SEGasCompartment*>const& GetMechanicalVentilationLeafCompartments() { return m_MechanicalVentilationLeafCompartments; }
96
97 std::vector<SELiquidCompartment*>const& GetMechanicalVentilationAerosolCompartments() { return m_MechanicalVentilationAerosolCompartments; }
98 std::vector<SELiquidCompartment*>const& GetMechanicalVentilationAerosolLeafCompartments() { return m_MechanicalVentilationAerosolCompartments; }
99
100 std::vector<SEGasCompartment*>const& GetMechanicalVentilatorCompartments() { return m_MechanicalVentilatorCompartments; }
101 std::vector<SEGasCompartment*>const& GetMechanicalVentilatorLeafCompartments() { return m_MechanicalVentilatorLeafCompartments; }
102
103 std::vector<SELiquidCompartment*>const& GetMechanicalVentilatorAerosolCompartments() { return m_MechanicalVentilatorAerosolCompartments; }
104 std::vector<SELiquidCompartment*>const& GetMechanicalVentilatorAerosolLeafCompartments() { return m_MechanicalVentilatorAerosolCompartments; }
105
106 std::vector<SEGasCompartment*>const& GetNasalCannulaCompartments() { return m_NasalCannulaCompartments; }
107 std::vector<SEGasCompartment*>const& GetNasalCannulaLeafCompartments() { return m_NasalCannulaLeafCompartments; }
108
109 std::vector<SEGasCompartment*>const& GetNonRebreatherMaskCompartments() { return m_NonRebreatherMaskCompartments; }
110 std::vector<SEGasCompartment*>const& GetNonRebreatherMaskLeafCompartments() { return m_NonRebreatherMaskLeafCompartments; }
111
112 std::vector<SEGasCompartment*>const& GetSimpleMaskCompartments() { return m_SimpleMaskCompartments; }
113 std::vector<SEGasCompartment*>const& GetSimpleMaskLeafCompartments() { return m_SimpleMaskLeafCompartments; }
114
115 protected:
116 // I don't want these exposed in Pulse, you should be calling the Substance manager
117 void AddGasCompartmentSubstance(SESubstance& sub) override;
118 void AddLiquidCompartmentSubstance(SESubstance& sub) override;
119
120 bool AllowGasSubstance(SESubstance& s, SEGasCompartment& cmpt) const override;
121 bool AllowLiquidSubstance(SESubstance& s, SELiquidCompartment& cmpt) const override;
122
123 Data& m_data;
124
125 bool m_UpdateActiveAirwayGraph;
126 bool m_UpdateActiveAerosolGraph;
127
128 SELiquidCompartmentGraph* m_CombinedCardiovascularGraph;
129 SELiquidCompartmentGraph* m_CardiovascularGraph;
130 SELiquidCompartmentGraph* m_RenalGraph;
131
132 SEGasCompartmentGraph* m_RespiratoryGraph;
133 SEGasCompartmentGraph* m_CombinedRespiratoryAnesthesiaGraph;
134 SEGasCompartmentGraph* m_CombinedRespiratoryBagValveMaskGraph;
135 SEGasCompartmentGraph* m_CombinedRespiratoryInhalerGraph;
136 SEGasCompartmentGraph* m_CombinedRespiratoryNasalCannulaGraph;
137 SEGasCompartmentGraph* m_CombinedRespiratorySimpleMaskGraph;
138 SEGasCompartmentGraph* m_CombinedRespiratoryNonRebreatherMaskGraph;
139 SEGasCompartmentGraph* m_CombinedRespiratoryMechanicalVentilationGraph;
140 SEGasCompartmentGraph* m_CombinedRespiratoryMechanicalVentilatorGraph;
141 SEGasCompartmentGraph* m_AnesthesiaMachineGraph;
142 SEGasCompartmentGraph* m_BagValveMaskGraph;
143 SEGasCompartmentGraph* m_MechanicalVentilatorGraph;
144
145 SELiquidCompartmentGraph* m_AerosolGraph;
146 SELiquidCompartmentGraph* m_CombinedAerosolBagValveMaskGraph;
147 SELiquidCompartmentGraph* m_CombinedAerosolInhalerGraph;
148 SELiquidCompartmentGraph* m_CombinedAerosolMechanicalVentilationGraph;
149 SELiquidCompartmentGraph* m_CombinedAerosolMechanicalVentilatorGraph;
150
151 std::vector<SELiquidCompartment*> m_AerosolCompartments;
152 std::vector<SELiquidCompartment*> m_AerosolLeafCompartments;
153 std::vector<SELiquidCompartment*> m_ChymeCompartments;
154 std::vector<SELiquidCompartment*> m_ChymeLeafCompartments;
155 std::vector<SEGasCompartment*> m_PulmonaryCompartments;
156 std::vector<SEGasCompartment*> m_PulmonaryLeafCompartments;
157 std::vector<SEGasCompartment*> m_ExpandedPulmonaryCompartments;
158 std::vector<SEGasCompartment*> m_ExpandedPulmonaryLeafCompartments;
159 std::vector<SEThermalCompartment*> m_TemperatureCompartments;
160 std::vector<SEThermalCompartment*> m_TemperatureLeafCompartments;
161 std::vector<SETissueCompartment*> m_TissueCompartments;
162 std::vector<SELiquidCompartment*> m_UrineCompartments;
163 std::vector<SELiquidCompartment*> m_UrineLeafCompartments;
164 std::vector<SELiquidCompartment*> m_VascularCompartments;
165 std::vector<SELiquidCompartment*> m_VascularLeafCompartments;
166 std::vector<SEGasCompartment*> m_AnesthesiaMachineCompartments;
167 std::vector<SEGasCompartment*> m_AnesthesiaMachineLeafCompartments;
168 std::vector<SEGasCompartment*> m_BagValveMaskCompartments;
169 std::vector<SEGasCompartment*> m_BagValveMaskLeafCompartments;
170 std::vector<SELiquidCompartment*> m_BagValveMaskAerosolCompartments;
171 std::vector<SELiquidCompartment*> m_BagValveMaskAerosolLeafCompartments;
172 std::vector<SEGasCompartment*> m_InhalerCompartments;
173 std::vector<SEGasCompartment*> m_InhalerLeafCompartments;
174 std::vector<SELiquidCompartment*> m_InhalerAerosolCompartments;
175 std::vector<SELiquidCompartment*> m_InhalerAerosolLeafCompartments;
176 std::vector<SEGasCompartment*> m_MechanicalVentilationCompartments;
177 std::vector<SEGasCompartment*> m_MechanicalVentilationLeafCompartments;
178 std::vector<SELiquidCompartment*> m_MechanicalVentilationAerosolCompartments;
179 std::vector<SELiquidCompartment*> m_MechanicalVentilationAerosolLeafCompartments;
180 std::vector<SEGasCompartment*> m_MechanicalVentilatorCompartments;
181 std::vector<SEGasCompartment*> m_MechanicalVentilatorLeafCompartments;
182 std::vector<SELiquidCompartment*> m_MechanicalVentilatorAerosolCompartments;
183 std::vector<SELiquidCompartment*> m_MechanicalVentilatorAerosolLeafCompartments;
184 std::vector<SEGasCompartment*> m_NasalCannulaCompartments;
185 std::vector<SEGasCompartment*> m_NasalCannulaLeafCompartments;
186 std::vector<SEGasCompartment*> m_NonRebreatherMaskCompartments;
187 std::vector<SEGasCompartment*> m_NonRebreatherMaskLeafCompartments;
188 std::vector<SEGasCompartment*> m_SimpleMaskCompartments;
189 std::vector<SEGasCompartment*> m_SimpleMaskLeafCompartments;
190 };
191END_NAMESPACE
Definition: SECompartmentManager.h:25
Definition: SEGasCompartmentGraph.h:15
Definition: SEGasCompartment.h:14
Definition: SELiquidCompartmentGraph.h:16
Definition: SELiquidCompartment.h:11
Definition: SESubstance.h:15
Definition: Logger.h:14

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.