SEActionManager.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5class SEAction;
10
11class CDM_DECL SEActionManager : public Loggable
12{
13 friend class PBEngine;//friend the serialization class
14public:
15
18
19 void Clear();
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);
24 bool SerializeFromFile(const std::string& filename);
25
26 static bool SerializeFromString(const std::string& src, std::vector<SEAction*>& dst, eSerializationFormat m, const SESubstanceManager& subMgr);
27 static bool SerializeFromString(const std::string& src, std::map<int,std::vector<const SEAction*>>& dst, eSerializationFormat m, const SESubstanceManager& subMgr);
28
29 bool ProcessAction(const SEAction& action);// Will make a copy
30
31 const SEScalar* GetScalar(const std::string& actionName, const std::string& cmptName, const std::string& substance, const std::string& property);
32
33 SEPatientActionCollection& GetPatientActions() { return *m_PatientActions; }
34 SEEnvironmentActionCollection& GetEnvironmentActions() { return *m_EnvironmentActions; }
35 SEEquipmentActionCollection& GetEquipmentActions() { return *m_EquipmentActions; }
36
37 const SEPatientActionCollection& GetPatientActions() const { return *m_PatientActions; }
38 const SEEnvironmentActionCollection& GetEnvironmentActions() const { return *m_EnvironmentActions; }
39 const SEEquipmentActionCollection& GetEquipmentActions() const { return *m_EquipmentActions; }
40
41 void GetAllActions(std::vector<const SEAction*>& v) const;
42
43protected:
48
49 std::stringstream m_ss;
50};
Definition: Logger.h:23
Definition: PBEngine.h:31
static bool SerializeFromString(const std::string &src, LogMessages &dst, eSerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:135
static bool SerializeFromFile(const std::string &filename, SEPatientConfiguration &dst, const SESubstanceManager &subMgr)
Definition: PBEngine.cpp:466
static bool SerializeToString(const LogMessages &src, std::string &output, eSerializationFormat m, Logger *logger)
Definition: PBEngine.cpp:163
static bool SerializeToFile(const SEPatientConfiguration &src, const std::string &filename)
Definition: PBEngine.cpp:452
Definition: SEAction.h:14
Definition: SEActionManager.h:12
const SEEquipmentActionCollection & GetEquipmentActions() const
Definition: SEActionManager.h:39
SEEnvironmentActionCollection * m_EnvironmentActions
Definition: SEActionManager.h:46
SESubstanceManager & m_SubMgr
Definition: SEActionManager.h:44
SEPatientActionCollection & GetPatientActions()
Definition: SEActionManager.h:33
SEEnvironmentActionCollection & GetEnvironmentActions()
Definition: SEActionManager.h:34
SEEquipmentActionCollection * m_EquipmentActions
Definition: SEActionManager.h:47
std::stringstream m_ss
Definition: SEActionManager.h:49
SEPatientActionCollection * m_PatientActions
Definition: SEActionManager.h:45
const SEEnvironmentActionCollection & GetEnvironmentActions() const
Definition: SEActionManager.h:38
SEEquipmentActionCollection & GetEquipmentActions()
Definition: SEActionManager.h:35
const SEPatientActionCollection & GetPatientActions() const
Definition: SEActionManager.h:37
Definition: SEEnvironmentActionCollection.h:13
Definition: SEEquipmentActionCollection.h:47
Definition: SEPatientActionCollection.h:50
Definition: SEScalar.h:19
Definition: SESubstanceManager.h:9

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.