|
@@ -1,5 +1,5 @@
|
|
/**
|
|
/**
|
|
- * @file artis/kernel/Simulator.hpp
|
|
|
|
|
|
+ * @file artis/builder/Builder.hpp
|
|
* @author See the AUTHORS file
|
|
* @author See the AUTHORS file
|
|
*/
|
|
*/
|
|
|
|
|
|
@@ -20,18 +20,18 @@
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
*/
|
|
*/
|
|
|
|
|
|
-#ifndef ARTIS_KERNEL_BUILDER_HPP
|
|
|
|
-#define ARTIS_KERNEL_BUILDER_HPP
|
|
|
|
|
|
+#ifndef ARTIS_BUILDER_BUILDER_HPP
|
|
|
|
+#define ARTIS_BUILDER_BUILDER_HPP
|
|
|
|
|
|
#include <boost/property_tree/ptree.hpp>
|
|
#include <boost/property_tree/ptree.hpp>
|
|
#include <boost/property_tree/json_parser.hpp>
|
|
#include <boost/property_tree/json_parser.hpp>
|
|
|
|
|
|
#include <artis/kernel/AbstractCoupledModel.hpp>
|
|
#include <artis/kernel/AbstractCoupledModel.hpp>
|
|
-#include <artis/kernel/ModelFactory.hpp>
|
|
|
|
|
|
+#include <artis/builder/ModelFactory.hpp>
|
|
|
|
|
|
#include <sstream>
|
|
#include <sstream>
|
|
|
|
|
|
-namespace artis { namespace kernel {
|
|
|
|
|
|
+namespace artis { namespace builder {
|
|
|
|
|
|
template < typename F, typename T, typename U, typename V, typename W >
|
|
template < typename F, typename T, typename U, typename V, typename W >
|
|
class Builder
|
|
class Builder
|
|
@@ -52,11 +52,12 @@ public:
|
|
{ return dynamic_cast < T* >(build_model(tree)); }
|
|
{ return dynamic_cast < T* >(build_model(tree)); }
|
|
|
|
|
|
private:
|
|
private:
|
|
- AbstractModel < U, V >* build_model(boost::property_tree::ptree const& pt)
|
|
|
|
|
|
+ kernel::AbstractModel < U, V >* build_model(
|
|
|
|
+ boost::property_tree::ptree const& pt)
|
|
{
|
|
{
|
|
using boost::property_tree::ptree;
|
|
using boost::property_tree::ptree;
|
|
|
|
|
|
- AbstractModel < U, V >* model = nullptr;
|
|
|
|
|
|
+ kernel::AbstractModel < U, V >* model = nullptr;
|
|
std::string name;
|
|
std::string name;
|
|
ptree::const_iterator it_type = pt.end();
|
|
ptree::const_iterator it_type = pt.end();
|
|
ptree::const_iterator it_name = pt.end();
|
|
ptree::const_iterator it_name = pt.end();
|
|
@@ -113,7 +114,7 @@ private:
|
|
}
|
|
}
|
|
|
|
|
|
void build_internals(boost::property_tree::ptree const& pt,
|
|
void build_internals(boost::property_tree::ptree const& pt,
|
|
- AbstractModel < U, V >* model)
|
|
|
|
|
|
+ kernel::AbstractModel < U, V >* model)
|
|
{
|
|
{
|
|
using boost::property_tree::ptree;
|
|
using boost::property_tree::ptree;
|
|
|
|
|
|
@@ -123,7 +124,7 @@ private:
|
|
}
|
|
}
|
|
|
|
|
|
void build_externals(boost::property_tree::ptree const& pt,
|
|
void build_externals(boost::property_tree::ptree const& pt,
|
|
- AbstractModel < U, V >* model)
|
|
|
|
|
|
+ kernel::AbstractModel < U, V >* model)
|
|
{
|
|
{
|
|
using boost::property_tree::ptree;
|
|
using boost::property_tree::ptree;
|
|
|
|
|
|
@@ -133,7 +134,7 @@ private:
|
|
}
|
|
}
|
|
|
|
|
|
void build_states(boost::property_tree::ptree const& pt,
|
|
void build_states(boost::property_tree::ptree const& pt,
|
|
- AbstractModel < U, V >* model)
|
|
|
|
|
|
+ kernel::AbstractModel < U, V >* model)
|
|
{
|
|
{
|
|
using boost::property_tree::ptree;
|
|
using boost::property_tree::ptree;
|
|
|
|
|
|
@@ -143,7 +144,7 @@ private:
|
|
}
|
|
}
|
|
|
|
|
|
void build_variable(boost::property_tree::ptree const& pt,
|
|
void build_variable(boost::property_tree::ptree const& pt,
|
|
- AbstractModel < U, V >* /* model */)
|
|
|
|
|
|
+ kernel::AbstractModel < U, V >* /* model */)
|
|
{
|
|
{
|
|
using boost::property_tree::ptree;
|
|
using boost::property_tree::ptree;
|
|
|
|
|