Loading...
Searching...
No Matches
shiftModel.h
Go to the documentation of this file.
// -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: shiftModel.h,v 1.17 2005/12/23 17:01:56 amoll Exp $
//
#ifndef BALL_NMR_SHIFTMODEL_H
#define BALL_NMR_SHIFTMODEL_H
#ifndef BALL_NMR_SHIFTMODULE_H
# include <BALL/NMR/shiftModule.h>
#endif
#ifndef BALL_DATATYPE_OPTIONS_H
# include <BALL/DATATYPE/options.h>
#endif
#ifndef BALL_FORMAT_PARAMETERS_H
# include <BALL/FORMAT/parameters.h>
#endif
namespace BALL
{
class BALL_EXPORT ShiftModel
: public ShiftModule
{
public:
BALL_CREATE(ShiftModel)
typedef std::list<ShiftModule*> ModuleList;
typedef void * (*CreateMethod) ();
typedef StringHashMap<CreateMethod> CreateMethodMap;
static const char* MODULE_LIST_SECTION;
ShiftModel();
ShiftModel(const String& filename);
ShiftModel(const ShiftModel& model);
virtual ~ShiftModel();
void clear();
Parameters& getParameters();
ModuleList& getModuleList();
void setFilename(const String& filename);
const String& getFilename() const;
void registerModule(const String& name, CreateMethod method);
void unregisterModule(const String& name) ;
bool isValid() const;
bool isRegistered(const String& name) const;
const ShiftModel& operator = (const ShiftModel& model);
const ShiftModel& operator = (const String& filename);
Options options;
bool start();
bool finish();
Processor::Result operator () (Composite& composite);
protected:
/*_ Initialize the model from the parameter file.
This method assumes that object has a valid parameter file assigned.
It sets {\tt valid_} to <b> true </b> if it could create a shift model
from the contents of the parameter file.
@throws BALL::Exception::FileNotFound
*/
bool init_();
/*_ Create a ShiftModule from a symbolic name.
This method create a shift module from the symbolic
name if this name is contained in the hash map \Ref{registered_modules_}.
*/
ShiftModule* createModule_(const String& type, const String& name) const;
/*_ Register the standard modules.
*/
void registerStandardModules_();
/*_ The parameters object
*/
Parameters parameters_;
/*_ The list of shift modules of this model
*/
ModuleList modules_;
/*_ A hash map containing all registered module types and their creation methods.
*/
CreateMethodMap registered_modules_;
/*_ The validity flag.
Set to <b> true </b> if the object was initialized correctly.
*/
bool valid_;
};
} // namespace BALL
#endif // BALL_NMR_SHIFTMODEL_H
BALL_EXPORT
#define BALL_EXPORT
Definition COMMON/global.h:50
BALL::Composite
Definition composite.h:74
BALL::Options
Definition options.h:48
BALL::Parameters
Definition parameters.h:25
BALL::Processor
Definition processor.h:32
BALL::Result
Definition result.h:22
BALL::ShiftModel::parameters_
Parameters parameters_
Definition shiftModel.h:201
BALL::ShiftModel::valid_
bool valid_
Definition shiftModel.h:214
BALL::ShiftModel::createModule_
ShiftModule * createModule_(const String &type, const String &name) const
BALL::ShiftModel::ModuleList
std::list< ShiftModule * > ModuleList
Definition shiftModel.h:45
BALL::ShiftModel::clear
void clear()
BALL::ShiftModel::isRegistered
bool isRegistered(const String &name) const
BALL::ShiftModel::CreateMethodMap
StringHashMap< CreateMethod > CreateMethodMap
Definition shiftModel.h:57
BALL::ShiftModel::finish
bool finish()
BALL::ShiftModel::MODULE_LIST_SECTION
static const char * MODULE_LIST_SECTION
Definition shiftModel.h:66
BALL::ShiftModel::registerStandardModules_
void registerStandardModules_()
BALL::ShiftModel::getModuleList
ModuleList & getModuleList()
BALL::ShiftModel::setFilename
void setFilename(const String &filename)
BALL::ShiftModel::modules_
ModuleList modules_
Definition shiftModel.h:205
BALL::ShiftModel::CreateMethod
void *(* CreateMethod)()
Definition shiftModel.h:51
BALL::ShiftModel::options
Options options
Definition shiftModel.h:159
BALL::ShiftModel::start
bool start()
BALL::ShiftModel::getParameters
Parameters & getParameters()
BALL::ShiftModel::ShiftModel
ShiftModel()
BALL::ShiftModel::registerModule
void registerModule(const String &name, CreateMethod method)
BALL::ShiftModel::unregisterModule
void unregisterModule(const String &name)
BALL::ShiftModel::registered_modules_
CreateMethodMap registered_modules_
Definition shiftModel.h:209
BALL::ShiftModel::getFilename
const String & getFilename() const
BALL::ShiftModel::isValid
bool isValid() const
BALL::ShiftModel::init_
bool init_()
BALL::ShiftModule::ShiftModule
ShiftModule()
BALL::StringHashMap
Definition stringHashMap.h:42
BALL::String
Definition string.h:57
BALL_CREATE
#define BALL_CREATE(name)
Definition create.h:62
BALL
Definition constants.h:13
std
STL namespace.
options.h
parameters.h
shiftModule.h