Home
Install
Use
Develop
Support
News
Credits
hosted by
|
11#ifndef __MEAL_Factory_H
12#define __MEAL_Factory_H
22 T* load ( const std::string& filename,
23 Functor< T*(std::string) >& constructor,
26 std::ifstream input (filename.c_str());
28 throw Error (FailedSys, "Factory::load", "ifstream (" + filename + ")");
36 std::getline (input, line);
37 line = stringtok (line, "#\n", false);
45 std::string key = stringtok (line, WHITESPACE);
48 std::cerr << "Factory::load construct new " << key << std::endl;
50 instance = constructor (key);
57 std::cerr << "Factory::load parse line '" << line << "'" << std::endl;
59 instance->parse (line);
64 throw Error (InvalidParam, "Factory::load", "nothing constructed from '" + filename + "'");
Generated using doxygen 1.14.0
|