PBCompartment.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5
6#include "cdm/io/protobuf/PBCircuit.h"
7#include "cdm/io/protobuf/PBSubstance.h"
8// Forward Declaire SE and Protobuf Compartment Types
9CDM_BIND_DECL2(Compartment)
10CDM_BIND_DECL2(CompartmentLink)
11CDM_BIND_DECL2(CompartmentManager)
12CDM_BIND_DECL2(GasCompartment);
13CDM_BIND_DECL2(GasCompartmentGraph);
14CDM_BIND_DECL2(GasCompartmentLink);
15CDM_BIND_DECL2(LiquidCompartment);
16CDM_BIND_DECL2(LiquidCompartmentGraph);
17CDM_BIND_DECL2(LiquidCompartmentLink);
18CDM_BIND_DECL2(ThermalCompartment);
19CDM_BIND_DECL2(ThermalCompartmentLink);
20CDM_BIND_DECL2(TissueCompartment);
21// Include Templates
22#include "cdm/compartment/fluid/SEFluidCompartment.h"
23#include "cdm/compartment/fluid/SEFluidCompartmentLink.h"
24CDM_BIND_DECL(FluidCompartmentData);
25CDM_BIND_DECL(FluidCompartmentLinkData);
26
27class CDM_DECL PBCompartment
28{
29public:
30
31 static bool LoadCompartmentManagerFile(SECompartmentManager& mgr, const std::string& filename, SECircuitManager* circuits);
32 static void SaveCompartmentManagerFile(const SECompartmentManager& mgr, const std::string& filename);
33
34 // Generic Compartments
35 static void Load(const CDM_BIND::CompartmentManagerData& src, SECompartmentManager& dst, SECircuitManager* circuits = nullptr);
36 static CDM_BIND::CompartmentManagerData* Unload(const SECompartmentManager& src);
37 static void Serialize(const CDM_BIND::CompartmentManagerData& src, SECompartmentManager& dst, SECircuitManager* circuits = nullptr);
38 static void Serialize(const SECompartmentManager& src, CDM_BIND::CompartmentManagerData& dst);
39 static void Serialize(const CDM_BIND::CompartmentData& src, SECompartment& dst);
40 static void Serialize(const SECompartment& src, CDM_BIND::CompartmentData& dst);
41 static void Serialize(const CDM_BIND::CompartmentLinkData& src, SECompartmentLink& dst);
42 static void Serialize(const SECompartmentLink& src, CDM_BIND::CompartmentLinkData& dst);
43
44 // Fluid (Liquid, Gas) Compartments
45 static void Load(const CDM_BIND::GasCompartmentData& src, SEGasCompartment& dst, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr);
46 static CDM_BIND::GasCompartmentData* Unload(const SEGasCompartment& src);
47 static void Load(const CDM_BIND::GasCompartmentGraphData& src, SEGasCompartmentGraph& dst, SECompartmentManager& cmptMgr);
48 static CDM_BIND::GasCompartmentGraphData* Unload(const SEGasCompartmentGraph& src);
49 static void Load(const CDM_BIND::GasCompartmentLinkData& src, SEGasCompartmentLink& dst, SECircuitManager* circuits = nullptr);
50 static CDM_BIND::GasCompartmentLinkData* Unload(const SEGasCompartmentLink& src);
51 static void Load(const CDM_BIND::LiquidCompartmentData& src, SELiquidCompartment& dst, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr);
52 static CDM_BIND::LiquidCompartmentData* Unload(const SELiquidCompartment& src);
53 static void Load(const CDM_BIND::LiquidCompartmentGraphData& src, SELiquidCompartmentGraph& dst, SECompartmentManager& cmptMgr);
54 static CDM_BIND::LiquidCompartmentGraphData* Unload(const SELiquidCompartmentGraph& src);
55 static void Load(const CDM_BIND::LiquidCompartmentLinkData& src, SELiquidCompartmentLink& dst, SECircuitManager* circuits = nullptr);
56 static CDM_BIND::LiquidCompartmentLinkData* Unload(const SELiquidCompartmentLink& src);
57
58 template<FLUID_COMPARTMENT_TEMPLATE>
59 static void Serialize(const CDM_BIND::FluidCompartmentData& src, SEFluidCompartment<FLUID_COMPARTMENT_TYPES>& dst, SECircuitManager* circuits = nullptr);
60 template<FLUID_COMPARTMENT_TEMPLATE>
61 static void Serialize(const SEFluidCompartment<FLUID_COMPARTMENT_TYPES>& src, CDM_BIND::FluidCompartmentData& dst);
62 template<FLUID_COMPARTMENT_LINK_TEMPLATE>
63 static void Serialize(const CDM_BIND::FluidCompartmentLinkData& src, SEFluidCompartmentLink<FLUID_COMPARTMENT_LINK_TYPES>& dst, SECircuitManager* circuits = nullptr);
64 template<FLUID_COMPARTMENT_LINK_TEMPLATE>
65 static void Serialize(const SEFluidCompartmentLink<FLUID_COMPARTMENT_LINK_TYPES>& src, CDM_BIND::FluidCompartmentLinkData& dst);
66
67 static void Serialize(const CDM_BIND::GasCompartmentData& src, SEGasCompartment& dst, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr);
68 static void Serialize(const SEGasCompartment& src, CDM_BIND::GasCompartmentData& dst);
69 static void Serialize(const CDM_BIND::GasCompartmentGraphData& src, SEGasCompartmentGraph& dst, SECompartmentManager& cmptMgr);
70 static void Serialize(const SEGasCompartmentGraph& src, CDM_BIND::GasCompartmentGraphData& dst);
71 static void Serialize(const CDM_BIND::GasCompartmentLinkData& src, SEGasCompartmentLink& dst, SECircuitManager* circuits = nullptr);
72 static void Serialize(const SEGasCompartmentLink& src, CDM_BIND::GasCompartmentLinkData& dst);
73 static void Serialize(const CDM_BIND::LiquidCompartmentData& src, SELiquidCompartment& dst, SESubstanceManager& subMgr, SECircuitManager* circuits = nullptr);
74 static void Serialize(const SELiquidCompartment& src, CDM_BIND::LiquidCompartmentData& dst);
75 static void Serialize(const CDM_BIND::LiquidCompartmentGraphData& src, SELiquidCompartmentGraph& dst, SECompartmentManager& cmptMgr);
76 static void Serialize(const SELiquidCompartmentGraph& src, CDM_BIND::LiquidCompartmentGraphData& dst);
77 static void Serialize(const CDM_BIND::LiquidCompartmentLinkData& src, SELiquidCompartmentLink& dst, SECircuitManager* circuits = nullptr);
78 static void Serialize(const SELiquidCompartmentLink& src, CDM_BIND::LiquidCompartmentLinkData& dst);
79
80 // Thermal
81 static void Load(const CDM_BIND::ThermalCompartmentData& src, SEThermalCompartment& dst, SECircuitManager* circuits = nullptr);
82 static CDM_BIND::ThermalCompartmentData* Unload(const SEThermalCompartment& src);
83 static void Load(const CDM_BIND::ThermalCompartmentLinkData& src, SEThermalCompartmentLink& dst, SECircuitManager* circuits = nullptr);
84 static CDM_BIND::ThermalCompartmentLinkData* Unload(const SEThermalCompartmentLink& src);
85 static void Serialize(const CDM_BIND::ThermalCompartmentData& src, SEThermalCompartment& dst, SECircuitManager* circuits = nullptr);
86 static void Serialize(const SEThermalCompartment& src, CDM_BIND::ThermalCompartmentData& dst);
87 static void Serialize(const CDM_BIND::ThermalCompartmentLinkData& src, SEThermalCompartmentLink& dst, SECircuitManager* circuits = nullptr);
88 static void Serialize(const SEThermalCompartmentLink& src, CDM_BIND::ThermalCompartmentLinkData& dst);
89
90 // Tissue
91 static void Load(const CDM_BIND::TissueCompartmentData& src, SETissueCompartment& dst);
92 static CDM_BIND::TissueCompartmentData* Unload(const SETissueCompartment& src);
93 static void Serialize(const CDM_BIND::TissueCompartmentData& src, SETissueCompartment& dst);
94 static void Serialize(const SETissueCompartment& src, CDM_BIND::TissueCompartmentData& dst);
95};
Definition: PBCompartment.h:28
Definition: SECircuitManager.h:38
Definition: SECompartment.h:14
Definition: SECompartmentManager.h:25
Definition: SEFluidCompartment.h:19
Definition: SEGasCompartmentGraph.h:15
Definition: SEGasCompartment.h:14
Definition: SELiquidCompartmentGraph.h:16
Definition: SELiquidCompartment.h:11
Definition: SESubstanceManager.h:9
Definition: SEThermalCompartment.h:12
Definition: SETissueCompartment.h:9

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.