Skip to content

refactor(utils): extract generic enum serialization template#295

Merged
kcenon merged 1 commit into
mainfrom
refactor/issue-293-enum-serialization
Jan 20, 2026
Merged

refactor(utils): extract generic enum serialization template#295
kcenon merged 1 commit into
mainfrom
refactor/issue-293-enum-serialization

Conversation

@kcenon

@kcenon kcenon commented Jan 20, 2026

Copy link
Copy Markdown
Owner

Closes #293

Summary

  • Create enum_serialization.h with EnumSerializable concept and generic enum_to_string/enum_from_string template functions
  • Add enum_traits specializations for log_level, metric_type, health_status, and health_check_type
  • Replace duplicated switch/case patterns with trait-based template usage
  • Maintain backward compatibility with existing to_string() and from_string() functions

Test Plan

  • All 25 new unit tests pass (common_enum_serialization_test)
  • Existing common_health_monitoring_test passes
  • Existing common_concepts_test passes
  • Existing common_log_functions_test passes
  • Full project builds successfully

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
@kcenon kcenon merged commit cdbdbac into main Jan 20, 2026
24 checks passed
@kcenon kcenon deleted the refactor/issue-293-enum-serialization branch January 20, 2026 12:01
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
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.

refactor: Extract generic enum serialization template to eliminate duplication

1 participant