BALL
1.5.0
include
BALL
FORMAT
parameterSection.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
// $Id: parameterSection.h,v 1.25 2005/12/23 17:01:46 amoll Exp $
5
//
6
7
// Format: general parameter section class
8
9
#ifndef BALL_FORMAT_PARAMETERSECTION_H
10
#define BALL_FORMAT_PARAMETERSECTION_H
11
12
#ifndef BALL_DATATYPE_OPTIONS_H
13
# include <
BALL/DATATYPE/options.h
>
14
#endif
15
16
namespace
BALL
17
{
18
class
Parameters;
19
39
class
BALL_EXPORT
ParameterSection
40
{
41
public
:
42
43
BALL_CREATE
(
ParameterSection
)
44
45
46
48
static const
String
UNDEFINED;
49
50
54
56
enum
57
{
58
MAX_FIELDS = 20
59
};
60
62
66
69
ParameterSection
() ;
70
73
ParameterSection
(
const
ParameterSection
& parameter_section) ;
74
77
virtual
~
ParameterSection
() ;
78
80
83
92
bool
extractSection(
Parameters
& parameters,
const
String
& section_name)
93
;
94
99
const
String
& getSectionName()
const
100
;
101
106
const
String
& getValue(
const
String
& key,
const
String
& variable)
const
107
;
108
117
bool
has(
const
String
& key,
const
String
& variable)
const
;
118
123
bool
has(
const
String
& key)
const
;
124
127
bool
hasVariable(
const
String
& variable)
const
;
128
133
Position
getColumnIndex(
const
String
& variable)
const
;
134
137
Size
getNumberOfVariables()
const
;
138
141
Size
getNumberOfKeys()
const
;
142
146
const
String
& getValue(
Position
key_index,
Position
variable_index)
147
const
;
148
153
const
String
& getKey(
Position
key_index)
const
;
154
156
159
162
virtual
void
clear()
163
;
164
167
const
ParameterSection
& operator = (
const
ParameterSection
& section)
168
;
169
171
174
177
virtual
bool
isValid()
const
;
178
181
bool
operator ==
(
const
ParameterSection
& parameter_section)
const
182
;
183
185
188
193
Options
options
;
194
196
197
protected
:
198
199
/*_ The name of the section.
200
*/
201
String
section_name_
;
202
203
/*_ The format line.
204
*/
205
String
format_line_
;
206
207
/*_ String hash map containing an index for each key.
208
This index is the index for the entries_ array.
209
*/
210
StringHashMap<Index>
section_entries_
;
211
212
/*_ String has map relating a variable name to the index in entries_.
213
*/
214
StringHashMap<Index>
variable_names_
;
215
216
/*_ One-dimensional array of the values read from the section.
217
The index of a specific value is calculated as
218
section_entries_[key] * number_of_variables_ * variable_names_[name]
219
*/
220
std::vector<String>
entries_
;
221
222
/*_ One-dimensional array of the keys read from the section.
223
*/
224
std::vector<String>
keys_
;
225
226
/*_ The number of variables specified in the format line.
227
Variables also include "ver:" entries.
228
*/
229
Size
number_of_variables_
;
230
231
/*_ The version numbers of each key.
232
*/
233
std::vector<float>
version_
;
234
235
/*_ The valid flag.
236
*/
237
bool
valid_
;
238
239
};
240
}
// namespace BALL
241
242
#endif // BALL_FORMAT_PARAMETERSECTION_H
BALL::ParameterSection::keys_
std::vector< String > keys_
Definition:
parameterSection.h:224
BALL::Parameters
Definition:
parameters.h:24
BALL::ParameterSection::section_entries_
StringHashMap< Index > section_entries_
Definition:
parameterSection.h:210
BALL::Options
Definition:
options.h:46
BALL::ParameterSection::options
Options options
Definition:
parameterSection.h:193
BALL::ParameterSection::number_of_variables_
Size number_of_variables_
Definition:
parameterSection.h:229
BALL::String
Definition:
string.h:56
BALL
Definition:
constants.h:12
options.h
BALL::StringHashMap
Definition:
stringHashMap.h:40
BALL_SIZE_TYPE
BALL::ParameterSection::format_line_
String format_line_
Definition:
parameterSection.h:205
BALL::ParameterSection::entries_
std::vector< String > entries_
Definition:
parameterSection.h:220
BALL::operator==
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL::ParameterSection
Definition:
parameterSection.h:39
BALL::ParameterSection::variable_names_
StringHashMap< Index > variable_names_
Definition:
parameterSection.h:214
BALL::ParameterSection::version_
std::vector< float > version_
Definition:
parameterSection.h:233
BALL::ParameterSection::valid_
bool valid_
Definition:
parameterSection.h:237
BALL_CREATE
#define BALL_CREATE(name)
Definition:
create.h:62
BALL_EXPORT
#define BALL_EXPORT
Definition:
COMMON/global.h:50
BALL::ParameterSection::section_name_
String section_name_
Definition:
parameterSection.h:201
Generated by
1.8.17