SECompartmentTransportGraph.h
1 /* Distributed under the Apache License, Version 2.0.
2  See accompanying NOTICE file for details.*/
3 
4 #pragma once
5 #include "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  virtual void Clear();
18 
19  virtual std::string GetName() const { return this->m_Name; }
20 
21  virtual void StateChange();
22 
23 protected:
24  virtual void BalanceByIntensive()=0;
25  virtual size_t GetVertexIndex(const GraphVertexType& v) const;
26  virtual const std::vector<GraphVertexType*>& GetVerticies() const;
27  virtual const std::vector<GraphEdgeType*>* GetSourceEdges(const GraphVertexType& v) const;
28  virtual const std::vector<GraphEdgeType*>* GetTargetEdges(const GraphVertexType& v) const;
29 
30  std::vector<GraphVertexType*> m_Verticies;
31  std::map<const GraphVertexType*, size_t> m_VertexIndicies;
32  std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_SourceEdgeMap;
33  std::map<const GraphVertexType*, std::vector<GraphEdgeType*>*> m_TargetEdgeMap;
34 };
35 #include "compartment/SECompartmentTransportGraph.inl"
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_TargetEdgeMap
Definition: SECompartmentTransportGraph.h:33
Definition: Logger.h:61
virtual const std::vector< GraphEdgeType * > * GetTargetEdges(const GraphVertexType &v) const
virtual void BalanceByIntensive()=0
std::map< const GraphVertexType *, size_t > m_VertexIndicies
Definition: SECompartmentTransportGraph.h:31
virtual const std::vector< GraphEdgeType * > * GetSourceEdges(const GraphVertexType &v) const
virtual const std::vector< GraphVertexType * > & GetVerticies() const
SECompartmentTransportGraph(const std::string &name, Logger *logger)
Definition: SECompartmentGraph.h:10
virtual std::string GetName() const
Definition: SECompartmentTransportGraph.h:19
virtual ~SECompartmentTransportGraph()
std::vector< GraphVertexType * > m_Verticies
Definition: SECompartmentTransportGraph.h:30
Definition: SECompartmentTransportGraph.h:11
std::string m_Name
Definition: SECompartmentGraph.h:37
std::map< const GraphVertexType *, std::vector< GraphEdgeType * > * > m_SourceEdgeMap
Definition: SECompartmentTransportGraph.h:32
virtual size_t GetVertexIndex(const GraphVertexType &v) const