Commit 020c9f07 authored by Laurent Belcour's avatar Laurent Belcour

Working version of the core lib

parent 357793df
...@@ -9,6 +9,6 @@ HEADERS = args.h \ ...@@ -9,6 +9,6 @@ HEADERS = args.h \
data.h \ data.h \
fitter.h \ fitter.h \
function.h \ function.h \
plugin_manager.h plugins_manager.h
SOURCES = plugin_manager.cpp SOURCES = plugins_manager.cpp
#include "plugin_manager.h" #include "plugins_manager.h"
#include <QCoreApplication> #include <QCoreApplication>
#include <QPluginLoader> #include <QPluginLoader>
...@@ -119,34 +119,34 @@ fitter* plugins_manager::get_fitter() const ...@@ -119,34 +119,34 @@ fitter* plugins_manager::get_fitter() const
// //
function* plugins_manager::get_function(const std::string& n) const function* plugins_manager::get_function(const std::string& n) const
{ {
if(_functions.empty()) if(_functions.count(n) == 0)
{ {
return NULL ; return NULL ;
} }
else else
{ {
return _functions.at(n)->second ; return _functions.at(n) ;
} }
} }
data* plugins_manager::get_data(const std::string& n) const data* plugins_manager::get_data(const std::string& n) const
{ {
if(_datas.empty()) if(_datas.count(n) == 0)
{ {
return NULL ; return NULL ;
} }
else else
{ {
return _datas.at(n)->second ; return _datas.at(n) ;
} }
} }
fitter* plugins_manager::get_fitter(const std::string& n) const fitter* plugins_manager::get_fitter(const std::string& n) const
{ {
if(_fitters.empty()) if(_fitters.count(n) == 0)
{ {
return NULL ; return NULL ;
} }
else else
{ {
return _fitters.at(n)->second ; return _fitters.at(n) ;
} }
} }
...@@ -105,7 +105,11 @@ int main(int argc, char** argv) ...@@ -105,7 +105,11 @@ int main(int argc, char** argv)
#else #else
plugins_manager manager(args) ; plugins_manager manager(args) ;
fitter* fit = manager.get_fitter() ; fitter* fit = manager.get_fitter(args["fitter"]) ;
if(fit == NULL)
{
fit = manager.get_fitter() ;
}
#endif #endif
if(! args.is_defined("input")) { if(! args.is_defined("input")) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment