chaokunyang commented on PR #2798:
URL: https://github.com/apache/fory/pull/2798#issuecomment-3430728824
@urlyy This PR make API hard to understand. The register order should not be
important if then specify the type id/name. And introduce new
SharedTypeResolver make type system more complex.
How about:
1. Create a new field `HashMap<std::any::TypeId, fory_type_id/name>` in
TypeResolver
2. when register a type/serializer, we just store the id/name into that map.
3. provide a new method `get_type_id` in TypeResolver, which query the
current TypeInfo map first, if not found, then query from the new map
4. The `fory_type_id/fields_info` can invoke `get_type_id` to get the type
id info
5. Remove clone from `TypeResolver`, and provide a new
`build/finalize_registration` method to return an immutable TypeResolver. we
can create typeinfo here for new registered types, and construct TypeResolver
directly
--
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]