9 #include <boost/archive/text_iarchive.hpp>
13 template <
class T
object,
class Tfilename>
14 bool load(Tobject&
object, Tfilename filename)
19 std::cerr <<
"Error: trying to restore an object from a nameless file" << std::endl;
23 std::ifstream ifs (filename);
27 std::cout << __PRETTY_FUNCTION__ <<
"loading object from file '" << filename <<
"'" << std::endl;
28 boost::archive::text_iarchive ia(ifs);
34 std::cerr << __PRETTY_FUNCTION__ <<
" Error loading object from file '" << filename <<
"'" << std::endl;
40 template <
class T
object,
class Tfilename>
41 bool load(Tobject*
object, Tfilename& filename)
43 return (
load (*
object, filename));
46 template <
class T
object>
47 bool load(Tobject*
object,
const char* filename)
49 return (
load (*
object, std::string(filename)));
bool load(Tobject &object, Tfilename filename)
Definition: load.h:14