refactor(utils): extract generic enum serialization template#295
Merged
Conversation
Create enum_serialization.h with EnumSerializable concept and generic enum_to_string/enum_from_string functions. Replace duplicated switch/case patterns across health_check_type, health_status, metric_type, and log_level with trait-based template specializations. Add unit tests for all enum types with round-trip verification. Closes #293
12 tasks
kcenon
added a commit
that referenced
this pull request
Apr 13, 2026
Create enum_serialization.h with EnumSerializable concept and generic enum_to_string/enum_from_string functions. Replace duplicated switch/case patterns across health_check_type, health_status, metric_type, and log_level with trait-based template specializations. Add unit tests for all enum types with round-trip verification. Closes #293
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #293
Summary
enum_serialization.hwithEnumSerializableconcept and genericenum_to_string/enum_from_stringtemplate functionsenum_traitsspecializations forlog_level,metric_type,health_status, andhealth_check_typeto_string()andfrom_string()functionsTest Plan
common_enum_serialization_test)common_health_monitoring_testpassescommon_concepts_testpassescommon_log_functions_testpasses