SECondition.h
1 /**************************************************************************************
2 Copyright 2015 Applied Research Associates, Inc.
3 Licensed under the Apache License, Version 2.0 (the "License"); you may not use
4 this file except in compliance with the License. You may obtain a copy of the License
5 at:
6 http://www.apache.org/licenses/LICENSE-2.0
7 Unless required by applicable law or agreed to in writing, software distributed under
8 the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
9 CONDITIONS OF ANY KIND, either express or implied. See the License for the
10 specific language governing permissions and limitations under the License.
11 **************************************************************************************/
12 
13 #pragma once
14 #include <biogears/cdm/CommonDataModel.h>
15 #include <biogears/exports.h>
16 
17 CDM_BIND_DECL(ConditionData);
18 
19 namespace biogears {
20 class SESubstanceManager;
21 
22 class BIOGEARS_API SECondition : public Loggable {
23 public:
24  SECondition();
25  virtual ~SECondition();
26 
27  virtual void Clear(); // Deletes all members
28 
29  static SECondition* newFromBind(const CDM::ConditionData& condition, SESubstanceManager& substances);
30 
31  virtual bool Load(const CDM::ConditionData& in);
32  virtual CDM::ConditionData* Unload() const;
33 
34 protected:
35  void Unload(CDM::ConditionData& data) const;
36 
37 public:
39  virtual bool IsValid() const { return true; }
40 
41  virtual std::string GetName() const = 0;
42  virtual const char* GetName_cStr() const = 0;
43 
44  virtual std::string GetComment() const;
45  virtual const char* GetComment_cStr() const;
46  virtual void SetComment(const char* comment);
47  virtual void SetComment(const std::string& comment);
48  virtual bool HasComment() const;
49  virtual void InvalidateComment();
50 
51  virtual void ToString(std::ostream& str) const = 0;
52 
53 protected:
54  std::string m_Comment;
55 };
56 
57 inline std::ostream& operator<<(std::ostream& out, const SECondition& a)
58 {
59  a.ToString(out);
60  return out;
61 }
62 }
virtual bool IsValid() const
Definition: SECondition.h:39
Definition: Logger.h:27
std::ostream & operator<<(std::ostream &out, const SEConsciousRespirationCommand &c)
Definition: SEConsciousRespirationCommand.h:48
std::string m_Comment
Definition: SECondition.h:54
Definition: SESubstanceManager.h:23
Definition: SEElectricalCircuit.h:18
Class corresponding to the ConditionData schema type.
Definition: Scenario.hxx:706
virtual void ToString(std::ostream &str) const =0
Definition: SECondition.h:22