zhan7236 opened a new pull request, #3068:
URL: https://github.com/apache/fory/pull/3068
## Why?
Per xlang specification, Fory needs to support serialization of
iterator-based containers. Currently, only `std::vector` and `std::set` are
supported in C++. This PR adds support for additional sequence containers
(`std::list`, `std::deque`, `std::forward_list`) to provide more flexibility
for C++ users.
## What does this PR do?
Add serialization support for C++ iterator containers:
- `std::list<T>`
- `std::deque<T>`
- `std::forward_list<T>`
All these containers are serialized as `TypeId::LIST` (value 21) per xlang
specification, which only distinguishes between LIST and SET collection types.
Set-like classes (`std::set`, `std::unordered_set`) continue to use
`TypeId::SET`.
**Changes:**
- `serializer_traits.h`: Add `is_list`, `is_deque`, `is_forward_list` type
traits and `is_generic_type` specializations
- `collection_serializer.h`: Add complete `Serializer` specializations for
`std::list`, `std::deque`, `std::forward_list` with full read/write support
- `type_resolver.h`: Add `FieldTypeBuilder` specializations for new
container types to support struct field serialization
- `collection_serializer_test.cc`: Add 9 comprehensive test cases covering
string, integer, and empty collection scenarios
## Related issues
Closes #2911
## Does this PR introduce any user-facing change?
- [x] Does this PR introduce any public API change?
- Adds new public serialization support for `std::list`, `std::deque`, and
`std::forward_list` containers
- [ ] Does this PR introduce any binary protocol compatibility change?
- No, uses existing `TypeId::LIST` protocol
## Benchmark
N/A - This PR adds new functionality without modifying existing
serialization paths. The new container serializers follow the same patterns as
the existing `std::vector` serializer.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]