Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Immer persist #278

Merged
merged 103 commits into from
Sep 2, 2024
Merged
Changes from 1 commit
Commits
Show all changes
103 commits
Select commit Hold shift + click to select a range
27e6e78
Integrate immer-archive
alex-sparus Feb 16, 2024
a461c95
Comfortable shell in macOS and Linux with `nix develop`
alex-sparus Feb 16, 2024
57e2244
Box archiving. Recursive type WIP
alex-sparus Feb 16, 2024
e79ba95
Start testing recursive types, WIP
alex-sparus Feb 19, 2024
e7268e9
Recursive box seems to work
alex-sparus Feb 19, 2024
16a8fec
Test recursive map, no problems
alex-sparus Feb 19, 2024
5878b11
Make sure that the type names are unique
alex-sparus Feb 20, 2024
bcc6db3
Test vectors archive conversion
alex-sparus Feb 20, 2024
5526e0e
Champ archive conversion for a map
alex-sparus Feb 21, 2024
243d000
Rename fix_leaf_nodes to to_load_archive, in line with champ
alex-sparus Feb 22, 2024
59ee310
Rename immer-archive into just archive
alex-sparus Feb 22, 2024
01caabb
Archive conversion for tables
alex-sparus Feb 22, 2024
9e81f90
Test conversion with a special archive
alex-sparus Feb 23, 2024
c5e6e37
Add save_archives helper function for the app code
alex-sparus Feb 26, 2024
aa801c4
Support loading from streams
alex-sparus Feb 27, 2024
be07f01
Remove the is_constructible check because it breaks the usecase with …
alex-sparus Mar 12, 2024
186e3b0
Saving and loading with archives for immer-types without wrapping the…
alex-sparus Mar 19, 2024
f4e9a3f
Try auto-archive with type conversion
alex-sparus Mar 19, 2024
0546f81
Fix build for clang 14
alex-sparus Mar 20, 2024
6fa9a4f
Enable auto-format
alex-sparus Feb 26, 2024
de235cb
Manually fixed files because the include order matters
alex-sparus Feb 26, 2024
2be563c
Do not format tools/include
alex-sparus Feb 26, 2024
e4efd32
Disable format around NONIUS_BENCHMARK calls
alex-sparus Mar 26, 2024
e00461b
Format cmake
alex-sparus Feb 26, 2024
1c60ad7
Ran `pre-commit run --all-files`
alex-sparus Mar 26, 2024
b9d5b2b
Explore the problem of conversion
alex-sparus Mar 31, 2024
8d1d37f
Recursive transformation actually works
alex-sparus Apr 3, 2024
3ef2ad8
Much better interface for the recursive archives transformation
alex-sparus Apr 5, 2024
dd5aac6
Fix for when not all archive types are converted
alex-sparus Apr 5, 2024
2171c9a
Add missing traits for conversions
alex-sparus Apr 5, 2024
76011c5
Demonstrate the problem of circular dependency between archives
alex-sparus Apr 5, 2024
2028af3
Recursive transformation works, mostly
alex-sparus Apr 10, 2024
c3fdb44
Conversion preserves internal structural sharing
alex-sparus Apr 10, 2024
23002d7
Conversion continues, map works
alex-sparus Apr 15, 2024
c7657e4
Convert table properly
alex-sparus Apr 16, 2024
62827e7
set conversion
alex-sparus Apr 16, 2024
61c7e52
Trying to reproduce the weird crash but failing
alex-sparus Apr 16, 2024
456011c
Converting loaders handle exceptions without corrupting memory
alex-sparus Apr 22, 2024
9489ff7
Fix loading a nested archive
alex-sparus Apr 23, 2024
e008fa5
Load once again with exceptions enabled to validate the archive's con…
alex-sparus Apr 23, 2024
a3aa663
Fix building with Clang14
alex-sparus Apr 25, 2024
3f2464a
boost::hana::value template is unnecessary
alex-sparus May 6, 2024
999293c
Hit a weird compile-time bug with hana::overload
alex-sparus May 6, 2024
255ed24
Support converting hash-based containers even when transformation cha…
alex-sparus May 7, 2024
41b18df
Avoid generating useless JSON string
alex-sparus May 11, 2024
d495a60
Type-wrapping function is customizable
alex-sparus May 13, 2024
a8e65dc
Using defaulted equality operator where possible
alex-sparus May 15, 2024
40ae864
Demonstrate the current problem with two loaders
alex-sparus May 16, 2024
e472779
Loading inside or outside of the archive preserves sharing
alex-sparus May 16, 2024
bbb1efa
Rename "archive" into "persist"
alex-sparus May 23, 2024
d6149f8
Recursive traversal of types to generate required pools
alex-sparus May 24, 2024
b26f88d
More generic custom archives implementation
alex-sparus May 28, 2024
4d30d30
Unified custom archives
alex-sparus May 28, 2024
76d7b4d
Test XML and streamline output archive
alex-sparus May 29, 2024
7cd40ec
Demonstrate the problem with boxes and recursive types
alex-sparus May 29, 2024
1097bdc
Increase/preserve structural sharing with boxes by preferring the old…
alex-sparus May 30, 2024
063a0d6
Remove dead code
alex-sparus May 30, 2024
b38f8fa
Less repetition with load_pools
alex-sparus May 30, 2024
9d40919
Remove loaders from the pools for the normal scenario
alex-sparus May 30, 2024
8443292
Define policies to control how pool types and names are defined
alex-sparus Jun 4, 2024
e43223b
Policy controls how the final value is saved into the archive
alex-sparus Jun 6, 2024
9eeff41
Export hasName from previous
alex-sparus Jun 6, 2024
e528c02
Fix types traversal
alex-sparus Jun 7, 2024
d81e4b1
Runtime detection of non-unique pool names
alex-sparus Jun 11, 2024
930bfaf
Add to_json streaming version
alex-sparus Jun 11, 2024
052bc1e
Reduce hana in the interface
alex-sparus Jun 13, 2024
6cb1789
Remove wrapping functions from the policy
alex-sparus Jun 27, 2024
28da3c2
Policy returns the pool's name directly
alex-sparus Jun 27, 2024
60c0dd5
Save B and BL in vector pools
alex-sparus Jun 27, 2024
71b8248
Rename to get_pools_for_hana_type to make it clear it expects a hana …
alex-sparus Jul 2, 2024
31ba6b4
Start the docs for persist
alex-sparus Jul 11, 2024
bfa4c1a
Start the docs for persist, document the policy concept
alex-sparus Aug 5, 2024
28f21c6
More narration in the docs, less in the code
alex-sparus Aug 6, 2024
9c9999e
Policies documented
alex-sparus Aug 6, 2024
4246339
Rephrase the pool explanation. More implementation docs.
alex-sparus Aug 7, 2024
e3ed8c6
Move out non-API docs
alex-sparus Aug 8, 2024
236048f
WIP Splitting implementation details from public API
alex-sparus Aug 8, 2024
2ff4780
Fix build
alex-sparus Aug 8, 2024
2c2dfb8
Remove some functions from the API part
alex-sparus Aug 8, 2024
3e85412
Separate details from public API
alex-sparus Aug 8, 2024
57c118b
Map and vector cereal support is not part of persist
alex-sparus Aug 12, 2024
aee44c1
Renames
alex-sparus Aug 12, 2024
4583fcc
Custom policy
alex-sparus Aug 12, 2024
5192056
Rename the cereal archive wrappers
alex-sparus Aug 12, 2024
2af3b9d
Simplify xx_hash definitions
alex-sparus Aug 12, 2024
da5c02a
Move more stuff into details
alex-sparus Aug 12, 2024
d03534b
Comments for the archive wrappers
alex-sparus Aug 12, 2024
1b4b405
Describe transforming into the same type
alex-sparus Aug 13, 2024
fce0d22
Move the persist docs
alex-sparus Aug 13, 2024
7a77d1d
Describe more transformations
alex-sparus Aug 13, 2024
b70c8cb
More on the hash-based containers
alex-sparus Aug 14, 2024
3a789e3
Transforming nested containers
alex-sparus Aug 16, 2024
0ff74b7
Document the missing public API parts
alex-sparus Aug 19, 2024
3dd6df5
Rephrase the descriptions
alex-sparus Aug 19, 2024
f0d279c
Auto-format
alex-sparus Aug 21, 2024
ece80df
Support persisting immer::array
alex-sparus Aug 23, 2024
6de8600
More compact maps format: pairs are lists of 2 elements
alex-sparus Aug 26, 2024
6a8f10f
Add option to pass parameters to cereal archive
alex-sparus Aug 26, 2024
864aafa
Explain the purpose of values_save and values_load
alex-sparus Aug 27, 2024
6b47b15
Remove any mention of spdlog
alex-sparus Aug 28, 2024
c77ca34
Split with_pools.hpp into save and load
alex-sparus Aug 28, 2024
8c511df
Document that incompatible_hash_wrapper caches the container
alex-sparus Aug 29, 2024
646315e
Fix missing include
alex-sparus Aug 30, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Archive conversion for tables
alex-sparus committed Aug 21, 2024

Verified

This commit was signed with the committer’s verified signature.
alex-sparus Alex Shabalin
commit 01caabb80f4c9c6dfe80290d08d182aad690db48
19 changes: 19 additions & 0 deletions immer/extra/archive/champ/archive.hpp
Original file line number Diff line number Diff line change
@@ -249,5 +249,24 @@ auto transform_archive(const container_archive_load<
};
}

template <typename T,
typename KeyFn,
typename Hash,
typename Equal,
typename MemoryPolicy,
immer::detail::hamts::bits_t B,
class F>
auto transform_archive(
const container_archive_load<
immer::table<T, KeyFn, Hash, Equal, MemoryPolicy, B>>& ar,
F&& func)
{
using U = std::decay_t<decltype(func(std::declval<T>()))>;
using new_table_t = immer::table<U, KeyFn, Hash, Equal, MemoryPolicy, B>;
return container_archive_load<new_table_t>{
.nodes = transform(ar.nodes, func),
};
}

} // namespace champ
} // namespace immer::archive
Loading