imc_conversion.hpp: more comprehensive error message, imc_datatype: imc_Ulongint,imc_Slongint typedef for x86_64 vs. arm
This commit is contained in:
parent
2b2e69f0e5
commit
798fc22d7a
@ -17,7 +17,11 @@ namespace imc
|
|||||||
// check number of elements of type "datatype" in buffer
|
// check number of elements of type "datatype" in buffer
|
||||||
if ( subbuffer.size() != channel.size()*sizeof(datatype) )
|
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
|
// extract every single number of type "datatype" from buffer
|
||||||
@ -36,6 +40,8 @@ namespace imc
|
|||||||
// save number in channel
|
// save number in channel
|
||||||
channel[i] = df;
|
channel[i] = df;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// for ( auto el: channel ) std::cout<<el<<"\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -10,12 +10,22 @@ namespace imc
|
|||||||
// map datatype to machine's datatypes
|
// map datatype to machine's datatypes
|
||||||
typedef unsigned char imc_Ubyte;
|
typedef unsigned char imc_Ubyte;
|
||||||
typedef signed char imc_Sbyte;
|
typedef signed char imc_Sbyte;
|
||||||
|
//
|
||||||
typedef unsigned short imc_Ushort;
|
typedef unsigned short imc_Ushort;
|
||||||
typedef signed short imc_Sshort;
|
typedef signed short imc_Sshort;
|
||||||
|
//
|
||||||
|
// e.g. ARM Cortex-A72 armv7l gcc version 10.2.0 (Ubuntu 10.2.0-13ubuntu1)
|
||||||
|
// #ifdef __arm__
|
||||||
typedef unsigned long int imc_Ulongint;
|
typedef unsigned long int imc_Ulongint;
|
||||||
typedef signed long int imc_Slongint;
|
typedef signed long int imc_Slongint;
|
||||||
|
// e.g. Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz x86_64 gcc version 10.2.0 (Ubuntu 10.2.0-13ubuntu1)
|
||||||
|
// #ifdef i386 __i386 __i386__
|
||||||
|
// typedef unsigned int imc_Ulongint;
|
||||||
|
// typedef signed int imc_Slongint;
|
||||||
|
//
|
||||||
typedef float imc_float;
|
typedef float imc_float;
|
||||||
typedef double imc_double;
|
typedef double imc_double;
|
||||||
|
//
|
||||||
// TODO not all remaining types are supported yet
|
// TODO not all remaining types are supported yet
|
||||||
// typedef <whatever that is ->... > "imc Devices Transitional Recording"
|
// typedef <whatever that is ->... > "imc Devices Transitional Recording"
|
||||||
// typedf <sometimestamptype> "Timestamp Ascii"
|
// typedf <sometimestamptype> "Timestamp Ascii"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user