SECompartmentGraph.h
1/* Distributed under the Apache License, Version 2.0.
2 See accompanying NOTICE file for details.*/
3
4#pragma once
5
6#define COMPARTMENT_GRAPH_TEMPLATE typename CompartmentType, typename CompartmentLinkType
7#define COMPARTMENT_GRAPH_TYPES CompartmentType, CompartmentLinkType
8
9template<COMPARTMENT_GRAPH_TEMPLATE>
11{
12 friend class PBCompartment;//friend the serialization class
13protected:
14 SECompartmentGraph(const std::string& name, Logger* logger);
15public:
17
18 virtual void Clear();
19
20 virtual std::string GetName() const;
21
22 virtual void AddCompartment(CompartmentType& cmpt);
23 virtual void ForceAddCompartment(CompartmentType& cmpt);// No check for cmpt with the same name
24 virtual CompartmentType* GetCompartment(const std::string& name);
25 virtual const CompartmentType* GetCompartment(const std::string& name) const;
26 virtual const std::vector<CompartmentType*>& GetCompartments() const;
27 virtual void RemoveCompartment(const CompartmentType& cmpt);
28 virtual void RemoveCompartment(const std::string& name);
29
30 virtual void AddLink(CompartmentLinkType& link);
31 virtual void ForceAddLink(CompartmentLinkType& link);// No check for link with the same name
32 virtual CompartmentLinkType* GetLink(const std::string& name);
33 virtual const CompartmentLinkType* GetLink(const std::string& name) const;
34 virtual const std::vector<CompartmentLinkType*>& GetLinks() const;
35 virtual void RemoveLink(const CompartmentLinkType& link);
36 virtual void RemoveLink(const std::string& name);
37
38protected:
39 std::string m_Name;
40 std::vector<CompartmentType*> m_Compartments;
41 std::vector<CompartmentLinkType*> m_CompartmentLinks;
42};
43
44#include "cdm/compartment/SECompartmentGraph.hxx"
Definition: Logger.h:23
Definition: Logger.h:71
Definition: PBCompartment.h:28
Definition: SECompartmentGraph.h:11
virtual CompartmentLinkType * GetLink(const std::string &name)
std::string m_Name
Definition: SECompartmentGraph.h:39
SECompartmentGraph(const std::string &name, Logger *logger)
virtual void RemoveCompartment(const CompartmentType &cmpt)
virtual void RemoveLink(const CompartmentLinkType &link)
virtual void Clear()
virtual const std::vector< CompartmentType * > & GetCompartments() const
virtual void ForceAddCompartment(CompartmentType &cmpt)
virtual const CompartmentLinkType * GetLink(const std::string &name) const
virtual const CompartmentType * GetCompartment(const std::string &name) const
virtual void RemoveCompartment(const std::string &name)
std::vector< CompartmentLinkType * > m_CompartmentLinks
Definition: SECompartmentGraph.h:41
virtual CompartmentType * GetCompartment(const std::string &name)
virtual ~SECompartmentGraph()
virtual void AddCompartment(CompartmentType &cmpt)
std::vector< CompartmentType * > m_Compartments
Definition: SECompartmentGraph.h:40
virtual const std::vector< CompartmentLinkType * > & GetLinks() const
virtual void RemoveLink(const std::string &name)
virtual void AddLink(CompartmentLinkType &link)
virtual void ForceAddLink(CompartmentLinkType &link)
virtual std::string GetName() const

Distributed under the Apache License, Version 2.0.

See accompanying NOTICE file for details.