VPTissue Reference Manual
Exploration.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 "Exploration.h"
21 
22 using boost::property_tree::ptree;
23 
24 namespace SimPT_Parex {
25 
26 Exploration::Exploration(const std::string& name, const ptree& preferences)
27  : m_name(name), m_preferences(preferences)
28 {
29 }
30 
31 Exploration::Exploration(const ptree& pt)
32 {
33  ReadPtree(pt);
34 }
35 
36 Exploration::Exploration(const Exploration& other)
37  : m_name(other.m_name), m_preferences(other.m_preferences)
38 {
39 }
40 
42 {
43  if (this != &other) {
44  m_name = other.m_name;
45  m_preferences = other.m_preferences;
46  }
47 
48  return *this;
49 }
50 
51 ptree Exploration::ToPtree() const
52 {
53  ptree pt;
54  pt.put("name", m_name);
55  pt.put_child("preferences", m_preferences);
56  return pt;
57 }
58 
59 void Exploration::ReadPtree(const ptree& pt)
60 {
61  m_name = pt.get<std::string>("name");
62  m_preferences = pt.get_child("preferences");
63 }
64 
65 } // namespace
Interface for Exploration.
Exploration(const std::string &name, const boost::property_tree::ptree &preferences)
Constructor.
virtual boost::property_tree::ptree ToPtree() const
Convert the exploration to a ptree.
Definition: Exploration.cpp:51
Exploration & operator=(const Exploration &other)
Assignment operator.
Definition: Exploration.cpp:41
Namespace for SimPT parameter explorer package.
Definition: Client.cpp:52
Class describing a generic exploration.
Definition: Exploration.h:33