SECompartmentTransportGraph.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "cdm/compartment/SECompartmentGraph.h"
6 
7 #define COMPARTMENT_TRANSPORT_GRAPH_TEMPLATE typename GraphType, typename GraphVertexType, typename GraphEdgeType, typename CompartmentType, typename CompartmentLinkType
8 #define COMPARTMENT_TRANSPORT_GRAPH_TYPES GraphType, GraphVertexType, GraphEdgeType, CompartmentType, CompartmentLinkType
9 
10 template<COMPARTMENT_TRANSPORT_GRAPH_TEMPLATE>
11 class SECompartmentTransportGraph : public GraphType, public SECompartmentGraph<COMPARTMENT_GRAPH_TYPES>
12 {
13 public:
14  SECompartmentTransportGraph(const std::string& name, Logger* logger);
16 
17  void Clear() override;
18 
19  std::string GetName() const override{ return this->m_Name; }
20 
21  virtual void StateChange();
22 
23 protected:
24  void BalanceByIntensive() override = 0;
25  int GetVertexIndex(const GraphVertexType& v) const override;
26  const std::vector<GraphVertexType*>& GetVerticies() const override;
27  const std::vector<GraphEdgeType*>* GetSourceEdges(const GraphVertexType& v) const override;
28  const std::vector<GraphEdgeType*>* GetTargetEdges(const GraphVertexType& v) const override;
29 
30  std::vector<GraphVertexType*> m_Verticies;
31  std::map<const GraphVertexType*, int> m_VertexIndicies;
32  std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_SourceEdgeMap;
33  std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_TargetEdgeMap;
34 };
35 
36 #include "cdm/compartment/SECompartmentTransportGraph.hxx"
Definition: Logger.h:71
Definition: SECompartmentGraph.h:11
std::string m_Name
Definition: SECompartmentGraph.h:39
Definition: SECompartmentTransportGraph.h:12
std::map< const GraphVertexType *, int > m_VertexIndicies
Definition: SECompartmentTransportGraph.h:31
void Clear() override
Definition: SECompartmentTransportGraph.cpp:19
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_SourceEdgeMap
Definition: SECompartmentTransportGraph.h:32
std::vector< GraphVertexType * > m_Verticies
Definition: SECompartmentTransportGraph.h:30
const std::vector< GraphEdgeType * > * GetTargetEdges(const GraphVertexType &v) const override
Definition: SECompartmentTransportGraph.cpp:99
SECompartmentTransportGraph(const std::string &name, Logger *logger)
Definition: SECompartmentTransportGraph.cpp:8
std::string GetName() const override
Definition: SECompartmentTransportGraph.h:19
void BalanceByIntensive() override=0
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_TargetEdgeMap
Definition: SECompartmentTransportGraph.h:33
int GetVertexIndex(const GraphVertexType &v) const override
Definition: SECompartmentTransportGraph.cpp:75
const std::vector< GraphEdgeType * > * GetSourceEdges(const GraphVertexType &v) const override
Definition: SECompartmentTransportGraph.cpp:91
virtual ~SECompartmentTransportGraph()
Definition: SECompartmentTransportGraph.cpp:13
virtual void StateChange()
Definition: SECompartmentTransportGraph.cpp:33
const std::vector< GraphVertexType * > & GetVerticies() const override
Definition: SECompartmentTransportGraph.cpp:86

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.