<
The Pulse Team is excited to announce the Pulse Physiology Engine 4.1.0 release. Upgrade now to get the best in dynamic simulation.
×
SENutrition.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 
6 class CDM_DECL SENutrition : public Loggable
7 {
8  friend class PBPatientNutrition;//friend the serialization class
9 public:
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 
66 protected:
67 
77 };
78 
79 inline std::ostream& operator<< (std::ostream& out, const SENutrition& n)
80 {
81  n.ToString(out);
82  return out;
83 }
static bool SerializeFromFile(const std::string &filename, SENutrition &dst)
Definition: PBPatientNutrition.cpp:98
Definition: SEScalarMass.h:27
Definition: SEScalar.h:18
static bool SerializeToFile(const SENutrition &src, const std::string &filename)
Definition: PBPatientNutrition.cpp:83
Definition: SEScalarVolume.h:7
SEScalarMassPerTime * m_FatDigestionRate
Definition: SENutrition.h:71
Definition: SEScalarMassPerTime.h:30
Definition: SEScalarVolume.h:27
SEScalarMassPerTime * m_ProteinDigestionRate
Definition: SENutrition.h:73
Definition: Logger.h:66
SEScalarVolume * m_Water
Definition: SENutrition.h:76
SEScalarMass * m_Sodium
Definition: SENutrition.h:75
Definition: SENutrition.h:6
Definition: Logger.h:18
static bool SerializeFromString(const std::string &src, SENutrition &dst, eSerializationFormat m)
Definition: PBPatientNutrition.cpp:90
static void Copy(const SENutrition &src, SENutrition &dst)
Definition: PBPatientNutrition.cpp:69
Definition: SEScalarMassPerTime.h:7
SEScalarMass * m_Calcium
Definition: SENutrition.h:74
Definition: PBPatientNutrition.h:8
SEScalarMass * m_Protein
Definition: SENutrition.h:72
static bool SerializeToString(const SENutrition &src, std::string &output, eSerializationFormat m)
Definition: PBPatientNutrition.cpp:77
SEScalarMass * m_Fat
Definition: SENutrition.h:70
SEScalarMass * m_Carbohydrate
Definition: SENutrition.h:68
virtual void ToString(std::ostream &str) const
Definition: SENutrition.cpp:328
Definition: SEScalarMass.h:7
SEScalarMassPerTime * m_CarbohydrateDigestionRate
Definition: SENutrition.h:69

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.