2 #include <boost/foreach.hpp> 12 void Output::pass_to_write_t(
const std::string& Dataset_name, boost::any* D)
14 typedef typename boost::function<T ()> T2;
15 if(boost::any_cast<T2>(D)) {
16 T2* t = boost::any_cast<T2>(D);
17 write_data(Dataset_name, (*t)());
25 void Output::pass_to_write(
const std::string& Dataset_name, boost::any* D)
32 pass_to_write_t<int>(Dataset_name, D);
33 pass_to_write_t<std::string>(Dataset_name, D);
34 pass_to_write_t<const char*>(Dataset_name, D);
35 pass_to_write_t<int64_t>(Dataset_name, D);
36 pass_to_write_t<double>(Dataset_name, D);
38 pass_to_write_t<Array<int, 1> >(Dataset_name, D);
39 pass_to_write_t<Array<std::string, 1> >(Dataset_name, D);
40 pass_to_write_t<Array<const char*, 1> >(Dataset_name, D);
41 pass_to_write_t<Array<double, 1> >(Dataset_name, D);
43 pass_to_write_t<Array<int, 2> >(Dataset_name, D);
44 pass_to_write_t<Array<std::string, 2> >(Dataset_name, D);
45 pass_to_write_t<Array<const char*, 2> >(Dataset_name, D);
46 pass_to_write_t<Array<double, 2> >(Dataset_name, D);
48 pass_to_write_t<Array<int, 3> >(Dataset_name, D);
49 pass_to_write_t<Array<std::string, 3> >(Dataset_name, D);
50 pass_to_write_t<Array<const char*, 3> >(Dataset_name, D);
51 pass_to_write_t<Array<double, 3> >(Dataset_name, D);
66 typedef std::map<std::string, boost::any>::value_type vtype;
67 BOOST_FOREACH(vtype&
p, func)
68 pass_to_write(p.first, &p.second);
72 end_because_of_error();
90 typedef std::map<std::string, boost::any>::value_type vtype;
91 BOOST_FOREACH(vtype&
p, func)
93 pass_to_write(p.first, &p.second);
void write_best_attempt()
Write out the file, making a best attempt but ignoring all errors.
Apply value function to a blitz array.
Contains classes to abstract away details in various Spurr Radiative Transfer software.
void write()
Write out file.