SENutrition.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5
6class CDM_DECL SENutrition : public Loggable
7{
8 friend class PBPatientNutrition;//friend the serialization class
9public:
10
11 SENutrition(Logger* logger);
12 virtual ~SENutrition();
13
14 virtual void Clear();
15 virtual void Copy(const SENutrition& src);
16
17 const SEScalar* GetScalar(const std::string& name);
18
19 bool SerializeToString(std::string& output, eSerializationFormat m) const;
20 bool SerializeToFile(const std::string& filename) const;
21 bool SerializeFromString(const std::string& src, eSerializationFormat m);
22 bool SerializeFromFile(const std::string& filename);
23
24 void Increment(const SENutrition& from);
25
26 virtual bool HasCarbohydrate() const;
27 virtual SEScalarMass& GetCarbohydrate();
28 virtual double GetCarbohydrate(const MassUnit& unit) const;
29
30 virtual bool HasCarbohydrateDigestionRate() const;
31 virtual SEScalarMassPerTime& GetCarbohydrateDigestionRate();
32 virtual double GetCarbohydrateDigestionRate(const MassPerTimeUnit& unit) const;
33
34 virtual bool HasFat() const;
35 virtual SEScalarMass& GetFat();
36 virtual double GetFat(const MassUnit& unit) const;
37
38 virtual bool HasFatDigestionRate() const;
39 virtual SEScalarMassPerTime& GetFatDigestionRate();
40 virtual double GetFatDigestionRate(const MassPerTimeUnit& unit) const;
41
42 virtual bool HasProtein() const;
43 virtual SEScalarMass& GetProtein();
44 virtual double GetProtein(const MassUnit& unit) const;
45
46 virtual bool HasProteinDigestionRate() const;
47 virtual SEScalarMassPerTime& GetProteinDigestionRate();
48 virtual double GetProteinDigestionRate(const MassPerTimeUnit& unit) const;
49
50 virtual bool HasSodium() const;
51 virtual SEScalarMass& GetSodium();
52 virtual double GetSodium(const MassUnit& unit) const;
53
54 virtual bool HasCalcium() const;
55 virtual SEScalarMass& GetCalcium();
56 virtual double GetCalcium(const MassUnit& unit) const;
57
58 virtual bool HasWater() const;
59 virtual SEScalarVolume& GetWater();
60 virtual double GetWater(const VolumeUnit& unit) const;
61
62 virtual double GetWeight(const MassUnit& unit) const;
63
64 virtual void ToString(std::ostream &str) const;
65
66protected:
67
77};
78
79inline std::ostream& operator<< (std::ostream& out, const SENutrition& n)
80{
81 n.ToString(out);
82 return out;
83}
Definition: Logger.h:23
Definition: Logger.h:71
Definition: SEScalarMassPerTime.h:8
Definition: SEScalarMass.h:8
Definition: PBPatientNutrition.h:9
static bool SerializeFromString(const std::string &src, SENutrition &dst, eSerializationFormat m)
Definition: PBPatientNutrition.cpp:90
static bool SerializeToFile(const SENutrition &src, const std::string &filename)
Definition: PBPatientNutrition.cpp:83
static bool SerializeToString(const SENutrition &src, std::string &output, eSerializationFormat m)
Definition: PBPatientNutrition.cpp:77
static void Copy(const SENutrition &src, SENutrition &dst)
Definition: PBPatientNutrition.cpp:69
static bool SerializeFromFile(const std::string &filename, SENutrition &dst)
Definition: PBPatientNutrition.cpp:98
Definition: SENutrition.h:7
virtual void ToString(std::ostream &str) const
Definition: SENutrition.cpp:328
SEScalarMass * m_Carbohydrate
Definition: SENutrition.h:68
SEScalarMass * m_Sodium
Definition: SENutrition.h:75
SEScalarMassPerTime * m_CarbohydrateDigestionRate
Definition: SENutrition.h:69
SEScalarMass * m_Protein
Definition: SENutrition.h:72
SEScalarVolume * m_Water
Definition: SENutrition.h:76
SEScalarMass * m_Calcium
Definition: SENutrition.h:74
SEScalarMassPerTime * m_ProteinDigestionRate
Definition: SENutrition.h:73
SEScalarMassPerTime * m_FatDigestionRate
Definition: SENutrition.h:71
SEScalarMass * m_Fat
Definition: SENutrition.h:70
Definition: SEScalar.h:19
Definition: SEScalarMass.h:28
Definition: SEScalarMassPerTime.h:31
Definition: SEScalarVolume.h:28
Definition: SEScalarVolume.h:8

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.