<
The Pulse Team is excited to announce the Pulse Physiology Engine 4.1.0 release. Upgrade now to get the best in dynamic simulation.
×
PBCircuit.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 
6 // Forward Declaire SE and Protobuf Circuit Types
7 CDM_BIND_DECL2(CircuitManager)
8 CDM_BIND_DECL2(ElectricalCircuit)
9 CDM_BIND_DECL2(ElectricalCircuitNode)
10 CDM_BIND_DECL2(ElectricalCircuitPath)
11 CDM_BIND_DECL2(FluidCircuit)
12 CDM_BIND_DECL2(FluidCircuitNode)
13 CDM_BIND_DECL2(FluidCircuitPath)
14 CDM_BIND_DECL2(ThermalCircuit)
15 CDM_BIND_DECL2(ThermalCircuitNode)
16 CDM_BIND_DECL2(ThermalCircuitPath)
17 // Include Templates
18 #include "cdm/circuit/SECircuit.h"
19 #include "cdm/circuit/SECircuitNode.h"
20 #include "cdm/circuit/SECircuitPath.h"
21 CDM_BIND_DECL(CircuitData)
22 CDM_BIND_DECL(CircuitNodeData)
23 CDM_BIND_DECL(CircuitPathData)
24 
25 class CDM_DECL PBCircuit
26 {
27 public:
28 
29  static bool LoadCircuitManagerFile(SECircuitManager& mgr, const std::string& filename);
30  static void SaveCircuitManagerFile(const SECircuitManager& mgr, const std::string& filename);
31 
32  // General Circuit
33  static void Load(const CDM_BIND::CircuitManagerData& src, SECircuitManager& dst);
34  static CDM_BIND::CircuitManagerData* Unload(const SECircuitManager& src);
35 
36  template<typename CircuitBindType, CIRCUIT_TEMPLATE>
37  static void Load(const CircuitBindType& src, SECircuit<CIRCUIT_TYPES>& dst, const std::map<std::string, NodeType*>& nodes, const std::map<std::string, PathType*>& paths);
38  template <typename CircuitBindType, CIRCUIT_TEMPLATE>
39  static CircuitBindType* Unload(const SECircuit<CIRCUIT_TYPES>& src);
40 
41  static void Serialize(const CDM_BIND::CircuitManagerData& src, SECircuitManager& dst);
42  static void Serialize(const SECircuitManager& src, CDM_BIND::CircuitManagerData& dst);
43 
44  template<typename CircuitBindType, CIRCUIT_TEMPLATE>
45  static void Serialize(const CircuitBindType& src, SECircuit<CIRCUIT_TYPES>& dst, const std::map<std::string, NodeType*>& nodes, const std::map<std::string, PathType*>& paths);
46  template<typename CircuitBindType, CIRCUIT_TEMPLATE>
47  static void Serialize(const SECircuit<CIRCUIT_TYPES>& src, CircuitBindType& dst);
48  template<CIRCUIT_NODE_TEMPLATE>
49  static void Serialize(const CDM_BIND::CircuitNodeData& src, SECircuitNode<CIRCUIT_NODE_TYPES>& dst);
50  template<CIRCUIT_NODE_TEMPLATE>
51  static void Serialize(const SECircuitNode<CIRCUIT_NODE_TYPES>& src, CDM_BIND::CircuitNodeData& dst);
52  template<CIRCUIT_PATH_TEMPLATE>
53  static void Serialize(const CDM_BIND::CircuitPathData& src, SECircuitPath<CIRCUIT_PATH_TYPES>& dst);
54  template<CIRCUIT_PATH_TEMPLATE>
55  static void Serialize(const SECircuitPath<CIRCUIT_PATH_TYPES>& src, CDM_BIND::CircuitPathData& dst);
56 
57  // Electrical
58  static void Load(const CDM_BIND::ElectricalCircuitPathData& src, SEElectricalCircuitPath& dst);
59  static CDM_BIND::ElectricalCircuitPathData* Unload(const SEElectricalCircuitPath& src);
60  static void Load(const CDM_BIND::ElectricalCircuitNodeData& src, SEElectricalCircuitNode& dst);
61  static CDM_BIND::ElectricalCircuitNodeData* Unload(const SEElectricalCircuitNode& src);
62  static void Serialize(const CDM_BIND::ElectricalCircuitPathData& src, SEElectricalCircuitPath& dst);
63  static void Serialize(const SEElectricalCircuitPath& src, CDM_BIND::ElectricalCircuitPathData& dst);
64  static void Serialize(const CDM_BIND::ElectricalCircuitNodeData& src, SEElectricalCircuitNode& dst);
65  static void Serialize(const SEElectricalCircuitNode& src, CDM_BIND::ElectricalCircuitNodeData& dst);
66 
67  // Fluid
68  static void Load(const CDM_BIND::FluidCircuitPathData& src, SEFluidCircuitPath& dst);
69  static CDM_BIND::FluidCircuitPathData* Unload(const SEFluidCircuitPath& src);
70  static void Load(const CDM_BIND::FluidCircuitNodeData& src, SEFluidCircuitNode& dst);
71  static CDM_BIND::FluidCircuitNodeData* Unload(const SEFluidCircuitNode& src);
72  static void Serialize(const CDM_BIND::FluidCircuitPathData& src, SEFluidCircuitPath& dst);
73  static void Serialize(const SEFluidCircuitPath& src, CDM_BIND::FluidCircuitPathData& dst);
74  static void Serialize(const CDM_BIND::FluidCircuitNodeData& src, SEFluidCircuitNode& dst);
75  static void Serialize(const SEFluidCircuitNode& src, CDM_BIND::FluidCircuitNodeData& dst);
76 
77  // Thermal
78  static void Load(const CDM_BIND::ThermalCircuitNodeData& src, SEThermalCircuitNode& dst);
79  static CDM_BIND::ThermalCircuitNodeData* Unload(const SEThermalCircuitNode& src);
80  static void Load(const CDM_BIND::ThermalCircuitPathData& src, SEThermalCircuitPath& dst);
81  static CDM_BIND::ThermalCircuitPathData* Unload(const SEThermalCircuitPath& src);
82  static void Serialize(const CDM_BIND::ThermalCircuitNodeData& src, SEThermalCircuitNode& dst);
83  static void Serialize(const SEThermalCircuitNode& src, CDM_BIND::ThermalCircuitNodeData& dst);
84  static void Serialize(const CDM_BIND::ThermalCircuitPathData& src, SEThermalCircuitPath& dst);
85  static void Serialize(const SEThermalCircuitPath& src, CDM_BIND::ThermalCircuitPathData& dst);
86 };
Definition: SEFluidCircuitPath.h:8
Definition: SEElectricalCircuitPath.h:8
Definition: SEThermalCircuitPath.h:8
Definition: SECircuitPath.h:36
Definition: SEFluidCircuitNode.h:9
Definition: PBCircuit.h:25
Definition: SECircuitManager.h:37
Definition: SEThermalCircuitNode.h:9
Definition: SEElectricalCircuitNode.h:9
Definition: SECircuit.h:12

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.