Skip to content

serialization: remove container wrappers and serialize directly#9077

Merged
luigi1111 merged 2 commits intomonero-project:masterfrom
jeffro256:ser_containers_no_wrapper
Jan 18, 2024
Merged

serialization: remove container wrappers and serialize directly#9077
luigi1111 merged 2 commits intomonero-project:masterfrom
jeffro256:ser_containers_no_wrapper

Conversation

@jeffro256
Copy link
Copy Markdown
Contributor

@jeffro256 jeffro256 commented Nov 28, 2023

Some downstream code (most notably PR UkoeHB#25) wants to use the src/serialization lib
for storing information persistently. When one builds classes/machines wishing to serialize containers, they must use
the serializable_* container classes. In this case, this makes the Seraphis library code unnecessarily tightly coupled
with the src/serialization code since one cannot swap out their type of storage format without major refactoring of class
field types. By serializing STL containers directly, we can abstract the serialization details away, making for much
cleaner design. Also small bonus side effect of this change is that STL containers with custom Comparators, Allocators,
and Hashers are serializable.

Depends upon #9069.

@jeffro256 jeffro256 force-pushed the ser_containers_no_wrapper branch 2 times, most recently from 79b26d5 to ad7fe71 Compare November 28, 2023 02:47
Comment thread src/serialization/containers.h Outdated
@jeffro256 jeffro256 force-pushed the ser_containers_no_wrapper branch from ad7fe71 to ae77f83 Compare November 28, 2023 18:39
Comment thread src/serialization/containers.h Outdated
Comment thread src/serialization/container.h Outdated
Comment thread src/serialization/container.h Outdated
Comment thread src/serialization/container.h Outdated
Some downstream code (most notably PR UkoeHB#25) wants to use the src/serialization lib
for storing information persistently. When one builds classes/machines wishing to serialize containers, they must use
the `serializable_*` container classes. In this case, this makes the Seraphis library code unnecessarily tightly coupled
with the src/serialization code since one cannot swap out their type of storage format without major refactoring of class
field types. By serializing STL containers directly, we can abstract the serialization details away, making for much
cleaner design. Also small bonus side effect of this change is that STL containers with custom Comparators, Allocators,
and Hashers are serializable. `std::multimap` is added to the list of serializable containers.

Depends upon monero-project#9069.
@jeffro256 jeffro256 force-pushed the ser_containers_no_wrapper branch from ae77f83 to 2525200 Compare November 28, 2023 20:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants