Bond is a cross-platform framework for working with schematized data. It supports cross-language de/serialization and powerful generic mechanisms for efficiently manipulating data. Bond is broadly used at Microsoft in high scale services.
gbc
& compiler library: 0.11.0.0gbc
and Bond compiler libraryComparer
for associative containers.--alloc-ctors
is passed to
gbc
.--type-aliases
flag is passed to gbc
.std::scoped_allocator_adaptor
for strings and containers when a custom allocator is used and the
--scoped-alloc
flag is passed to gbc
.GetNameToValueMap
and GetValueToNameMap
.--export-attribute
to the ToString
,
FromString
, ToEnum
and FromEnum
functions.allocator_type
typedef for a struct when the
--allocator
option is passed to gbc
, instead of specializing
std::uses_allocator
.import
statements can now end with an optional semicolon.import
statements can now use a mix of forward and backslashes. Issue
#869
Comparer
have been removed
from the bond::maybe
and bond::nullable
types.bond::is_blob
and bond::is_nullable
traits have
been removed. The blob
and nullable
types are not customizable, so these
where never needed or used. The related functionality provided by
bond::get_list_sub_type_id
remains.bond::maybe<T>
to const T&
. To access a bond::maybe<T>
value, use one
of the bond::maybe<T>::value
functions.pointer
, const_pointer
, reference
and
const_reference
typedefs have been removed from bond::nullable<T>
.Allocator
(second) type parameter has be removed
from bond::nullable<T>
and now it is always deduced from T
.bond::capped_allocator
and related types have been
moved to the bond::ext
namespace and the "bond/ext" include directory.ClientCore
and ServiceCore
class templates and the
Client
and Service
convenience typedefs have all been replaced with
normal classes named Client
and Service
. The ThreadPool
type
parameter has been removed in favor of a simplified runtime representation
of a Scheduler
.Scheduler
concept and the bond::ext::gRPC::thread_pool
implementation now use operator()
instead of a schedule()
member
function.bond::ext::gRPC::server_core
class template and the
bond::ext::gRPC::server
convenience typedef have been replaced with the
normal class bond::ext::gRPC::server
.Client::Async*
functions now accept the
std::shared_ptr<grpc::ClientContext>
argument as the last parameter
instead of as the first. This makes is easier to omit this parameter when
no context customization is needed.bond::ext::gRPC::unary_call_result<Response>
(drops the
std::shared_ptr
). Also the unary_call_result
now exposes read-only
getters rather than fields. This simplified the type that clients need to
deal with.bond::ext::gRPC::wait_callback::arg_type
has been removed.client_callback.h
header file has been renamed to
unary_call_result.h
to align with its contents.bond::ext::gRPC::server_builder
has been replaced by the
bond::ext::gRPC::server::Start
factory function which now returns a
plain bond::ext::gRPC::server
object and accepts service instances
managed by std::unique_ptr
. This properly models the lifetime
requirements. Service implementations must now pass a Scheduler
to the
generated Service
base class which is no longer default constructible.bonded<T>
wrapper for input_type
and result_type
typedefs.bond::ext::gRPC::unary_call
no longer requires bonded<T>
wrapper
for request type.bond::ext::gRPC::unary_call::FinishWithError
has been renamed to
Finish
. Overloads that take a status can be used to signal an error.grpc::Status
second argument has been removed from
bond::ext::gRPC::unary_call::Finish
. gRPC does not support sending a
response with a non-OK status, so the payload was being droped anyway.bond::ext::gRPC::unary_call
, bond::ext::gRPC::shared_unary_call
and bond::ext::gRPC::unary_call_result
types to properly use void
and
bond::reflection::nothing
instead of the bond::Void
empty struct. Also
removed unnecessary functions from unary_call
and shared_unary_call
for those cases when they are not applicable (e.g. Finish
is not
available when return type is nothing
).bond::ext::gRPC::wait_callback
has been deprecated in favor of
additionally generated client functions that return std::future
.bond::MapTo<T>::Field
that failed to pass the Protocols
type parameter to bond::Apply
.bond::ext::gRPC::io_manager::shutdown
and
bond::ext::gRPC::io_manager::wait
are called concurrently.bond::ext::gRPC::unary_call
destruction.bond::bonded<T, Reader&>
.bond::value
to actually move the underlying reader.bond::blob_prolong
helper function that will return a
bond::blob
with a copied data if the original one does not own the memory.bond::OutputBuffer::GetBuffers
now can accept arbitrary STL-like
containers.bond::maybe<T>
has been overhauled.
T
even when a
maybe held nothing.noexcept
variants of bond::maybe<T>::value
.bond::maybe<T>::emplace
to construct a maybe's value in place.operator==(const bond::maybe<T>&, const T&)
and
operator==(const T&, const bond::maybe<T>&)
to compare directly to
instances of T
.ToString
, FromString
, ToEnum
and FromEnum
functions that were previously not exported from a DLL when the
--export-attribute
option was passed to gbc
. Issue
#861
bond::nullable<T, Alloc>
where it was not propagating an
allocator to T
when allocator_type
was not explicitly defined.bond::make_box
where const T&
was not handled correctly.bond::check_method
has been replaced with less restricting
expression SFINAE checks on supported compilers. Issue
#896
bond::ext::gRPC::io_manager
could cause a thread to join
itself.bond::ext::grpc
. The
previous namespace, bond::ext::gRPC
, continues to work..csproj
format is
used. This breaking change does not affect projects using the classic
.csproj
format. Any .NET Core projects that encounter the build error
"Duplicate BondCodegen items were included." and were explicitly listing
BondCodegen
items will either need to rely on implicit codegen or disable
all implicit inclusion. To set per-item
metadata, use the item update
syntax.
Issue #636
Bond.Attribute
can now be applied to methods. This fixes
broken codegen when attributes are used on service methods. Issue
#617
BondCodegen
items will now appear in the Visual Studio 2017+ UI in .NET
Core projects.gbc
from $PATH on macOS and
Linux that prevented the C# compiler from finding the generated C# files.This is a preview release of Bond codegen for Java.
gbc
& compiler library: 0.10.1.0gbc
& compiler library: 0.10.1.0required
blob field.gbc
& compiler library: 0.10.1.0gbc
and Bond compiler librarystd::allocator_traits
for rebinding allocator types.bond::make_box
helper function to create bond::Box<T>
instances.Deserialize
used as a template" have been fixed.
Issue #538
bond::ext::gRPC::shared_unary_call
type. This type can be used
when shared ownership semantics are needed for unary_call
instances.bond::ext::gRPC::wait_callback
no longer causes a shared_ptr cycle
and the resulting resource leak.bond_grpc.h
and bond_const_grpc.h
are generated when the
CMake variable BOND_ENABLE_GRPC
is set to that importing bond.bond
and
bond_const.bond
when defining a service works.bond::capped_allocator
adapter that will allow to limit the max
number of bytes to allocate during deserialization._grpc.cs
files if --grpc
is passed to gbc
.
Explicit <Compile Include="$(IntermediateOutputPath)foo_grpc.cs" />
lines in MSBuild projects will need to be removed to fix error MSB3105
about duplicate items. See commit
a120cd99
for an example of how to fix this.
Issue #448
IParser.ContainerHandler
now has an
arraySegment
parameter for the converted blob._types.cs
files when --structs=false
is passed to gbc
.Bond.Box.Create
helper method to create Bond.Box<T>
instances.Bond.IO.Unsafe.InputStream
can now be used with streams that do not
implement Stream.Seek
, like
System.IO.Compression.GzipStream
.
Issue #498
Stream.CanSeek
.SimpleXmlReader
.gbc
& compiler library: 0.10.0.0gbc
and Bond compiler libraryService
type
has a new field serviceBase
.bond::Apply
instead of overloads.bond::Apply
instead of overload implementations. Calls to bare Apply
or TypeNamespace::Apply
must be changed to bond::Apply
.CreateInputBuffer
,
CreateOutputBuffer
and GetBufferRange
, depending on which scenarios
are used (there will be a corresponding compilation error for each case).
bond::Merge<T>
with explicit an
template argument will get a compilation error. To fix, remove the
<T>
part.range_type
typedef as a return type of corresponding GetBufferRange
inside
their custom input buffer implementation.bond::customize<protocols>
has been removed. All the
public APIs that require a protocol list (e.g. bond::Marshal
) now accept
an extra template argument Protocols
which defaults to bond::BuiltInProtocols
.
Custom input streams now require bond::type_id<>
to be specialized with a
unique magic number. For more details please see the bf example.bond::Apply
function now has a uniform signature. Call sites for the
Marshaler<Writer>
transform overload that were mistakenly passing
Writer
explicitly (e.g. bond::Apply<Writer>(marshaler, value)
) will
now get a compiler error. To fix, remove the <Writer>
part:
bond::Apply(marshaler, value)
.CompactBinaryWriter<OutputCounter>
(to get the expected length of
serializing with compact binary) to produced bogus results.Bond.BondReflection
has been
removed. The type Bond.Reflection
should be used instead.00240000048000009400000006020000002400005253413100040000010001000d504ac18b4b149d2f7b0059b482f9b6d44d39059e6a96ff0a2a52678b5cfd8567cc67254132cd2debb5b95f6a1206a15c6f8ddac137c6c3ef4995f28c359acaa683a90995c8f08df7ce0aaa8836d331a344a514c443f112f80bf2ebed40ccb32d7df63c09b0d7bef80aecdc23ec200a458d4f8bafbcdeb9bf5ba111fbbd4787
gbc
& compiler library: 0.9.0.0gbc
and Bond compiler librarybond::Apply<>
instantiations for CompactBinaryWriter<OutputCounter>
and
SimpleBinaryWriter<Null>
writers.
Pull request #373
Language.Bond.Codegen.Cpp.ApplyOverloads.Protocol
is now a union of
ProtocolReader
and ProtocolWriter
to permit mixing and matching of
reader/writer protocols without having to explicitly compute the full
cross product._CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES
instead of _CTR_SECURE_NO_WARNINGS
.-fstrict-aliasing
.bond::Apply<>
instantiations for CompactBinaryWriter<OutputCounter>
and
SimpleBinaryWriter<Null>
writers.
Pull request #373
Bond.IO.Unsafe.InputStream
.Bond.Reflection
to Bond.BondReflection
. This has been fixed:
Bond.BondReflection
was unrenamed back to Bond.Reflection
, and a shim
Bond.BondReflection
type now redirects all calls to their original names
to minimize further breakage.
Issue #369
Bond.BondReflection
by name will encounter
warning CS0618 indicating use of an obselete method/type. To fix this,
use the original name Bond.Reflection
. This warning can be
suppressed if needed. However...Bond.BondReflection
will be removed during or after
the next major release of C# Bond.--comm
flag to gbc.
See how the pingpong example was updated.gbc
& compiler library: 0.8.0.0gbc
and Bond compiler librarycomm_cpp
from
types_comm_cpp
to match the file it generates.bf
utility now supports multiple payloads.
Pull request #288
bond::is_nullable
that occurs with Microsoft Visual C++ 2015 Update 3.
Issue #306
gbc
& compiler library: 0.7.0.0gbc
and Bond compiler librarystructName
and structParams
were renamed
to className
and classParams
(in the Language.Bond.Codegen.Cpp.Util
module).LayerStackProvider
no longer requires a logger;
instead, the transport's logger is passed to OnSend
/OnReceive
. Before,
using the same logger with a transport and LayerStackProvider
required a
duplicate implementation.EpoxyListener
from accepting multiple
connections in parallel.