Information
We are currently investigating an issue with the editor of some pages. Please save your work and avoid to create new pages until this banner is gone.
What is the C++ size in the mapping for CORBA types?
A: The C++ size depends on the architecture and is not fixed in the specifications.
For example the CORBA type ULongLong
does not fit into a C++ unsigned long
on 32 bit systems.
Here it is mapped to unsigned long long
which is 8 bystes in size as CORBA::ULongLong
is. On 64-bit systems, it is mapped to unsigned long
because long is a 64-bit type there and not == int, which is a 32-bit type there.
The attached size_of.cpp small program prints the size of every relevant C++ and CORBA type size.
Compile it using this command line:
g++ -I$ACE_ROOT -I$ACE_ROOT/TAO -o size_of size_of.cpp
and attach the output here below if it is for an architecture not already listed.
sizeof(bool)=1 sizeof(char)=1 sizeof(short)=2 sizeof(int)=4 sizeof(long)=4 sizeof(long long)=8 sizeof(unsigned char)=1 sizeof(unsigned short)=2 sizeof(unsigned int)=4 sizeof(unsigned long)=4 sizeof(unsigned long long)=8 sizeof(float)=4 sizeof(double)=8 sizeof(long double)=12 sizeof(CORBA::Boolean)=1 sizeof(CORBA::Octet)=1 sizeof(CORBA::Char)=1 sizeof(CORBA::WChar)=4 sizeof(CORBA::Short)=2 sizeof(CORBA::UShort)=2 sizeof(CORBA::Long)=4 sizeof(CORBA::ULong)=4 sizeof(CORBA::LongLong)=8 sizeof(CORBA::ULongLong)=8 sizeof(CORBA::Float)=4 sizeof(CORBA::Double)=8 sizeof(CORBA::LongDouble)=16
Added for AIRUB, by courtesy of RolandLemke. -- ThomasJuerges - 10 Apr 2006
sizeof(bool)=1 sizeof(char)=1 sizeof(short)=2 sizeof(int)=4 sizeof(long)=8 sizeof(long long)=8 sizeof(unsigned char)=1 sizeof(unsigned short)=2 sizeof(unsigned int)=4 sizeof(unsigned long)=8 sizeof(unsigned long long)=8 sizeof(float)=4 sizeof(double)=8 sizeof(long double)=16 sizeof(CORBA::Boolean)=1 sizeof(CORBA::Octet)=1 sizeof(CORBA::Char)=1 sizeof(CORBA::WChar)=4 sizeof(CORBA::Short)=2 sizeof(CORBA::UShort)=2 sizeof(CORBA::Long)=4 sizeof(CORBA::ULong)=4 sizeof(CORBA::LongLong)=8 sizeof(CORBA::ULongLong)=8 sizeof(CORBA::Float)=4 sizeof(CORBA::Double)=8 sizeof(CORBA::LongDouble)=16
-- GianlucaChiozzi - 31 Mar 2006