VPTissue Reference Manual
ComponentFactoryProxy.h
Go to the documentation of this file.
1 #ifndef DEFAULT__COMPONENT_FACTORY_H_INCLUDED
2 #define DEFAULT__COMPONENT_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 "ComponentFactoryBase.h"
23 #include "model/ComponentTraits.h"
24 
25 #include <memory>
26 #include <string>
27 
28 namespace SimPT_Sim {
29 
30 using boost::property_tree::ptree;
31 using std::shared_ptr;
32 using std::string;
33 
34 struct CoreData;
35 class ComponentFactoryBase;
36 
41 {
42 public:
44  static std::shared_ptr<ComponentFactoryProxy> Create(const string& group_name, bool throw_ok = true);
45 
47  CellChemistryComponent CreateCellChemistry(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
48 
50  CellColorComponent CreateCellColor(const string& select, const ptree& pt, bool default_ok = true, bool throw_ok = true) const;
51 
53  CellDaughtersComponent CreateCellDaughters(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
54 
56  CellHousekeepComponent CreateCellHousekeep(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
57 
59  CellSplitComponent CreateCellSplit(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
60 
62  CellToCellTransportComponent CreateCellToCellTransport(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
63 
65  DeltaHamiltonianComponent CreateDeltaHamiltonian(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
66 
68  HamiltonianComponent CreateHamiltonian(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
69 
71  MoveGeneratorComponent CreateMoveGenerator(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
72 
74  TimeEvolverComponent CreateTimeEvolver(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
75 
77  WallChemistryComponent CreateWallChemistry(const CoreData& cd, bool default_ok = true, bool throw_ok = true) const;
78 
79 public:
81  std::vector<std::string> ListCellChemistry(bool default_ok = true) const;
82 
84  std::vector<std::string> ListCellColor(bool default_ok = true) const;
85 
87  std::vector<std::string> ListCellDaughters(bool default_ok = true) const;
88 
90  std::vector<std::string> ListCellHousekeep(bool default_ok = true) const;
91 
93  std::vector<std::string> ListCellSplit(bool default_ok = true) const;
94 
96  std::vector<std::string> ListCellToCellTransport(bool default_ok = true) const;
97 
99  std::vector<std::string> ListDeltaHamiltonian(bool default_ok = true) const;
100 
102  std::vector<std::string> ListHamiltonian(bool default_ok = true) const;
103 
105  std::vector<std::string> ListMoveGenerator(bool default_ok = true) const;
106 
108  std::vector<std::string> ListTimeEvolver(bool default_ok = true) const;
109 
111  std::vector<std::string> ListWallChemistry(bool default_ok = true) const;
112 
113 private:
115  ComponentFactoryProxy(shared_ptr<ComponentFactoryBase>, shared_ptr<ComponentFactoryBase>);
116 
118  template<typename T>
119  typename ComponentTraits<T>::ComponentType CreateHelper(const CoreData& cd, bool default_ok, bool throw_ok) const;
120 
122  template<typename T>
123  vector<string> ListHelper(bool default_ok) const;
124 
125 private:
126  shared_ptr<ComponentFactoryBase> m_default;
127  shared_ptr<ComponentFactoryBase> m_factory;
128 };
129 
130 } // namespace
131 
132 #endif // end_of_include_guard
std::function< double(Cell *)> HamiltonianComponent
Hamiltonian component interface.
CellSplitComponent CreateCellSplit(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a CellSplit component.
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
Interface of Component Factory.
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.
MoveGeneratorComponent CreateMoveGenerator(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a CellSplit component.
std::vector< std::string > ListCellSplit(bool default_ok=true) const
List components for CellSplit.
static std::shared_ptr< ComponentFactoryProxy > Create(const string &group_name, bool throw_ok=true)
Create a factory proxy.
std::function< void(Cell *, Cell *)> CellDaughtersComponent
CellDaughters component interface.
CellToCellTransportComponent CreateCellToCellTransport(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a CellToCellTransport component.
Namespace for the core simulator.
std::vector< std::string > ListTimeEvolver(bool default_ok=true) const
List components for TimeEvolver.
CellHousekeepComponent CreateCellHousekeep(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a CellHouskeep component.
std::vector< std::string > ListDeltaHamiltonian(bool default_ok=true) const
List components for DeltaHamiltonian.
CellColorComponent CreateCellColor(const string &select, const ptree &pt, bool default_ok=true, bool throw_ok=true) const
Create a CellColor component.
std::vector< std::string > ListCellColor(bool default_ok=true) const
List components for CellColor.
WallChemistryComponent CreateWallChemistry(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a WallChemistry component.
std::function< void(Cell *, double *)> CellChemistryComponent
CellChemistry component interface.
std::vector< std::string > ListCellDaughters(bool default_ok=true) const
List components for CellDaughters.
std::function< void(Cell *)> CellHousekeepComponent
CellHousekeep component interface.
Primary template never gets instantiated.
std::vector< std::string > ListCellHousekeep(bool default_ok=true) const
List components for CellHouseKeep.
CellDaughtersComponent CreateCellDaughters(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a CellDaughters component.
std::function< void(Wall *, double *, double *)> WallChemistryComponent
Wall chemistry component interface.
HamiltonianComponent CreateHamiltonian(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a Hamiltonian component.
std::vector< std::string > ListMoveGenerator(bool default_ok=true) const
List components for MoveGenerator.
std::vector< std::string > ListCellToCellTransport(bool default_ok=true) const
List components for CellToCellTransport.
Model component .
std::vector< std::string > ListHamiltonian(bool default_ok=true) const
List components for Hamiltonian.
Proxy for interaction with Component Factory of model families.
DeltaHamiltonianComponent CreateDeltaHamiltonian(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a DeltaHamiltonian component.
std::function< std::array< double, 3 >(Cell *)> CellColorComponent
CellColor component interface.
CellChemistryComponent CreateCellChemistry(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a CellChemistry component.
std::function< std::tuple< SimTimingTraits::CumulativeTimings, bool >(double, SimPhase)> TimeEvolverComponent
Time Evolver component interface.
std::vector< std::string > ListCellChemistry(bool default_ok=true) const
List components for CellChemistry.
std::function< void(Wall *, double *, double *)> CellToCellTransportComponent
CellToCellTransport component interface.
TimeEvolverComponent CreateTimeEvolver(const CoreData &cd, bool default_ok=true, bool throw_ok=true) const
Create a TimeEvolver component.
std::vector< std::string > ListWallChemistry(bool default_ok=true) const
List components for WallChemistry.