SECompartmentTransportGraph.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 <vector>
15 #include <string>
16 
17 #include <biogears/cdm/compartment/SECompartmentGraph.h>
18 
19 #define COMPARTMENT_TRANSPORT_GRAPH_TEMPLATE typename GraphType, typename GraphVertexType, typename GraphEdgeType, typename CompartmentType, typename CompartmentLinkType
20 #define COMPARTMENT_TRANSPORT_GRAPH_TYPES GraphType, GraphVertexType, GraphEdgeType, CompartmentType, CompartmentLinkType
21 
22 namespace biogears {
23 template <COMPARTMENT_TRANSPORT_GRAPH_TEMPLATE>
24 class SECompartmentTransportGraph : public GraphType, public SECompartmentGraph<COMPARTMENT_GRAPH_TYPES> {
25 public:
26  SECompartmentTransportGraph(const char* name, Logger* logger);
27  SECompartmentTransportGraph(const std::string& name, Logger* logger);
29 
30  virtual void Clear() override;
31  /*
32  virtual bool Load(const BindType& in);
33  virtual BindType* Unload() = 0;
34 protected:
35  virtual void Unload(BindType& data);
36 */
37 
38 public:
39  virtual std::string GetName() const override;
40  virtual const char* GetName_cStr() const override;
41 
42  virtual void StateChange();
43 
44 protected:
45  virtual void BalanceByIntensive() override= 0;
46  virtual size_t GetVertexIndex(const GraphVertexType& v) const override;
47  virtual const std::vector<GraphVertexType*>& GetVerticies() const override;
48  virtual const std::vector<GraphEdgeType*>* GetSourceEdges(const GraphVertexType& v) const override;
49  virtual const std::vector<GraphEdgeType*>* GetTargetEdges(const GraphVertexType& v) const override;
50 
51  std::vector<GraphVertexType*> m_Verticies;
52  std::map<const GraphVertexType*, size_t> m_VertexIndicies;
53  std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_SourceEdgeMap;
54  std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_TargetEdgeMap;
55 };
56 }
std::vector< GraphVertexType * > m_Verticies
Definition: SECompartmentTransportGraph.h:51
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_SourceEdgeMap
Definition: SECompartmentTransportGraph.h:53
virtual const std::vector< GraphVertexType * > & GetVerticies() const override
Definition: Logger.h:75
Definition: SECompartmentTransportGraph.h:24
virtual size_t GetVertexIndex(const GraphVertexType &v) const override
virtual void BalanceByIntensive() override=0
Definition: SECompartmentGraph.h:25
virtual const std::vector< GraphEdgeType * > * GetSourceEdges(const GraphVertexType &v) const override
std::map< const GraphVertexType *, size_t > m_VertexIndicies
Definition: SECompartmentTransportGraph.h:52
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_TargetEdgeMap
Definition: SECompartmentTransportGraph.h:54
virtual const std::vector< GraphEdgeType * > * GetTargetEdges(const GraphVertexType &v) const override
virtual const char * GetName_cStr() const override
Definition: SEElectricalCircuit.h:18
virtual std::string GetName() const override
SECompartmentTransportGraph(const char *name, Logger *logger)