Git Product home page Git Product logo

sbepp's People

Contributors

oleksandrkvl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

ngrodzitski

sbepp's Issues

Investigate and fix potential ADL problems

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.

Trying to make an unsigned double?

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

Why not the other SBE-CPP?

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?

https://github.com/real-logic/simple-binary-encoding

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.