oleksandrkvl / sbepp Goto Github PK
View Code? Open in Web Editor NEWC++ implementation of the FIX Simple Binary Encoding
Home Page: https://oleksandrkvl.github.io/sbepp/
License: MIT License
C++ implementation of the FIX Simple Binary Encoding
Home Page: https://oleksandrkvl.github.io/sbepp/
License: MIT License
Clang incorrectly provides [[nodiscard]]
in C++11 mode and then produces a warning (converted to error) that it's a C++17 feature. See workaround here: https://github.com/boostorg/json/blob/8670fd78af55d91b799a94457b28231f8b089b70/include/boost/json/detail/config.hpp#L33
When a view has std::byte
underlying byte-type, init_cursor
fails because it calls unqualified addressof()
which is ambiguous between sbepp::addressof
and std::addressof
. Investigate other similar cases, the simplest solution is to avoid relying on ADL anywhere.
I have a schema which looks like this:
<types>
<composite name="MyCar">
<!--<ref name="myfield" type="an_enum"/>-->
<type name="speed" primitiveType="double"/>
</composite>
</types>
<message name="foo">
<group name="cars">
<field name="myCar" id="1" type="MyCar"/>
</group>
</message/>
And when trying to encode some data I get an err, which seems to be because we're trying to cast a double to an unsigned double. Encoding code:
auto d = m.cars();
const auto group_size = 12;
sbepp::fill_group_header(d, group_size);
for (auto entry : d)
{
auto inner = entry.myCar();
inner.myfield(MY_ENUM);
inner.speed((double)argc); // <-- line of error
}
Err:
root:1689:62: error: invalid use of incomplete type 'class std::__make_unsigned_selector<double, false, false>'
1689 | { typedef typename __make_unsigned_selector<_Tp>::__type type; };
| ^~~~
root:1596:11: note: declaration of 'class std::__make_unsigned_selector<double, false, false>'
1596 | class __make_unsigned_selector;
| ^~~~~~~~~~~~~~~~~~~~~~~~
In file included from proj/build/sbeppc/my_sbe/schema/schema.hpp:7,
from proj/build/sbeppc/my_sbe/my_sbe.hpp:6,
from proj/flatbuf_sample_binary.cpp:29:
proj/sbepp/src/sbepp/sbepp.hpp: In instantiation of 'void sbepp::detail::set_primitive(Byte*, T) [with sbepp::endian E = sbepp::endian::little; T = double; Byte = char]':
proj/sbepp/src/sbepp/sbepp.hpp:605:21: required from 'void sbepp::detail::set_value(View, std::size_t, T) [with sbepp::endian E = sbepp::endian::little; T = double; View = my_sbe::detail::types::composite_2<char>; std::size_t = long unsigned int]'
proj/build/sbeppc/my_sbe/types/PositionDelta.hpp:73:60: required from 'void my_sbe::detail::types::composite_2<Byte>::amt(my_sbe::detail::types::type_4) const [with T = void; <template-parameter-2-2> = void; Byte = char]'
proj/flatbuf_sample_binary.cpp:495:38: required from here
proj/sbepp/src/sbepp/sbepp.hpp:514:52: error: no matching function for call to 'to_unsigned(double&)'
514 | value = static_cast<T>(byteswap(to_unsigned(value)));
| ~~~~~~~~~~~^~~~~~~
proj/sbepp/src/sbepp/sbepp.hpp:361:48: note: candidate: 'template<class T> constexpr typename std::make_unsigned<_Tp>::type sbepp::detail::to_unsigned(T)'
361 | constexpr typename std::make_unsigned<T>::type to_unsigned(T v) noexcept
| ^~~~~~~~~~~
proj/sbepp/src/sbepp/sbepp.hpp:361:48: note: substitution of deduced template arguments resulted in errors seen above
Review and integrate sbepp_generate
CMake helper proposed by @ngrodzitski in PR #14.
What does this implementation offer over the 'default' impl generated by RealLogic's repo? It does look like the API is considerably easier to use, but it would be good to write it out somewhere in the docs. I see the benchmarks are comparing to handwritten code rather than the competing impl, maybe it's too hard to wrest memory management from the other one?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.