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/SESystem.h"
6 class Serializer;
7 class SESubstance;
10 
11 class CDM_DECL SEInhaler : public SESystem
12 {
13  friend class PBInhaler;//friend the serialization class
14 public:
15 
16  SEInhaler(SESubstanceManager& substances);
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, SerializationFormat m) const;
23  bool SerializeFromString(const std::string& src, SerializationFormat m);
24  bool SerializeFromFile(const std::string& filename, SerializationFormat m);
25 
34  virtual const SEScalar* GetScalar(const std::string& name);
35 
36 protected:
42  virtual void StateChange(){};
43  virtual void Merge(const SEInhaler& from);
44  virtual void ProcessConfiguration(const SEInhalerConfiguration& config);
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 
76 };
Definition: SESubstanceManager.h:8
Definition: SEScalarMass.h:23
Definition: SEScalar.h:19
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
SEScalarVolume * m_SpacerVolume
Definition: SEInhaler.h:72
static bool SerializeFromString(const std::string &src, SEInhaler &dst, SerializationFormat m)
Definition: PBInhaler.cpp:67
static bool SerializeToString(const SEInhaler &src, std::string &output, SerializationFormat m)
Definition: PBInhaler.cpp:52
virtual void StateChange()
Definition: SEInhaler.h:42
Definition: SEInhalerConfiguration.h:9
static bool SerializeToFile(const SEInhaler &src, const std::string &filename, SerializationFormat m)
Definition: PBInhaler.cpp:58
static bool SerializeFromFile(const std::string &filename, SEInhaler &dst, SerializationFormat m)
Definition: PBInhaler.cpp:75
Definition: SESystem.h:7
Definition: PBInhaler.h:7
SESubstanceManager & m_Substances
Definition: SEInhaler.h:75
const SESubstance * m_Substance
Definition: SEInhaler.h:73
Definition: SEScalarMass.h:7
Definition: SESubstance.h:14
virtual const SEScalar * GetScalar(const std::string &name)=0
Definition: SEScalar0To1.h:7
virtual void Clear()
Definition: SESystem.cpp:17
SEScalarMass * m_MeteredDose
Definition: SEInhaler.h:70