VPTissue Reference Manual
CellHousekeeper.cpp
Go to the documentation of this file.
1 /*
2  * Copyright 2011-2016 Universiteit Antwerpen
3  *
4  * Licensed under the EUPL, Version 1.1 or as soon they will be approved by
5  * the European Commission - subsequent versions of the EUPL (the "Licence");
6  * You may not use this work except in compliance with the Licence.
7  * You may obtain a copy of the Licence at: http://ec.europa.eu/idabc/eupl5
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the Licence is distributed on an "AS IS" basis,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the Licence for the specific language governing
13  * permissions and limitations under the Licence.
14  */
20 #include "CellHousekeeper.h"
21 
22 #include "bio/Mesh.h"
24 #include "sim/CoreData.h"
25 #include "util/misc/Exception.h"
26 #include "util/misc/log_debug.h"
27 
28 using namespace std;
29 using namespace boost::property_tree;
30 using namespace SimPT_Sim::Util;
31 
32 namespace SimPT_Sim {
33 
34 CellHousekeeper::CellHousekeeper()
35 {
36 }
37 
38 CellHousekeeper::CellHousekeeper(const CoreData& cd)
39 {
40  Initialize(cd);
41 }
42 
43 ptree CellHousekeeper::Exec() const
44 {
45  for (auto cell : m_cd.m_mesh->GetCells()) {
46  m_cell_housekeep(cell);
47  }
48  return ptree();
49 }
50 
51 void CellHousekeeper::Initialize(const CoreData& cd)
52 {
53  assert(cd.Check() && "CoreData not ok.");
54  m_cd = cd;
55  const auto model_group = m_cd.m_parameters->get<string>("model.group", "");
56  const auto factory = ComponentFactoryProxy::Create(model_group);
57  m_cell_housekeep = factory->CreateCellHousekeep(m_cd);
58 }
59 
60 } // namespace
Interface for CellHousekeeper.
Core data with mesh, parameters, random engine and time data.
Definition: CoreData.h:38
STL namespace.
Core data used during model execution.
Namespace for miscellaneous utilities.
Definition: PTreeFile.cpp:44
Namespace for the core simulator.
Macro defs for debug and logging.
Proxy for dealing with the factories.
Header file for Exception class.
bool Check() const
Verify all pointers non-null.
Definition: CoreData.h:53
Interface for Mesh.