BALL
1.5.0
include
BALL
NMR
shiftModel.h
Go to the documentation of this file.
1
// -*- Mode: C++; tab-width: 2; -*-
2
// vi: set ts=2:
3
//
4
// $Id: shiftModel.h,v 1.17 2005/12/23 17:01:56 amoll Exp $
5
//
6
7
#ifndef BALL_NMR_SHIFTMODEL_H
8
#define BALL_NMR_SHIFTMODEL_H
9
10
#ifndef BALL_NMR_SHIFTMODULE_H
11
# include <
BALL/NMR/shiftModule.h
>
12
#endif
13
14
#ifndef BALL_DATATYPE_OPTIONS_H
15
# include <
BALL/DATATYPE/options.h
>
16
#endif
17
18
#ifndef BALL_FORMAT_PARAMETERS_H
19
# include <
BALL/FORMAT/parameters.h
>
20
#endif
21
22
namespace
BALL
23
{
32
class
BALL_EXPORT
ShiftModel
33
:
public
ShiftModule
34
{
35
public
:
36
37
BALL_CREATE
(
ShiftModel
)
38
39
42
45
typedef std::list<
ShiftModule
*>
ModuleList
;
46
51
typedef
void
* (*
CreateMethod
) ();
52
57
typedef
StringHashMap
<
CreateMethod
>
CreateMethodMap
;
58
60
63
66
static const
char
* MODULE_LIST_SECTION;
67
69
72
75
ShiftModel
();
76
79
ShiftModel
(const
String
& filename);
80
83
ShiftModel
(const
ShiftModel
& model);
84
87
virtual ~
ShiftModel
();
88
93
void
clear();
94
96
99
102
Parameters
& getParameters();
103
106
ModuleList
& getModuleList();
107
111
void
setFilename(const
String
& filename);
112
115
const
String
& getFilename() const;
116
120
void
registerModule(const
String
& name,
CreateMethod
method);
121
124
void
unregisterModule(const
String
& name) ;
125
127
130
133
bool
isValid() const;
134
137
bool
isRegistered(const
String
& name) const;
138
140
143
146
const
ShiftModel
& operator = (const
ShiftModel
& model);
147
150
const
ShiftModel
& operator = (const
String
& filename);
151
153
156
159
Options
options;
160
162
165
168
bool
start();
169
172
bool
finish();
173
176
Processor
::
Result
operator () (
Composite
& composite);
178
179
protected:
180
181
/*_ Initialize the model from the parameter file.
182
This method assumes that object has a valid parameter file assigned.
183
It sets {\tt valid_} to <b> true </b> if it could create a shift model
184
from the contents of the parameter file.
185
@throws BALL::Exception::FileNotFound
186
*/
187
bool
init_();
188
189
/*_ Create a ShiftModule from a symbolic name.
190
This method create a shift module from the symbolic
191
name if this name is contained in the hash map \Ref{registered_modules_}.
192
*/
193
ShiftModule
* createModule_(const
String
& type, const
String
& name) const;
194
195
/*_ Register the standard modules.
196
*/
197
void
registerStandardModules_();
198
199
/*_ The parameters object
200
*/
201
Parameters
parameters_;
202
203
/*_ The list of shift modules of this model
204
*/
205
ModuleList
modules_;
206
207
/*_ A hash map containing all registered module types and their creation methods.
208
*/
209
CreateMethodMap
registered_modules_;
210
211
/*_ The validity flag.
212
Set to <b> true </b> if the object was initialized correctly.
213
*/
214
bool
valid_;
215
};
216
217
}
// namespace BALL
218
219
#endif // BALL_NMR_SHIFTMODEL_H
BALL::Parameters
Definition:
parameters.h:24
BALL::Options
Definition:
options.h:46
BALL::Processor
Definition:
processor.h:31
BALL::ShiftModule
Definition:
shiftModule.h:41
BALL::Result
Definition:
result.h:21
BALL::String
Definition:
string.h:56
BALL
Definition:
constants.h:12
BALL::ShiftModel
Definition:
shiftModel.h:32
shiftModule.h
options.h
BALL::QSAR::CreateMethod
Model *(* CreateMethod)(const QSARData &q)
Definition:
registry.h:20
BALL::StringHashMap
Definition:
stringHashMap.h:40
BALL::Composite
Definition:
composite.h:71
BALL::ShiftModel::ModuleList
std::list< ShiftModule * > ModuleList
Definition:
shiftModel.h:45
BALL_CREATE
#define BALL_CREATE(name)
Definition:
create.h:62
BALL_EXPORT
#define BALL_EXPORT
Definition:
COMMON/global.h:50
parameters.h
Generated by
1.8.17