You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I used some dummy structs and manual memcpy to do so in a project a while back. It's gross and bad form but works. Just make sure the layout's the same. (Until it's actually supported, of course.)
Here's the code I had. It's only valid for POD (std::is_trivial and std::is_standard_layout). Sorry I took a while to respond - I had to go find and extract it.
First, there's a couple of dummy structs which are defined, and namespacing:
At destruction, you'll need to manually call your destructor (since it's a pointer), and std::free(ret->table).
It's pretty clunky, but it at least worked for my purposes. Let me know if you have any problems or need some help!
Activity
nextgens commentedon Dec 2, 2017
I guess it's a feature request more than anything else... but I concur; it'd be super-convenient if it was part of the API
dnbaker commentedon Dec 3, 2017
I used some dummy structs and manual memcpy to do so in a project a while back. It's gross and bad form but works. Just make sure the layout's the same. (Until it's actually supported, of course.)
nextgens commentedon Dec 4, 2017
Would you mind sharing the code ?
dnbaker commentedon Dec 4, 2017
I can pull that out of a private repo. I’ll look it over tomorrow and see if a pull request is easier.
If you’re doing sequence analysis, which I’m guessing based on your name, I could release the kmer database code around it if it meets your needs.
nextgens commentedon Dec 4, 2017
Thanks!
No, this time it's not for sequence analysis :)
roniemartinez commentedon Dec 26, 2017
👍 to this! Serializing/deserializing seems more efficient than rebuilding the filter. @dnbaker hope it is possible to share the code.
d4tocchini commentedon Dec 30, 2018
@dnbaker, @efficient
this is viable, yes? if so, something to point me to?
d4tocchini commentedon Dec 30, 2018
assuming a surgically placed memcpy, but not feeling confident whereabout
amiller-gh commentedon Oct 18, 2021
@dnbaker resurrecting an old thread :)
I'm also interested in serialization. Any chance you can dig up that old code, or do you have recommendations for another cuckoo filter library?
dnbaker commentedon Oct 26, 2021
Here's the code I had. It's only valid for POD (std::is_trivial and std::is_standard_layout). Sorry I took a while to respond - I had to go find and extract it.
First, there's a couple of dummy structs which are defined, and namespacing:
Writing to disk:
Reading:
At destruction, you'll need to manually call your destructor (since it's a pointer), and
std::free(ret->table).It's pretty clunky, but it at least worked for my purposes. Let me know if you have any problems or need some help!