plugins_manager.h 1.75 KB
Newer Older
1
#pragma once
2 3 4 5

#include <map>
#include <string>

6
#include "args.h"
7 8 9 10
#include "function.h"
#include "data.h"
#include "fitter.h"
#include "args.h"
11
#include "clustering.h"
12
#include "ptr.h"
13

14 15 16 17 18
/*! \brief This class handles the loading of plugins and insure that they can
 *  talk to each others through coordinates transforms.
 *
 *  \details
 */
19 20 21 22
class plugins_manager
{
	public: //functions

Laurent Belcour's avatar
Laurent Belcour committed
23 24
		//! \brief get an instance of the function that is defined in the plugin with
		//! filename n. Return null if no one exist.
25
		static function* get_function(const arguments& args) ;
26 27

		//! \brief load a function from the ALTA input file.
28
		static function* get_function(const std::string& filename);
29

Laurent Belcour's avatar
Laurent Belcour committed
30 31
		//! \brief get an instance of the data that is defined in the plugin with
		//! filename n. Return null if no one exist.
32
		static ptr<data> get_data(const std::string& n) ;
33

Laurent Belcour's avatar
Laurent Belcour committed
34 35
		//! \brief get an instance of the fitter that is defined in the plugin with
		//! filename n. Return null if no one exist.
36
		static ptr<fitter> get_fitter(const std::string& n) ;
Laurent Belcour's avatar
Laurent Belcour committed
37 38 39 40 41 42


		//! \brief check if a data object and a function object are compatibles.
		//! this has to be done before fitting to ensure that the
		//! parametrizations spaces are the same.
		//! \todo specify an output parametrization for the function ?
43
		static void check_compatibility(ptr<data>& d, const ptr<function>& f,
Laurent Belcour's avatar
Laurent Belcour committed
44 45
				const arguments& args) ;

46

47
		//! \brief Provide a measure of how much memory there is on the system.
48 49
		//! \details It permits to know is one can allocate more memory for a fitting
		//! procedure for example.
50
		static size_t get_system_memory() ;
51

52 53
	private: //data

54 55 56 57
		// Object provider prototypes
		typedef function* (*FunctionPrototype)();
		typedef fitter*   (*FitterPrototype)();
		typedef data*     (*DataPrototype)();
58
} ;