SEXP dataframe_to_list(SEXP _source, SEXP _nrow, SEXP _ncol, SEXP _dest){
	Rcpp::DataFrame source = Rcpp::DataFrame(_source);
	Rcpp::GenericVector dest = Rcpp::GenericVector(_dest);
	int nrow = Rcpp::as<int>(_nrow);
	int ncol = Rcpp::as<int>(_ncol);	
	for (int j = 0; j < ncol; j ++){
		Rcpp::RObject robj = source[j];
		switch(robj.sexp_type()) {
			case RAWSXP: {
				Rcpp::RawVector z = source[j]; 
				for (int i = 0; i < nrow; i ++) {
					Rcpp::List l = dest[i];
					l[j] = Rcpp::wrap(z[i]);}}
			break;
			case STRSXP: {
				Rcpp::CharacterVector z = source[j]; 
				for (int i = 0; i < nrow; i ++) {
					Rcpp::List l = dest[i];
					l[j] = Rcpp::wrap(z[i]);}}
			break;
			case LGLSXP: {
				Rcpp::LogicalVector z = source[j]; 
				for (int i = 0; i < nrow; i ++) {
					Rcpp::List l = dest[i];
					l[j] = Rcpp::wrap(z[i]);}}
			break;
			case REALSXP: {
				Rcpp::NumericVector z = source[j]; 
				for (int i = 0; i < nrow; i ++) {
					Rcpp::List l = dest[i];
					l[j] = Rcpp::wrap(z[i]);}}
			break;
			case INTSXP: {
				Rcpp::IntegerVector z = source[j]; 
				for (int i = 0; i < nrow; i ++) {
					Rcpp::List l = dest[i];
					l[j] = Rcpp::wrap(z[i]);}}
			break;
			default: {
				throw UnsupportedType(robj.sexp_type());}}}
	return Rcpp::wrap(_dest);}
Example #2
0
TEST(BasicDaemon, UnsupportedTypeDelay)
{
  usrsocktest_daemon_config = usrsocktest_daemon_defconf;
  usrsocktest_daemon_config.delay_all_responses = true;
  UnsupportedType(&usrsocktest_daemon_config);
}
Example #3
0
TEST(BasicDaemon, UnsupportedType)
{
  usrsocktest_daemon_config = usrsocktest_daemon_defconf;
  UnsupportedType(&usrsocktest_daemon_config);
}