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