SELiquidBlackBox.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5#include "cdm/blackbox/fluid/SEFluidBlackBox.h"
6//#include "cdm/blackbox/substances/SELiquidBlackBoxSubstanceQuantity.h"
7#include "cdm/compartment/fluid/SELiquidCompartment.h"
8#include "cdm/compartment/fluid/SELiquidCompartmentLink.h"
9
10class CDM_DECL SELiquidBlackBox : public SEFluidBlackBox
11{
12 friend class SEBlackBoxManager;
13protected:
14 SELiquidBlackBox(const std::string& name, Logger* logger);
15public:
16 virtual ~SELiquidBlackBox();
17
18 void Clear() override; //clear memory
19
20 // Graph Elements
21 virtual bool HasCompartment() const { return m_Compartment != nullptr; }
22 virtual SELiquidCompartment& GetCompartment() { return *m_Compartment; }
23 virtual const SELiquidCompartment& GetCompartment() const { return *m_Compartment; }
24
25 virtual bool HasSourceCompartment() const { return m_srcCompartment != nullptr; }
26 virtual SELiquidCompartment& GetSourceCompartment() { return *m_srcCompartment; }
27 virtual const SELiquidCompartment& GetSourceCompartment() const { return *m_srcCompartment; }
28
29 virtual bool HasTargetCompartment() const { return m_tgtCompartment != nullptr; }
30 virtual SELiquidCompartment& GetTargetCompartment() { return *m_tgtCompartment; }
31 virtual const SELiquidCompartment& GetTargetCompartment() const { return *m_tgtCompartment; }
32
33 virtual bool HasSourceLink() const { return m_srcLink != nullptr; }
34 virtual SELiquidCompartmentLink& GetSourceLink() { return *m_srcLink; }
35 virtual const SELiquidCompartmentLink& GetSourceLink() const { return *m_srcLink; }
36
37 virtual bool HasTargetLink() const { return m_tgtLink != nullptr; }
38 virtual SELiquidCompartmentLink& GetTargetLink() { return *m_tgtLink; }
39 virtual const SELiquidCompartmentLink& GetTargetLink() const { return *m_tgtLink; }
40
41protected:
42 virtual void SetCompartment(SELiquidCompartment* c) { m_Compartment = c; }
43 virtual void SetSourceCompartment(SELiquidCompartment* c) { m_srcCompartment = c; }
44 virtual void SetTargetCompartment(SELiquidCompartment* c) { m_tgtCompartment = c; }
45 virtual void SetSourceLink(SELiquidCompartmentLink* l) { m_srcLink = l; }
46 virtual void SetTargetLink(SELiquidCompartmentLink* l) { m_tgtLink = l; }
47
48 // Graph Elements
49 SELiquidCompartment* m_Compartment = nullptr;
50 SELiquidCompartment* m_srcCompartment = nullptr;
51 SELiquidCompartment* m_tgtCompartment = nullptr;
52 SELiquidCompartmentLink* m_srcLink = nullptr;
53 SELiquidCompartmentLink* m_tgtLink = nullptr;
54
55};
Definition: Logger.h:71
virtual void Clear()
Definition: SEBlackBox.h:51
Definition: SEBlackBoxManager.h:11
Definition: SEFluidBlackBox.h:9
Definition: SELiquidBlackBox.h:11
virtual SELiquidCompartmentLink & GetTargetLink()
Definition: SELiquidBlackBox.h:38
virtual bool HasCompartment() const
Definition: SELiquidBlackBox.h:21
virtual void SetTargetLink(SELiquidCompartmentLink *l)
Definition: SELiquidBlackBox.h:46
virtual const SELiquidCompartmentLink & GetTargetLink() const
Definition: SELiquidBlackBox.h:39
virtual const SELiquidCompartmentLink & GetSourceLink() const
Definition: SELiquidBlackBox.h:35
virtual const SELiquidCompartment & GetCompartment() const
Definition: SELiquidBlackBox.h:23
virtual SELiquidCompartmentLink & GetSourceLink()
Definition: SELiquidBlackBox.h:34
virtual bool HasSourceCompartment() const
Definition: SELiquidBlackBox.h:25
virtual void SetSourceLink(SELiquidCompartmentLink *l)
Definition: SELiquidBlackBox.h:45
virtual const SELiquidCompartment & GetSourceCompartment() const
Definition: SELiquidBlackBox.h:27
virtual SELiquidCompartment & GetCompartment()
Definition: SELiquidBlackBox.h:22
virtual SELiquidCompartment & GetTargetCompartment()
Definition: SELiquidBlackBox.h:30
virtual bool HasTargetLink() const
Definition: SELiquidBlackBox.h:37
virtual void SetCompartment(SELiquidCompartment *c)
Definition: SELiquidBlackBox.h:42
virtual const SELiquidCompartment & GetTargetCompartment() const
Definition: SELiquidBlackBox.h:31
virtual void SetSourceCompartment(SELiquidCompartment *c)
Definition: SELiquidBlackBox.h:43
virtual bool HasSourceLink() const
Definition: SELiquidBlackBox.h:33
virtual bool HasTargetCompartment() const
Definition: SELiquidBlackBox.h:29
virtual void SetTargetCompartment(SELiquidCompartment *c)
Definition: SELiquidBlackBox.h:44
virtual SELiquidCompartment & GetSourceCompartment()
Definition: SELiquidBlackBox.h:26
Definition: SELiquidCompartment.h:11

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.