SEInhaler.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/system/equipment/SEEquipment.h"
6class Serializer;
7class SESubstance;
10
11class CDM_DECL SEInhaler : public SEEquipment
12{
13 friend class PBInhaler;//friend the serialization class
14public:
15
16 SEInhaler(Logger* logger);
17 virtual ~SEInhaler();
18
19 void Clear() override;
20
21 bool SerializeToString(std::string& output, eSerializationFormat m) const;
22 bool SerializeToFile(const std::string& filename) const;
23 bool SerializeFromString(const std::string& src, eSerializationFormat m, const SESubstanceManager& subMgr);
24 bool SerializeFromFile(const std::string& filename, const SESubstanceManager& subMgr);
25
34 const SEScalar* GetScalar(const std::string& name) override;
35
36protected:
42 virtual void StateChange(){};
43 virtual void Merge(const SEInhaler& from, SESubstanceManager& subMgr);
44 virtual void ProcessConfiguration(SEInhalerConfiguration& config, SESubstanceManager& subMgr);
45
46public:
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
67protected:
68
69 eSwitch m_State;
74};
Definition: Logger.h:71
Definition: SEScalarMass.h:8
Definition: PBInhaler.h:9
static bool SerializeFromString(const std::string &src, SEInhaler &dst, eSerializationFormat m, const SESubstanceManager &subMgr)
Definition: PBInhaler.cpp:68
static bool SerializeToFile(const SEInhaler &src, const std::string &filename)
Definition: PBInhaler.cpp:61
static bool SerializeToString(const SEInhaler &src, std::string &output, eSerializationFormat m)
Definition: PBInhaler.cpp:55
static bool SerializeFromFile(const std::string &filename, SEInhaler &dst, const SESubstanceManager &subMgr)
Definition: PBInhaler.cpp:76
Definition: SEEquipment.h:9
void Clear() override
Definition: SEEquipment.cpp:17
Definition: SEInhalerConfiguration.h:9
Definition: SEInhaler.h:12
const SESubstance * m_Substance
Definition: SEInhaler.h:73
eSwitch m_State
Definition: SEInhaler.h:69
virtual void StateChange()
Definition: SEInhaler.h:42
SEScalarVolume * m_SpacerVolume
Definition: SEInhaler.h:72
SEScalarMass * m_MeteredDose
Definition: SEInhaler.h:70
SEScalar0To1 * m_NozzleLoss
Definition: SEInhaler.h:71
Definition: SEScalar0To1.h:8
Definition: SEScalar.h:19
Definition: SEScalarMass.h:28
Definition: SEScalarVolume.h:28
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.