diff --git a/ddspipe_yaml/src/cpp/YamlReader_features.cpp b/ddspipe_yaml/src/cpp/YamlReader_features.cpp index 84c70ae7..6c2f0538 100644 --- a/ddspipe_yaml/src/cpp/YamlReader_features.cpp +++ b/ddspipe_yaml/src/cpp/YamlReader_features.cpp @@ -233,9 +233,9 @@ core::TopicRoutesConfiguration YamlReader::get( return object; } -/************************* - * Monitor Configuration * - **************************/ +/************************** +* Monitor Configuration * +**************************/ template <> DDSPIPE_YAML_DllAPI @@ -277,6 +277,20 @@ void YamlReader::fill( } } +template <> +DDSPIPE_YAML_DllAPI +bool YamlValidator::validate( + const Yaml& yml, + const YamlReaderVersion& /* version */) +{ + const std::set tags{ + MONITOR_DOMAIN_TAG, + MONITOR_STATUS_TAG, + MONITOR_TOPICS_TAG}; + + return YamlValidator::validate_tags(yml, tags); +} + template <> DDSPIPE_YAML_DllAPI core::MonitorConfiguration YamlReader::get( @@ -308,6 +322,19 @@ void YamlReader::fill( } } +template <> +DDSPIPE_YAML_DllAPI +bool YamlValidator::validate( + const Yaml& yml, + const YamlReaderVersion& /* version */) +{ + const std::set tags{ + MONITOR_ENABLE_TAG, + MONITOR_PERIOD_TAG}; + + return YamlValidator::validate_tags(yml, tags); +} + template <> DDSPIPE_YAML_DllAPI core::MonitorProducerConfiguration YamlReader::get( diff --git a/ddspipe_yaml/src/cpp/YamlReader_types.cpp b/ddspipe_yaml/src/cpp/YamlReader_types.cpp index 34b4031d..bf2848b2 100644 --- a/ddspipe_yaml/src/cpp/YamlReader_types.cpp +++ b/ddspipe_yaml/src/cpp/YamlReader_types.cpp @@ -370,14 +370,9 @@ bool YamlValidator::validate( std::set tags{ COLLECTION_ADDRESSES_TAG}; - switch (version) + if (version != V_1_0) { - case V_1_0: - break; - - default: - tags.insert(DISCOVERY_SERVER_GUID_PREFIX_TAG); - break; + tags.insert(DISCOVERY_SERVER_GUID_PREFIX_TAG); } return YamlValidator::validate_tags(yml, tags); @@ -430,12 +425,29 @@ void YamlReader::fill( } } +template <> +DDSPIPE_YAML_DllAPI +bool YamlValidator::validate( + const Yaml& yml, + const YamlReaderVersion& /* version */) +{ + const std::set tags{ + DDS_PUBLISHING_ENABLE_TAG, + DDS_PUBLISHING_DOMAIN_TAG, + DDS_PUBLISHING_TOPIC_NAME_TAG, + DDS_PUBLISHING_PUBLISH_TYPE_TAG}; + + return YamlValidator::validate_tags(yml, tags); +} + template <> DDSPIPE_YAML_DllAPI core::DdsPublishingConfiguration YamlReader::get( const Yaml& yml, const YamlReaderVersion version) { + YamlValidator::validate(yml, version); + core::DdsPublishingConfiguration object; fill(object, yml, version); return object; @@ -483,8 +495,7 @@ void YamlReader::fill( { if (get(yml, QOS_OWNERSHIP_TAG, version)) { - object.ownership_qos.set_value( - ddspipe::core::types::OwnershipQosPolicyKind::EXCLUSIVE_OWNERSHIP_QOS); + object.ownership_qos.set_value(ddspipe::core::types::OwnershipQosPolicyKind::EXCLUSIVE_OWNERSHIP_QOS); } else { @@ -589,6 +600,20 @@ void YamlReader::fill( } } +template <> +DDSPIPE_YAML_DllAPI +bool YamlValidator::validate( + const Yaml& yml, + const YamlReaderVersion& /* version */) +{ + const std::set tags{ + LOG_FILTER_ERROR_TAG, + LOG_FILTER_WARNING_TAG, + LOG_FILTER_INFO_TAG}; + + return YamlValidator::validate_tags(yml, tags); +} + template <> DDSPIPE_YAML_DllAPI utils::LogFilter YamlReader::get( @@ -639,6 +664,21 @@ void YamlReader::fill( } } +template <> +DDSPIPE_YAML_DllAPI +bool YamlValidator::validate( + const Yaml& yml, + const YamlReaderVersion& /* version */) +{ + const std::set tags{ + LOG_PUBLISH_TAG, + LOG_STDOUT_TAG, + LOG_VERBOSITY_TAG, + LOG_FILTER_TAG}; + + return YamlValidator::validate_tags(yml, tags); +} + template <> DDSPIPE_YAML_DllAPI core::DdsPipeLogConfiguration YamlReader::get( diff --git a/ddspipe_yaml/src/cpp/YamlValidator.cpp b/ddspipe_yaml/src/cpp/YamlValidator.cpp index 60ed3c97..ae237d2f 100644 --- a/ddspipe_yaml/src/cpp/YamlValidator.cpp +++ b/ddspipe_yaml/src/cpp/YamlValidator.cpp @@ -34,7 +34,7 @@ bool YamlValidator::validate_tags( utils::Formatter() << "The yml: <" << yml << "> is not a yaml object map."); } - // Check if there are any extra tags that are not in either list + // Check if there are any extra tags that are not in the list bool has_extra_tags = false; for (const auto& tag_it : yml)