SEActionManager.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 class SEAction;
10 class SESubstanceManager;
11 
12 class CDM_DECL SEActionManager : public Loggable
13 {
14  friend class PBEngine;//friend the serialization class
15 public:
16 
18  ~SEActionManager();
19 
20  void Clear();
21 
22  bool SerializeToString(std::string& output, SerializationFormat m) const;
23  bool SerializeToFile(const std::string& filename, SerializationFormat m) const;
24  bool SerializeFromString(const std::string& src, SerializationFormat m);
25  bool SerializeFromFile(const std::string& filename, SerializationFormat m);
26 
27  static bool SerializeFromString(const std::string& src, std::vector<SEAction*>& dst, SerializationFormat m, SESubstanceManager& subMgr);
28 
29  bool ProcessAction(const SEAction& action);// Will make a copy
30 
31  SEPatientActionCollection& GetPatientActions() { return *m_PatientActions; }
32  SEEnvironmentActionCollection& GetEnvironmentActions() { return *m_EnvironmentActions; }
33  SEAnesthesiaMachineActionCollection& GetAnesthesiaMachineActions() { return *m_AnesthesiaMachineActions; }
34  SEInhalerActionCollection& GetInhalerActions() { return *m_InhalerActions; }
35 
36  const SEPatientActionCollection& GetPatientActions() const { return *m_PatientActions; }
37  const SEEnvironmentActionCollection& GetEnvironmentActions() const { return *m_EnvironmentActions; }
38  const SEAnesthesiaMachineActionCollection& GetAnesthesiaMachineActions() const { return *m_AnesthesiaMachineActions; }
39  const SEInhalerActionCollection& GetInhalerActions() const { return *m_InhalerActions; }
40 
41  void GetAllActions(std::vector<const SEAction*>& v) const;
42 
43 protected:
44 
50 
51  std::stringstream m_ss;
52 };
Definition: SESubstanceManager.h:8
Definition: SEEnvironmentActionCollection.h:12
SEEnvironmentActionCollection & GetEnvironmentActions()
Definition: SEActionManager.h:32
const SEPatientActionCollection & GetPatientActions() const
Definition: SEActionManager.h:36
std::stringstream m_ss
Definition: SEActionManager.h:51
SEPatientActionCollection & GetPatientActions()
Definition: SEActionManager.h:31
Definition: SEAnesthesiaMachineActionCollection.h:25
Definition: SEPatientActionCollection.h:37
SESubstanceManager & m_Substances
Definition: SEActionManager.h:45
Definition: SEAction.h:7
static bool SerializeToString(const SEPatientConfiguration &src, std::string &output, SerializationFormat m)
Definition: PBEngine.cpp:300
static bool SerializeToFile(const SEPatientConfiguration &src, const std::string &filename, SerializationFormat m)
Definition: PBEngine.cpp:306
SEEnvironmentActionCollection * m_EnvironmentActions
Definition: SEActionManager.h:47
static bool SerializeFromFile(const std::string &filename, SEPatientConfiguration &dst, SerializationFormat m, SESubstanceManager &subMgr)
Definition: PBEngine.cpp:322
const SEAnesthesiaMachineActionCollection & GetAnesthesiaMachineActions() const
Definition: SEActionManager.h:38
Definition: SEActionManager.h:12
Definition: Logger.h:11
Definition: PBEngine.h:24
Definition: SEInhalerActionCollection.h:13
const SEEnvironmentActionCollection & GetEnvironmentActions() const
Definition: SEActionManager.h:37
static bool SerializeFromString(const std::string &src, SEPatientConfiguration &dst, SerializationFormat m, SESubstanceManager &subMgr)
Definition: PBEngine.cpp:314
SEAnesthesiaMachineActionCollection & GetAnesthesiaMachineActions()
Definition: SEActionManager.h:33
SEPatientActionCollection * m_PatientActions
Definition: SEActionManager.h:46
SEInhalerActionCollection & GetInhalerActions()
Definition: SEActionManager.h:34
const SEInhalerActionCollection & GetInhalerActions() const
Definition: SEActionManager.h:39
SEAnesthesiaMachineActionCollection * m_AnesthesiaMachineActions
Definition: SEActionManager.h:48
SEInhalerActionCollection * m_InhalerActions
Definition: SEActionManager.h:49