VPTissue Reference Manual
ComponentFactoryBase.h
Go to the documentation of this file.
1 #ifndef MODEL_COMPONENT_ABSTRACT_FACTORY_H_INCLUDED
2 #define MODEL_COMPONENT_ABSTRACT_FACTORY_H_INCLUDED
3 /*
4  * Copyright 2011-2016 Universiteit Antwerpen
5  *
6  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
7  * the European Commission - subsequent versions of the EUPL (the "Licence");
8  * You may not use this work except in compliance with the Licence.
9  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the Licence is distributed on an "AS IS" basis,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the Licence for the specific language governing
15  * permissions and limitations under the Licence.
16  */
22 #include "ComponentInterfaces.h"
23 #include "ComponentTraits.h"
24 
25 #include <string>
26 #include <vector>
27 
28 namespace SimPT_Sim { struct CoreData; }
29 
30 namespace SimPT_Sim {
31 
33 using namespace std;
34 using boost::property_tree::ptree;
35 
38 {
39 public:
41  virtual ~ComponentFactoryBase() =default;
42 
44  virtual CellChemistryComponent CreateCellChemistry(const CoreData&) const { return nullptr; }
45 
47  virtual CellColorComponent CreateCellColor(const string&, const ptree&) const { return nullptr; }
48 
50  virtual CellDaughtersComponent CreateCellDaughters(const CoreData&) const { return nullptr; }
51 
53  virtual CellHousekeepComponent CreateCellHousekeep(const CoreData&) const { return nullptr; }
54 
56  virtual CellSplitComponent CreateCellSplit(const CoreData&) const { return nullptr; }
57 
59  virtual CellToCellTransportComponent CreateCellToCellTransport(const CoreData&) const { return nullptr; }
60 
62  virtual DeltaHamiltonianComponent CreateDeltaHamiltonian(const CoreData&) const { return nullptr; }
63 
65  virtual HamiltonianComponent CreateHamiltonian(const CoreData&) const { return nullptr; }
66 
68  virtual MoveGeneratorComponent CreateMoveGenerator(const CoreData&) const { return nullptr; }
69 
71  virtual TimeEvolverComponent CreateTimeEvolver(const CoreData&) const { return nullptr; }
72 
74  virtual WallChemistryComponent CreateWallChemistry(const CoreData&) const { return nullptr; }
75 
76 public:
78  virtual std::vector<std::string> ListCellChemistry() const { return std::vector<std::string>(); }
79 
81  virtual std::vector<std::string> ListCellColor() const { return std::vector<std::string>(); }
82 
84  virtual std::vector<std::string> ListCellDaughters() const { return std::vector<std::string>(); }
85 
87  virtual std::vector<std::string> ListCellHousekeep() const { return std::vector<std::string>(); }
88 
90  virtual std::vector<std::string> ListCellSplit() const { return std::vector<std::string>(); }
91 
93  virtual std::vector<std::string> ListCellToCellTransport() const { return std::vector<std::string>(); }
94 
96  virtual std::vector<std::string> ListDeltaHamiltonian() const { return std::vector<std::string>(); }
97 
99  virtual std::vector<std::string> ListHamiltonian() const { return std::vector<std::string>(); }
100 
102  virtual std::vector<std::string> ListMoveGenerator() const { return std::vector<std::string>(); }
103 
105  virtual std::vector<std::string> ListTimeEvolver() const { return std::vector<std::string>(); }
106 
108  virtual std::vector<std::string> ListWallChemistry() const { return std::vector<std::string>(); }
109 
110 public:
113  {
114  return CreateCellChemistry(cd);
115  }
116 
119  const std::string& select, const boost::property_tree::ptree& pt, CellColorTag) const
120  {
121  return CreateCellColor(select, pt);
122  }
123 
126  {
127  return CreateCellDaughters(cd);
128  }
129 
132  {
133  return CreateCellHousekeep(cd);
134  }
135 
137  virtual CellSplitComponent Create(const CoreData& cd, CellSplitTag) const
138  {
139  return CreateCellSplit(cd);
140  }
141 
144  {
145  return CreateCellToCellTransport(cd);
146  }
147 
150  {
151  return CreateDeltaHamiltonian(cd);
152  }
153 
156  {
157  return CreateHamiltonian(cd);
158  }
159 
162  {
163  return CreateMoveGenerator(cd);
164  }
165 
168  {
169  return CreateTimeEvolver(cd);
170  }
171 
174  {
175  return CreateWallChemistry(cd);
176  }
177 
178 public:
180  virtual std::vector<std::string> List(CellChemistryTag) const
181  {
182  return ListCellChemistry();
183  }
184 
186  virtual std::vector<std::string> List(CellColorTag) const
187  {
188  return ListCellColor();
189  }
190 
192  virtual std::vector<std::string> List(CellDaughtersTag) const
193  {
194  return ListCellDaughters();
195  }
196 
198  virtual std::vector<std::string> List(CellHousekeepTag) const
199  {
200  return ListCellHousekeep();
201  }
202 
204  virtual std::vector<std::string> List(CellSplitTag) const
205  {
206  return ListCellSplit();
207  }
208 
210  virtual std::vector<std::string> List(CellToCellTransportTag) const
211  {
212  return ListCellToCellTransport();
213  }
214 
216  virtual std::vector<std::string> List(DeltaHamiltonianTag) const
217  {
218  return ListDeltaHamiltonian();
219  }
220 
222  virtual std::vector<std::string> List(HamiltonianTag) const
223  {
224  return ListHamiltonian();
225  }
226 
228  virtual std::vector<std::string> List(MoveGeneratorTag) const
229  {
230  return ListMoveGenerator();
231  }
232 
234  virtual std::vector<std::string> List(TimeEvolverTag) const
235  {
236  return ListTimeEvolver();
237  }
238 
240  virtual std::vector<std::string> List(WallChemistryTag) const
241  {
242  return ListWallChemistry();
243  }
244 };
245 
246 } // namespace
247 
248 #endif // end_of_include_guard
virtual HamiltonianComponent CreateHamiltonian(const CoreData &) const
Create a component for Hamitonian.
virtual std::vector< std::string > List(CellSplitTag) const
Utility method with tag forwarding for use in templates.
virtual CellToCellTransportComponent Create(const CoreData &cd, CellToCellTransportTag) const
Utility method with tag forwarding for use in templates.
std::function< double(Cell *)> HamiltonianComponent
Hamiltonian component interface.
std::function< double(const NeighborNodes &, Node *, std::array< double, 3 >)> DeltaHamiltonianComponent
DeltaHamiltonian component interface.
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
virtual MoveGeneratorComponent CreateMoveGenerator(const CoreData &) const
Create a component for MoveGenerator.
STL namespace.
virtual HamiltonianComponent Create(const CoreData &cd, HamiltonianTag) const
Utility method with tag forwarding for use in templates.
virtual DeltaHamiltonianComponent Create(const CoreData &cd, DeltaHamiltonianTag) const
Utility method with tag forwarding for use in templates.
virtual std::vector< std::string > List(MoveGeneratorTag) const
Utility method with tag forwarding for use in templates.
virtual std::vector< std::string > ListHamiltonian() const
List components for Hamiltonian.
std::function< std::tuple< bool, bool, std::array< double, 3 >>(Cell *)> CellSplitComponent
CellSplit component interface.
std::function< std::array< double, 3 >()> MoveGeneratorComponent
MoveGenerator component interface.
Interface of Model Components.
virtual std::vector< std::string > List(CellChemistryTag) const
Utility method with tag forwarding for use in templates.
Used in tag forwarding.
Interface for ComponentFactory.
Used in tag forwarding.
virtual std::vector< std::string > List(DeltaHamiltonianTag) const
Utility method with tag forwarding for use in templates.
Used in tag forwarding.
std::function< void(Cell *, Cell *)> CellDaughtersComponent
CellDaughters component interface.
Namespace for the core simulator.
virtual CellHousekeepComponent CreateCellHousekeep(const CoreData &) const
Create a component for CellHouseKeep.
virtual std::vector< std::string > List(WallChemistryTag) const
Utility method with tag forwarding for use in templates.
virtual CellColorComponent CreateCellColor(const string &, const ptree &) const
Create a component for CellColor.
virtual std::vector< std::string > List(CellColorTag) const
Utility method with tag forwarding for use in templates.
virtual CellDaughtersComponent Create(const CoreData &cd, CellDaughtersTag) const
Utility method with tag forwarding for use in templates.
virtual std::vector< std::string > List(TimeEvolverTag) const
Utility method with tag forwarding for use in templates.
virtual CellSplitComponent Create(const CoreData &cd, CellSplitTag) const
Utility method with tag forwarding for use in templates.
Used in tag forwarding.
virtual std::vector< std::string > List(CellHousekeepTag) const
Utility method with tag forwarding or use in templates.
virtual std::vector< std::string > ListCellColor() const
List components for CellColor.
virtual CellDaughtersComponent CreateCellDaughters(const CoreData &) const
Create a component for CellDaughters.
virtual std::vector< std::string > ListWallChemistry() const
List components for WallChemistry.
virtual std::vector< std::string > ListCellSplit() const
List components for CellSplit.
virtual std::vector< std::string > List(CellDaughtersTag) const
Utility method with tag forwarding for use in templates.
Used in tag forwarding.
virtual CellChemistryComponent Create(const CoreData &cd, CellChemistryTag) const
Utility method with tag forwarding for use in templates.
std::function< void(Cell *, double *)> CellChemistryComponent
CellChemistry component interface.
std::function< void(Cell *)> CellHousekeepComponent
CellHousekeep component interface.
Used in tag forwarding.
virtual CellToCellTransportComponent CreateCellToCellTransport(const CoreData &) const
Create a component for ReactionTransport.
Used in tag forwarding.
Used in tag forwarding.
virtual std::vector< std::string > ListCellToCellTransport() const
List components for CellToCellTransport.
Used in tag forwarding.
virtual std::vector< std::string > ListCellChemistry() const
List components for CellChemistry.
virtual std::vector< std::string > ListCellDaughters() const
List components for CellDaughters.
virtual WallChemistryComponent Create(const CoreData &cd, WallChemistryTag) const
Utility method with tag forwarding for use in templates.
virtual DeltaHamiltonianComponent CreateDeltaHamiltonian(const CoreData &) const
Create a component for DeltaHamitonian.
std::function< void(Wall *, double *, double *)> WallChemistryComponent
Wall chemistry component interface.
virtual WallChemistryComponent CreateWallChemistry(const CoreData &) const
Create a component for WallChemistry.
virtual CellChemistryComponent CreateCellChemistry(const CoreData &) const
Create a component for CellChemistry.
Used in tag forwarding.
Model component .
virtual std::vector< std::string > ListMoveGenerator() const
List components for MoveGenrator.
virtual std::vector< std::string > ListTimeEvolver() const
List components for TimeEvolver.
virtual std::vector< std::string > ListCellHousekeep() const
List components for CellHouseKeep.
std::function< std::array< double, 3 >(Cell *)> CellColorComponent
CellColor component interface.
virtual CellColorComponent Create(const std::string &select, const boost::property_tree::ptree &pt, CellColorTag) const
Utility method with tag forwarding for use in templates.
std::function< std::tuple< SimTimingTraits::CumulativeTimings, bool >(double, SimPhase)> TimeEvolverComponent
Time Evolver component interface.
virtual std::vector< std::string > List(HamiltonianTag) const
Utility method with tag forwarding for use in templates.
virtual CellHousekeepComponent Create(const CoreData &cd, CellHousekeepTag) const
Utility method with tag forwarding or use in templates.
Used in tag forwarding.
virtual CellSplitComponent CreateCellSplit(const CoreData &) const
Create a component for CellSplit.
virtual MoveGeneratorComponent Create(const CoreData &cd, MoveGeneratorTag) const
Utility method with tag forwarding for use in templates.
virtual TimeEvolverComponent CreateTimeEvolver(const CoreData &) const
Create a component for TimeEvolver.
std::function< void(Wall *, double *, double *)> CellToCellTransportComponent
CellToCellTransport component interface.
virtual std::vector< std::string > List(CellToCellTransportTag) const
Utility method with tag forwarding for use in templates.
virtual TimeEvolverComponent Create(const CoreData &cd, TimeEvolverTag) const
Utility method with tag forwarding for use in templates.
virtual std::vector< std::string > ListDeltaHamiltonian() const
List components for DeltaHamiltonian.