Manual for OpenFLUID 2.1.11
core
Variables.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 Variables.hpp
35
36
@author Jean-Christophe Fabre <jean-christophe.fabre@inra.fr>
37
*/
38
39
40
#ifndef __OPENFLUID_CORE_VARIABLES_HPP__
41
#define __OPENFLUID_CORE_VARIABLES_HPP__
42
43
44
#include <
openfluid/dllexport.hpp
>
45
#include <openfluid/core/TypeDefs.hpp>
46
#include <
openfluid/core/ValuesBuffer.hpp
>
47
48
49
namespace
openfluid
{
namespace
core {
50
51
52
class
OPENFLUID_API
Variables
53
{
54
private
:
55
56
typedef
std::map<VariableName_t, std::pair<ValuesBuffer,Value::Type> > VariablesMap_t;
57
58
VariablesMap_t m_Data;
59
60
61
public
:
62
63
bool
createVariable(
const
VariableName_t
& aName);
64
65
bool
createVariable(
const
VariableName_t
& aName,
const
Value::Type
& aType);
66
67
bool
modifyValue(
const
VariableName_t
& aName,
const
TimeIndex_t
& anIndex,
const
Value
& aValue);
68
69
bool
modifyCurrentValue(
const
VariableName_t
& aName,
const
Value
& aValue);
70
71
bool
appendValue(
const
VariableName_t
& aName,
const
TimeIndex_t
& anIndex,
const
Value
& aValue);
72
73
bool
getValue(
const
VariableName_t
& aName,
const
TimeIndex_t
& anIndex,
Value
* aValue)
const
;
74
75
const
Value
* value(
const
VariableName_t
& aName,
const
TimeIndex_t
& anIndex)
const
;
76
77
const
Value
* currentValue(
const
VariableName_t
& aName)
const
;
78
79
bool
getCurrentValue(
const
VariableName_t
& aName,
Value
* aValue)
const
;
80
81
bool
getLatestIndexedValue(
const
VariableName_t
& aName,
IndexedValue
& IndValue)
const
;
82
83
bool
getLatestIndexedValues(
const
VariableName_t
& aName,
const
TimeIndex_t
& anIndex,
84
IndexedValueList
& IndValueList)
const
;
85
86
bool
getIndexedValues(
const
VariableName_t
& aName,
87
const
TimeIndex_t
& aBeginIndex,
const
TimeIndex_t
& anEndIndex,
88
IndexedValueList
& IndValueList)
const
;
89
90
bool
getCurrentValueIfIndex(
const
VariableName_t
& aName,
const
TimeIndex_t
& Index,
Value
* aValue)
const
;
91
92
Value
* currentValueIfIndex(
const
VariableName_t
& aName,
const
TimeIndex_t
& Index)
const
;
93
94
bool
isVariableExist(
const
VariableName_t
& aName)
const
;
95
96
bool
isVariableExist(
const
VariableName_t
& aName,
const
TimeIndex_t
& anIndex)
const
;
97
98
bool
isVariableExist(
const
VariableName_t
& aName,
const
TimeIndex_t
& anIndex,
99
Value::Type
ValueType)
const
;
100
101
bool
isTypedVariableExist(
const
VariableName_t
& aName,
const
Value::Type
& VarType)
const
;
102
103
bool
isTypedVariableExist(
const
VariableName_t
& aName,
104
const
TimeIndex_t
& anIndex,
const
Value::Type
& VarType)
const
;
105
106
std::vector<VariableName_t> getVariablesNames()
const
;
107
108
int
getVariableValuesCount(
const
VariableName_t
& aName)
const
;
109
110
bool
checkAllVariablesCount(
unsigned
int
Count,
VariableName_t
& ErrorVarName)
const
;
111
112
void
clear();
113
114
void
displayContent(
const
VariableName_t
& aName, std::ostream& OStream)
const
;
115
116
};
117
118
119
} }
// namespaces
120
121
122
#endif
/* __OPENFLUID_CORE_VARIABLES_HPP__ */
openfluid::core::Value
Definition:
Value.hpp:62
OPENFLUID_API
#define OPENFLUID_API
Definition:
dllexport.hpp:86
openfluid::core::TimeIndex_t
std::uint64_t TimeIndex_t
Definition:
TypeDefs.hpp:298
openfluid::core::Value::Type
Type
Definition:
Value.hpp:66
openfluid
Definition:
ApplicationException.hpp:47
openfluid::core::VariableName_t
std::string VariableName_t
Definition:
TypeDefs.hpp:131
ValuesBuffer.hpp
openfluid::core::IndexedValueList
std::list< IndexedValue > IndexedValueList
Definition:
IndexedValue.hpp:182
openfluid::core::Variables
Definition:
Variables.hpp:52
dllexport.hpp
openfluid::core::IndexedValue
Definition:
IndexedValue.hpp:63
Generated by
1.8.17