SESubstanceCompound.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5class SESubstance;
8
9class CDM_DECL SESubstanceCompound : public Loggable
10{
11 friend class PBSubstance;//friend the serialization class
12 friend class SESubstanceManager;
13protected:
14 SESubstanceCompound(const std::string& name, Logger* logger);
15public:
16 virtual ~SESubstanceCompound();
17
18 virtual void Clear();
19
20 bool SerializeToString(std::string& output, eSerializationFormat m) const;
21 bool SerializeToFile(const std::string& filename) const;
22 bool SerializeFromString(const std::string& src, const SESubstanceManager& subMgr, eSerializationFormat m);
23 bool SerializeFromFile(const std::string& filename, const SESubstanceManager& subMgr);
24
25 virtual std::string GetName() const;
26
27 bool HasComponent() const;
28 bool HasComponent(const SESubstance& substance) const;
29 const std::vector<SESubstanceConcentration*>& GetComponents();
30 const std::vector<const SESubstanceConcentration*>& GetComponents() const;
31 SESubstanceConcentration& GetComponent(const SESubstance& substance);
32 const SESubstanceConcentration* GetComponent(const SESubstance& substance) const;
33 void RemoveComponent(const SESubstance& substance);
34
35protected:
36
37 std::string m_Name;
38
39 std::vector<SESubstanceConcentration*> m_Components;
40 std::vector<const SESubstanceConcentration*> m_cComponents;
41};
Definition: Logger.h:23
Definition: Logger.h:71
Definition: PBSubstance.h:19
Definition: SESubstanceCompound.h:10
std::vector< const SESubstanceConcentration * > m_cComponents
Definition: SESubstanceCompound.h:40
std::string m_Name
Definition: SESubstanceCompound.h:37
std::vector< SESubstanceConcentration * > m_Components
Definition: SESubstanceCompound.h:39
Definition: SESubstanceConcentration.h:11
Definition: SESubstance.h:15
Definition: SESubstanceManager.h:9
virtual void Clear()
Definition: SESubstanceManager.cpp:23

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.