0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Namespaces | Functions
Serialization.h File Reference

Functions to serialize/deserialize primitives to/from a memory buffer. More...

#include "InetAddr.h"
#include "serialization-c.h"
Include dependency graph for Serialization.h:

Go to the source code of this file.

Namespaces

 Hypertable
 Hypertable definitions
 
 Hypertable::Serialization
 

Functions

void Hypertable::Serialization::encode_i8 (uint8_t **bufp, uint8_t val)
 Encodes a byte into the given buffer. More...
 
uint8_t Hypertable::Serialization::decode_i8 (const uint8_t **bufp, size_t *remainp)
 Decode a 8-bit integer (a byte/character) More...
 
uint8_t Hypertable::Serialization::decode_byte (const uint8_t **bufp, size_t *remainp)
 Decodes a single byte from the given buffer. More...
 
void Hypertable::Serialization::encode_bool (uint8_t **bufp, bool bval)
 Encodes a boolean into the given buffer. More...
 
bool Hypertable::Serialization::decode_bool (const uint8_t **bufp, size_t *remainp)
 Decodes a boolean value from the given buffer. More...
 
void Hypertable::Serialization::encode_i16 (uint8_t **bufp, uint16_t val)
 Encode a 16-bit integer in little-endian order. More...
 
uint16_t Hypertable::Serialization::decode_i16 (const uint8_t **bufp, size_t *remainp)
 Decode a 16-bit integer in little-endian order. More...
 
void Hypertable::Serialization::encode_i32 (uint8_t **bufp, uint32_t val)
 Encode a 32-bit integer in little-endian order. More...
 
uint32_t Hypertable::Serialization::decode_i32 (const uint8_t **bufp, size_t *remainp)
 Decode a 32-bit integer in little-endian order. More...
 
void Hypertable::Serialization::encode_i64 (uint8_t **bufp, uint64_t val)
 Encode a 64-bit integer in little-endian order. More...
 
uint64_t Hypertable::Serialization::decode_i64 (const uint8_t **bufp, size_t *remainp)
 Decode a 64-bit integer in little-endian order. More...
 
int Hypertable::Serialization::encoded_length_vi32 (uint32_t val)
 Length of a variable length encoded 32-bit integer (up to 5 bytes) More...
 
int Hypertable::Serialization::encoded_length_vi64 (uint64_t val)
 Length of a variable length encoded 64-bit integer (up to 9 bytes) More...
 
void Hypertable::Serialization::encode_vi32 (uint8_t **bufp, uint32_t val)
 Encode a integer (up to 32-bit) in variable length encoding. More...
 
void Hypertable::Serialization::encode_vi64 (uint8_t **bufp, uint64_t val)
 Encode a integer (up to 64-bit) in variable length encoding. More...
 
uint32_t Hypertable::Serialization::decode_vi32 (const uint8_t **bufp, size_t *remainp)
 Decode a variable length encoded integer up to 32-bit. More...
 
uint64_t Hypertable::Serialization::decode_vi64 (const uint8_t **bufp, size_t *remainp)
 Decode a variable length encoded integer up to 64-bit. More...
 
uint32_t Hypertable::Serialization::decode_vi32 (const uint8_t **bufp)
 Decode a variable length encoded integer up to 32-bit. More...
 
uint64_t Hypertable::Serialization::decode_vi64 (const uint8_t **bufp)
 Decode a variable length encoded integer up to 64-bit. More...
 
size_t Hypertable::Serialization::encoded_length_bytes32 (int32_t len)
 Computes the encoded length of a 32-bit length byte array (i32, bytes) More...
 
void Hypertable::Serialization::encode_bytes32 (uint8_t **bufp, const void *data, int32_t len)
 Encodes a variable sized byte array into the given buffer. More...
 
uint8_t * Hypertable::Serialization::decode_bytes32 (const uint8_t **bufp, size_t *remainp, uint32_t *lenp)
 Decodes a variable sized byte array from the given buffer. More...
 
size_t Hypertable::Serialization::encoded_length_str16 (const char *str)
 Computes the encoded length of a string16 encoding. More...
 
size_t Hypertable::Serialization::encoded_length_str16 (const String &str)
 Computes the encoded length of a String. More...
 
void Hypertable::Serialization::encode_str16 (uint8_t **bufp, const void *str, uint16_t len)
 Encodes a string buffer into the given buffer. More...
 
void Hypertable::Serialization::encode_str16 (uint8_t **bufp, const char *str)
 Encodes a c-style null-terminated string into the given buffer. More...
 
template<class StringT >
void Hypertable::Serialization::encode_str16 (uint8_t **bufp, const StringT &str)
 Encodes a string into the given buffer. More...
 
const char * Hypertable::Serialization::decode_str16 (const uint8_t **bufp, size_t *remainp)
 Decodes a c-style string from the given buffer. More...
 
char * Hypertable::Serialization::decode_str16 (const uint8_t **bufp, size_t *remainp, uint16_t *lenp)
 Decodes a c-style string from the given buffer. More...
 
size_t Hypertable::Serialization::encoded_length_vstr (size_t len)
 Computes the encoded length of vstr (vint64, data, null) More...
 
size_t Hypertable::Serialization::encoded_length_vstr (const char *s)
 Computes the encoded length of vstr. More...
 
size_t Hypertable::Serialization::encoded_length_vstr (const String &s)
 Computes the encoded length of vstr. More...
 
void Hypertable::Serialization::encode_vstr (uint8_t **bufp, const void *buf, size_t len)
 Encode a buffer as variable length string (vint64, data, null) More...
 
void Hypertable::Serialization::encode_vstr (uint8_t **bufp, const char *s)
 Encode a c-style string as vstr. More...
 
template<class StringT >
void Hypertable::Serialization::encode_vstr (uint8_t **bufp, const StringT &s)
 Encode a String as vstr. More...
 
char * Hypertable::Serialization::decode_vstr (const uint8_t **bufp, size_t *remainp)
 Decode a vstr (vint64, data, null). More...
 
char * Hypertable::Serialization::decode_vstr (const uint8_t **bufp, size_t *remainp, uint32_t *lenp)
 Decode a vstr (vint64, data, null) More...
 
void Hypertable::Serialization::encode_inet_addr (uint8_t **bufp, const InetAddr &addr)
 Encode an InetAddr structure. More...
 
InetAddr Hypertable::Serialization::decode_inet_addr (const uint8_t **bufp, size_t *remainp)
 Decode an InetAddr structure. More...
 
void Hypertable::Serialization::encode_double (uint8_t **bufp, double val)
 Encodes a double with 18 decimal digits of precision as 64-bit left-of-decimal, followed by 64-bit right-of-decimal, both in little-endian order. More...
 
double Hypertable::Serialization::decode_double (const uint8_t **bufp, size_t *remainp)
 Decodes a double as 64-bit left-of-decimal, followed by 64-bit right-of-decimal, both in little-endian order. More...
 
int Hypertable::Serialization::encoded_length_double ()
 Length of an encoded double (16 bytes) More...
 
bool Hypertable::Serialization::equal (double a, double b)
 Compare doubles that may have been serialized and unserialized. More...
 

Detailed Description

Functions to serialize/deserialize primitives to/from a memory buffer.

These functions are used to implement Hypertable's network protocol.

Definition in file Serialization.h.