Template Function ros2_medkit_gateway::dto::sample_value
Defined in File sample.hpp
Function Documentation
-
template<class U>
U ros2_medkit_gateway::dto::sample_value() Canonical value for a non-DTO field type. DTO-typed members never reach here - dto_sample::make handles them directly.
Round-trip note: for opaque
nlohmann::jsonfields the canonical value is an empty object ({}) rather than the default-constructednlohmann::json{}(which is JSON null). This matters when the field is wrapped instd::optional<nlohmann::json>: the reader treats JSON null as “absent”, so a default-constructed sample would lose the field on round-trip even though the writer happily emitted it.