{
if(a_type==s_aida_type((char)0)) {
char v;
if(!to<char>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<char>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((short)0)) {
short v;
if(!to<short>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<short>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((int)0)) {
int v;
if(!to<int>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<int>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((int64)0)) {
int64 v;
if(!to<int64>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<int64>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((float)0)) {
float v;
if(!to<float>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<float>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((double)0)) {
double v;
if(!to<double>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<double>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((unsigned char)0)) {
unsigned char v;
if(!to<unsigned char>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<unsigned char>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((unsigned short)0)) {
unsigned short v;
if(!to<unsigned short>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<unsigned short>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((unsigned int)0)) {
unsigned int v;
if(!to<unsigned int>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<unsigned int>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((uint64)0)) {
uint64 v;
if(!to<uint64>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<uint64>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((bool)true)) {
bool v;
if(!to(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<bool>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type(std::string())) {
if(!a_ntu.create_col<std::string>(a_name,a_s)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type((int64)0)) {
int64 v;
if(!to<int64>(a_s,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't convert def " << sout(a_s)
<< " to a " << a_type
<< std::endl;
return false;
}
if(!a_ntu.create_col<int64>(a_name,v)) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " can't create column of type " << sout(a_type)
<< std::endl;
return false;
}
} else if(a_type==s_aida_type_ituple()) {
if(!a_is_ntu) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " mismatch a_is_ntu/a_type."
<< std::endl;
return false;
}
if(a_s.empty()) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " empty booking string."
<< std::endl;
return false;
}
columns::finder f(a_ntu.out(),a_s);
if(!f.find_variables()) {
a_ntu.out() << "inlib::ntu::create_col :"
<< " find_variables() failed for " << sout(a_s) << "."
<< std::endl;
return false;
}
aida_col_ntu* col_ntu = new aida_col_ntu(a_ntu.out(),a_name);
base_ntu* sub_base_ntu = col_ntu->get_to_fill();
if(!sub_base_ntu) {delete col_ntu;return false;}
aida* sub_aida = inlib::cast<base_ntu,aida>(*sub_base_ntu);
if(!sub_aida) {delete col_ntu;return false;}
std::vector<value> vars = f.result();
if(!create_cols_from_vals(*sub_aida,vars)) {
columns::delete_columns(vars);
delete col_ntu;
return false;
}
columns::delete_columns(vars);
a_ntu.add_column(col_ntu);
} else {
a_ntu.out() << "inlib::ntu::create_col :"
<< " col type " << sout(a_type)
<< " not yet handled."
<< std::endl;
return false;
}
return true;
}