Bond
 
Loading...
Searching...
No Matches
bond Namespace Reference

namespace bond More...

Namespaces

namespace  reflection
 

Classes

class  blob
 Memory blob. More...
 
class  bonded
 Represents data for a struct T known at compile-time. More...
 
class  bonded< void, Reader >
 Untyped specialization of bonded<T>, used for dynamic binding (i.e. schema known at runtime) More...
 
class  CompactBinaryReader
 Reader for Compact Binary Protocol. More...
 
class  CompactBinaryWriter
 Writer for Compact Binary Protocol. More...
 
struct  CoreException
 Exception used to indicate an error during serialization or deserialization. More...
 
struct  DeserializingTransform
 Base class for deserializing transforms. More...
 
class  Exception
 Base type for all Bond exceptions. More...
 
class  FastBinaryReader
 Reader for Fast Binary protocol. More...
 
class  FastBinaryWriter
 Writer for Fast Binary protocol. More...
 
class  InputBuffer
 Memory backed input stream. More...
 
class  maybe< T, typename boost::disable_if< detail::has_allocator< T > >::type >
 Type used for fields with default values of nothing. More...
 
class  maybe< T, typename boost::enable_if< detail::has_allocator< T > >::type >
 Type used for fields with default values of nothing. More...
 
struct  ModifyingTransform
 Base class for transforms which modify a Bond type instance. More...
 
class  nullable< T, typename boost::disable_if< detail::use_value< T > >::type >
 Nullable type. More...
 
class  OutputMemoryStream
 Memory backed output stream. More...
 
class  RuntimeSchema
 Represents runtime schema See User's Manual More...
 
struct  SerializingTransform
 Base class for serializing transforms. More...
 
class  SimpleBinaryReader
 Reader for Simple Binary protocol. More...
 
class  SimpleBinaryWriter
 Writer for Simple Binary protocol. More...
 
class  SimpleJsonReader
 Reader for Simple JSON. More...
 
class  SimpleJsonWriter
 Writer for Simple JSON. More...
 
class  value< T, Reader, typename boost::enable_if_c< is_basic_type< T >::value &&!is_type_alias< T >::value >::type >
 Represents value of type T serialized using protocol Reader. More...
 

Typedefs

typedef OutputMemoryStream OutputBuffer
 Type alias for memory backed output stream using std::allocator. More...
 

Detailed Description

namespace bond

Typedef Documentation

◆ OutputBuffer

Type alias for memory backed output stream using std::allocator.

Function Documentation

◆ Apply() [1/2]

template<typename T , typename Transform >
bool bond::Apply ( const Transform &  transform)

Apply transform to compile-time schema.

◆ Apply() [2/2]

template<typename Transform >
bool bond::Apply ( const Transform &  transform,
const RuntimeSchema schema 
)

Apply transform to runtime schema.

◆ blob_prolong()

template<typename A >
blob bond::blob_prolong ( blob  src,
const A &  allocator 
)

Returns a blob with a copy of the data if the original one does not own the memory (i.e. constructed using raw memory), and the same blob otherwise.

◆ Deserialize() [1/4]

template<typename T , typename Protocols = BuiltInProtocols, typename Reader >
T bond::Deserialize ( Reader  input)

Deserialize an object of type T from a protocol reader.

◆ Deserialize() [2/4]

template<typename T , typename Protocols = BuiltInProtocols, typename Reader >
T bond::Deserialize ( Reader  input,
const RuntimeSchema schema 
)

Deserialize an object of type T from a protocol reader using runtime schema.

◆ Deserialize() [3/4]

template<typename Protocols = BuiltInProtocols, typename Reader , typename T >
void bond::Deserialize ( Reader  input,
T &  obj 
)

Deserialize an object from a protocol reader.

◆ Deserialize() [4/4]

template<typename Protocols = BuiltInProtocols, typename Reader , typename T >
void bond::Deserialize ( Reader  input,
T &  obj,
const RuntimeSchema schema 
)

Deserialize an object from a protocol reader using runtime schema.

◆ GetEnumNames()

template<typename T , typename Map = std::map<std::string, T>>
const Map & bond::GetEnumNames ( )

Returns a const reference to a map of names for a user defined enum.

◆ GetEnumValues()

template<typename T , typename Map = std::map<T, std::string>>
const Map & bond::GetEnumValues ( )

Returns a const reference to a map of values for a user defined enum.

◆ GetRuntimeSchema()

template<typename T >
RuntimeSchema bond::GetRuntimeSchema ( )

Returns an instance of RuntimeSchema for a user defined struct.

◆ Marshal()

template<typename Protocols , typename T , typename Writer >
void bond::Marshal ( const T &  obj,
Writer &  output 
)

Marshal an object using a protocol writer.

◆ Merge()

template<typename Protocols = BuiltInProtocols, typename T , typename Reader , typename Writer >
void bond::Merge ( const T &  obj,
Reader  input,
Writer &  output 
)

Merge an object with serialize data and write the result using a protocol writer.

◆ operator==() [1/8]

bool bond::operator== ( const Variant &  variant,
bool  value 
)

Compares variant for equality against the provided boolean value.

◆ operator==() [2/8]

bool bond::operator== ( const Variant &  variant,
const char *  value 
)

Compares variant for equality against the provided string value.

◆ operator==() [3/8]

bool bond::operator== ( const Variant &  variant,
const std::string &  value 
)

Compares variant for equality against the provided string value.

◆ operator==() [4/8]

bool bond::operator== ( const Variant &  variant,
const std::wstring &  value 
)

Compares variant for equality against the provided wide string value.

◆ operator==() [5/8]

bool bond::operator== ( const Variant &  variant,
const wchar_t *  value 
)

Compares variant for equality against the provided wide string value.

◆ operator==() [6/8]

bool bond::operator== ( const Variant &  variant,
double  value 
)

Compares variant for equality against the provided floating point value.

◆ operator==() [7/8]

template<typename SignedT >
boost::enable_if< is_signed_int_or_enum< SignedT >, bool >::type bond::operator== ( const Variant &  variant,
SignedT  value 
)

Compares variant for equality against the provided signed integer or enum value.

◆ operator==() [8/8]

template<typename UnsignedT >
boost::enable_if< std::is_unsigned< UnsignedT >, bool >::type bond::operator== ( const Variant &  variant,
UnsignedT  value 
)

Compares variant for equality against the provided unsigned integer value.

◆ Serialize()

template<typename Protocols = BuiltInProtocols, typename T , typename Writer >
void bond::Serialize ( const T &  obj,
Writer &  output 
)

Serialize an object using a protocol writer.

◆ swap() [1/2]

void bond::swap ( blob src,
blob dst 
)

Swap two blobs.

◆ swap() [2/2]

template<typename T >
void bond::swap ( maybe< T > &  x,
maybe< T > &  y 
)

Swap two maybes.

◆ Unmarshal() [1/6]

template<typename T , typename Protocols = BuiltInProtocols, typename Buffer >
T bond::Unmarshal ( Buffer  input)

Unmarshal an object of type T from data stream.

◆ Unmarshal() [2/6]

template<typename Protocols = BuiltInProtocols, typename Buffer , typename T >
void bond::Unmarshal ( Buffer  input,
bonded< T > &  obj 
)

Initialize a bonded<T> from data stream contained marshaled object.

◆ Unmarshal() [3/6]

template<typename Protocols = BuiltInProtocols, typename Buffer , typename T >
void bond::Unmarshal ( Buffer  input,
bonded< T > &  obj,
const RuntimeSchema schema 
)

Initialize a bonded<T> from data stream contained marshaled object using a runtime schema.

◆ Unmarshal() [4/6]

template<typename T , typename Protocols = BuiltInProtocols, typename Buffer >
T bond::Unmarshal ( Buffer  input,
const RuntimeSchema schema 
)

Unmarshal an object of type T from data stream using a runtime schema.

◆ Unmarshal() [5/6]

template<typename Protocols = BuiltInProtocols, typename Buffer , typename T >
void bond::Unmarshal ( Buffer  input,
T &  obj 
)

Unmarshal an object from data stream.

◆ Unmarshal() [6/6]

template<typename Protocols = BuiltInProtocols, typename Buffer , typename T >
void bond::Unmarshal ( Buffer  input,
T &  obj,
const RuntimeSchema schema 
)

Unmarshal an object from data stream using a runtime schema.

◆ Validate() [1/3]

template<typename Protocols = BuiltInProtocols>
bool bond::Validate ( const bonded< SchemaDef > &  src,
const RuntimeSchema dst 
)

Validate compatibility of schemas.

Parameters
srcSerialized source SchemaDef
dstDestination schema
Returns
'true' if schemas are wire-format equivalent, 'false' if schemas are different but payload in source schema can be deserialized as destination.
Exceptions
SchemaValidateExceptionif payload in source schema is incompatible with destination schema or the schema of source SchemaDef is unknown.

◆ Validate() [2/3]

template<typename Protocols = BuiltInProtocols>
bool bond::Validate ( const RuntimeSchema src,
const bonded< SchemaDef > &  dst 
)

Validate compatibility of schemas.

Parameters
srcSource schema
dstSerialized destination SchemaDef
Returns
'true' if schemas are wire-format equivalent, 'false' if schemas are different but payload in source schema can be deserialized as destination.
Exceptions
SchemaValidateExceptionif payload in source schema is incompatible with destination schema or the schema of destination SchemaDef is unknown.

◆ Validate() [3/3]

template<typename Protocols = BuiltInProtocols>
bool bond::Validate ( const RuntimeSchema src,
const RuntimeSchema dst 
)

Validate compatibility of schemas.

Parameters
srcSource schema
dstDestination schema
Returns
'true' if schemas are wire-format equivalent, 'false' if schemas are different but payload in source schema can be deserialized as destination.
Exceptions
SchemaValidateExceptionif payload in source schema is incompatible with destination schema.

◆ ValidateTwoWay()

template<typename Protocols = BuiltInProtocols, typename T1 , typename T2 >
bool bond::ValidateTwoWay ( const T1 &  s1,
const T2 &  s2 
)

Validate two-way compatibility of schemas.

Parameters
s1Schema to compare
s2Schema to compare
Returns
'true' if schemas are wire-format equivalent, 'false' if schemas are different but payload in source can be deserialized as destination, and vice versa.
Exceptions
SchemaValidateExceptionif payload in any one schema is incompatible with the other schema.