Pulse adds COVID-19 Simulation Support
×
SEInhaler.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "system/equipment/SEEquipment.h"
6 class Serializer;
7 class SESubstance;
10 
11 class CDM_DECL SEInhaler : public SEEquipment
12 {
13  friend class PBInhaler;//friend the serialization class
14 public:
15 
16  SEInhaler(Logger* logger);
17  virtual ~SEInhaler();
18 
19  virtual void Clear();
20 
21  bool SerializeToString(std::string& output, SerializationFormat m) const;
22  bool SerializeToFile(const std::string& filename) const;
23  bool SerializeFromString(const std::string& src, SerializationFormat m, const SESubstanceManager& subMgr);
24  bool SerializeFromFile(const std::string& filename, const SESubstanceManager& subMgr);
25 
34  virtual const SEScalar* GetScalar(const std::string& name);
35 
36 protected:
42  virtual void StateChange(){};
43  virtual void Merge(const SEInhaler& from, SESubstanceManager& subMgr);
44  virtual void ProcessConfiguration(SEInhalerConfiguration& config, SESubstanceManager& subMgr);
45 
46 public:
47 
48  virtual eSwitch GetState() const;
49  virtual void SetState(eSwitch name);
50 
51  virtual bool HasMeteredDose() const;
52  virtual SEScalarMass& GetMeteredDose();
53  virtual double GetMeteredDose(const MassUnit& unit) const;
54 
55  virtual bool HasNozzleLoss() const;
56  virtual SEScalar0To1& GetNozzleLoss();
57  virtual double GetNozzleLoss() const;
58 
59  virtual bool HasSpacerVolume() const;
60  virtual SEScalarVolume& GetSpacerVolume();
61  virtual double GetSpacerVolume(const VolumeUnit& unit) const;
62 
63  virtual bool HasSubstance() const;
64  virtual void SetSubstance(const SESubstance* sub);
65  virtual SESubstance* GetSubstance() const;
66 
67 protected:
68 
69  eSwitch m_State;
74 };
Definition: SESubstanceManager.h:8
Definition: SEScalarMass.h:23
Definition: SEScalar.h:34
Definition: SEScalarVolume.h:7
Definition: SEInhaler.h:11
eSwitch m_State
Definition: SEInhaler.h:69
SEScalar0To1 * m_NozzleLoss
Definition: SEInhaler.h:71
Definition: SEScalarVolume.h:23
Definition: Logger.h:75
SEScalarVolume * m_SpacerVolume
Definition: SEInhaler.h:72
static bool SerializeToString(const SEInhaler &src, std::string &output, SerializationFormat m)
Definition: PBInhaler.cpp:55
virtual void StateChange()
Definition: SEInhaler.h:42
Definition: SEInhalerConfiguration.h:8
virtual void Clear()
Definition: SEEquipment.cpp:17
Definition: PBInhaler.h:8
const SESubstance * m_Substance
Definition: SEInhaler.h:73
static bool SerializeToFile(const SEInhaler &src, const std::string &filename)
Definition: PBInhaler.cpp:61
Definition: SEScalarMass.h:7
Definition: SEEquipment.h:8
Definition: SESubstance.h:14
virtual const SEScalar * GetScalar(const std::string &name)=0
static bool SerializeFromString(const std::string &src, SEInhaler &dst, SerializationFormat m, const SESubstanceManager &subMgr)
Definition: PBInhaler.cpp:68
Definition: SEScalar0To1.h:7
static bool SerializeFromFile(const std::string &filename, SEInhaler &dst, const SESubstanceManager &subMgr)
Definition: PBInhaler.cpp:76
SEScalarMass * m_MeteredDose
Definition: SEInhaler.h:70

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.