Giter Club home page Giter Club logo

Comments (4)

fraillt avatar fraillt commented on July 18, 2024

If I understood your problem correctly, you can use C-style array or even pointer+size as a buffer. Here is specializations provided for both cases. Also you could look at working example here

from bitsery.

VelocityRa avatar VelocityRa commented on July 18, 2024

Right, but that example is for a C static array and for the other one, I don't know the total size of the serialized data that will be saved ahead of time.
I have lots of objects serialized recursively and some are dynamic.
I don't see a specialization there that would allow for that use-case I think.

For example, a possible solution would be to give bitsery a malloced buffer of some initial size, and then it would realloc as it needs space (just as it does .push_back for std::vector OutputBufferAdapters). Or just give it a ** and it would malloc too and put the pointer there.

Hopefully I explained the problem more clearly now.

from bitsery.

fraillt avatar fraillt commented on July 18, 2024

You left with only one solution then. You will need to provide a custom buffer implementation and specialize it for ContainerTraits and BufferAdapterTraits. Hope that helped:)

from bitsery.

VelocityRa avatar VelocityRa commented on July 18, 2024

Ok I see, thank you.

from bitsery.

Related Issues (20)

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.