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

Add define map #306

Merged
merged 2 commits into from
Jul 6, 2015
Merged

Add define map #306

merged 2 commits into from
Jul 6, 2015

Conversation

redboltz
Copy link
Contributor

@redboltz redboltz commented Jul 5, 2015

No description provided.

@redboltz
Copy link
Contributor Author

redboltz commented Jul 5, 2015

When you use MSGPACK_DEFINE_MAP and MSGPACK_BASE_MAP, the members of class are serialized as MAP. Converting and creating msgpack::with_zone are also supported.

When you use MSGPACK_DEFINE_ARRAY and MSGPACK_BASE_ARRAY, the members are serialized as array. MSGPACK_DEFINE and MSGPACK_BASE is aliases of MSGPACK_DEFINE_ARRAY and MSGPACK_BASE_ARRAY by default. If you define MSGPACK_USE_DEFINE_MAP, they become the aliases of MSGPACK_DEFINE_MAP and MSGPACK_BASE_MAP.

The keys of the map are variables name. When you use MSGPACK_BASE_MAP, the key of the map is the name of the base class.

You can serialize and deserialize without an order restriction as follows:
https://github.com/msgpack/msgpack-c/pull/306/files#diff-aac96dea4ddf2c5c29096d6d6e5b0874R433

In order to implement this functionality, I use Boost.Preprocessor. So if you want to use the MSGPACK_DEFINE_MAP and MSGPACK_BASE_MAP, you need to define MSGPACK_USE_BOOST. If you don't, you don't need Boost Libraries and it is a default setting.

@redboltz redboltz merged commit 584bd85 into msgpack:master Jul 6, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant