imc_conversion.hpp: more comprehensive error message, imc_datatype: imc_Ulongint,imc_Slongint typedef for x86_64 vs. arm

This commit is contained in:
2021-04-27 12:42:24 +02:00
parent 2b2e69f0e5
commit 798fc22d7a
2 changed files with 17 additions and 1 deletions

View File

@@ -17,7 +17,11 @@ namespace imc
// check number of elements of type "datatype" in buffer
if ( subbuffer.size() != channel.size()*sizeof(datatype) )
{
throw std::runtime_error("size mismatch between subbuffer and datatype");
throw std::runtime_error( std::string("size mismatch between subbuffer (")
+ std::to_string(subbuffer.size())
+ std::string(") and datatype (")
+ std::to_string(channel.size()) + std::string("*")
+ std::to_string(sizeof(datatype)) + std::string(")") );
}
// extract every single number of type "datatype" from buffer
@@ -36,6 +40,8 @@ namespace imc
// save number in channel
channel[i] = df;
}
// for ( auto el: channel ) std::cout<<el<<"\n";
}
}