Manual for OpenFLUID 2.1.11

TreeValue.hpp
Go to the documentation of this file.
1 /*
2 
3  This file is part of OpenFLUID software
4  Copyright(c) 2007, INRA - Montpellier SupAgro
5 
6 
7  == GNU General Public License Usage ==
8 
9  OpenFLUID is free software: you can redistribute it and/or modify
10  it under the terms of the GNU General Public License as published by
11  the Free Software Foundation, either version 3 of the License, or
12  (at your option) any later version.
13 
14  OpenFLUID is distributed in the hope that it will be useful,
15  but WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  GNU General Public License for more details.
18 
19  You should have received a copy of the GNU General Public License
20  along with OpenFLUID. If not, see <http://www.gnu.org/licenses/>.
21 
22 
23  == Other Usage ==
24 
25  Other Usage means a use of OpenFLUID that is inconsistent with the GPL
26  license, and requires a written agreement between You and INRA.
27  Licensees for Other Usage of OpenFLUID may use this file in accordance
28  with the terms contained in the written agreement between You and INRA.
29 
30 */
31 
32 
33 /**
34  @file TreeValue.hpp
35 
36  @author Jean-Christophe FABRE <jean-christophe.fabre@inra.fr>
37 */
38 
39 
40 #ifndef __OPENFLUID_CORE_TREEVALUE_HPP__
41 #define __OPENFLUID_CORE_TREEVALUE_HPP__
42 
43 
44 #include <string>
45 
47 #include <openfluid/core/Tree.hpp>
48 #include <openfluid/dllexport.hpp>
49 
50 
51 namespace openfluid { namespace core {
52 
53 /**
54  TreeValue is a container for a hierarchical tree of signed double precision floating point values.\n
55 
56  @cond OpenFLUID:completion
57  {
58  "contexts" : ["ANYWARE"],
59  "menupath" : ["Compute code", "Types", "Values"],
60  "title" : "TreeValue",
61  "text" : "openfluid::core::TreeValue %%SEL_START%%Val%%SEL_END%%"
62  }
63  @endcond
64 */
65 class OPENFLUID_API TreeValue : public CompoundValue, public Tree<std::string,double>
66 {
67 
68  public:
69 
70  /**
71  Default constructor
72  */
73  TreeValue() : CompoundValue(), Tree<std::string,double>()
74  { }
75 
76  /**
77  Copy constructor
78  */
79  TreeValue(const TreeValue& Val) :
80  CompoundValue(),
81  Tree<std::string,double>(static_cast<const Tree<std::string,double>& >(Val))
82  { }
83 
84  TreeValue& operator=(const Value& Other) override;
85 
86  TreeValue& operator=(const TreeValue& Other);
87 
88  virtual ~TreeValue()
89  { }
90 
91  inline Type getType() const override
92  {
93  return Value::TREE;
94  }
95 
96  Value* clone() const override
97  {
98  return new TreeValue(*this);
99  };
100 
101  void writeToStream(std::ostream& OutStm) const override;
102 
103  void writeQuotedToStream(std::ostream& OutStm) const override
104  {
105  writeToStream(OutStm);
106  }
107 
108 };
109 
110 
111 } } // namespaces
112 
113 
114 #endif /* __OPENFLUID_CORE_TREEVALUE_HPP__ */
openfluid::core::Value
Definition: Value.hpp:62
openfluid::core::CompoundValue
Definition: CompoundValue.hpp:51
OPENFLUID_API
#define OPENFLUID_API
Definition: dllexport.hpp:86
openfluid::core::TreeValue::writeQuotedToStream
void writeQuotedToStream(std::ostream &OutStm) const override
Definition: TreeValue.hpp:103
openfluid::core::Value::TREE
@ TREE
Definition: Value.hpp:66
openfluid::core::Value::Type
Type
Definition: Value.hpp:66
openfluid::core::TreeValue::TreeValue
TreeValue(const TreeValue &Val)
Definition: TreeValue.hpp:79
CompoundValue.hpp
openfluid::core::Tree
Definition: Tree.hpp:55
openfluid::core::TreeValue::~TreeValue
virtual ~TreeValue()
Definition: TreeValue.hpp:88
openfluid
Definition: ApplicationException.hpp:47
openfluid::core::TreeValue::TreeValue
TreeValue()
Definition: TreeValue.hpp:73
openfluid::core::TreeValue::clone
Value * clone() const override
Definition: TreeValue.hpp:96
openfluid::core::TreeValue
Definition: TreeValue.hpp:65
Tree.hpp
dllexport.hpp
openfluid::core::TreeValue::getType
Type getType() const override
Definition: TreeValue.hpp:91