Implement "double" and "float" cql types.
This implementation doesn't touch serialization.hh (which should be
eventually removed) and rather follows the other examples in types.cc.
It is relatively ugly, because of all the cleverness of our "general"
byte swapping implementation actually works only for integer types, and
we need to get it to work for float/double as well.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Tomek points out that:
Origin calls org.apache.cassandra.utils.Hex#hexToBytes here, which is
not what to_bytes() does. BytesType.getSerializer().toString() calls
ByteBufferUtil.bytesToHex(value), so you should call to_hex() here.
Fix that up.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
In v2: rebase, and add a more descriptive exception if trying to deserialize
an ipv6 address.
Add to list of types the Internet address type, known as INET in CQL
or as InetAddressType in the Cassandra code.
I based this code on stuff I found in InetAddressType and
InetAddressSerializer in the Cassandra code.
Signed-off-by: Nadav Har'El <nyh@cloudius-systems.com>
Switch to sizeof in preparation for converting int32_type_impl into a
generic integer_type_impl.
Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>