|
| 1 | +// Copyright 2024 Proyectos y Sistemas de Mantenimiento SL (eProsima). |
| 2 | +// |
| 3 | +// Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +// you may not use this file except in compliance with the License. |
| 5 | +// You may obtain a copy of the License at |
| 6 | +// |
| 7 | +// http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +// |
| 9 | +// Unless required by applicable law or agreed to in writing, software |
| 10 | +// distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +// See the License for the specific language governing permissions and |
| 13 | +// limitations under the License. |
| 14 | + |
| 15 | +/** |
| 16 | + * @file YamlReader_configuration.cpp |
| 17 | + * |
| 18 | + * Use this file to define tailored validation methods for the DDS Replayer. |
| 19 | + * The methods are already implemented in the DDS Pipe, but they can be overridden here to provide specific validation. |
| 20 | + * |
| 21 | + * The namespace must be the same as the DDS Pipe's YamlReader class. |
| 22 | + * |
| 23 | + * NOTE: Overriding the same validate method in the DDS Recorder and the DDS Replayer would give conflicts. The |
| 24 | + * functions that need to be overridden in both are left commented in both until the DDS Recorder and the DDS Replayer |
| 25 | + * are split up into different products. |
| 26 | + */ |
| 27 | + |
| 28 | +#include <set> |
| 29 | + |
| 30 | +#include <ddspipe_core/types/dds/TopicQoS.hpp> |
| 31 | + |
| 32 | +#include <ddspipe_yaml/YamlValidator.hpp> |
| 33 | +#include <ddspipe_yaml/yaml_configuration_tags.hpp> |
| 34 | + |
| 35 | +namespace eprosima { |
| 36 | +namespace ddspipe { |
| 37 | +namespace yaml { |
| 38 | + |
| 39 | +// template <> |
| 40 | +// bool YamlValidator::validate<core::types::TopicQoS>( |
| 41 | +// const Yaml& yml, |
| 42 | +// const YamlReaderVersion& /* version */) |
| 43 | +// { |
| 44 | +// // The DDS Pipe's QOS_MAX_RX_RATE and QOS_DOWNSAMPLING are invalid in the DDS Replayer. |
| 45 | +// static const std::set<TagType> tags{ |
| 46 | +// QOS_TRANSIENT_TAG, |
| 47 | +// QOS_RELIABLE_TAG, |
| 48 | +// QOS_OWNERSHIP_TAG, |
| 49 | +// QOS_PARTITION_TAG, |
| 50 | +// QOS_HISTORY_DEPTH_TAG, |
| 51 | +// QOS_KEYED_TAG, |
| 52 | +// QOS_MAX_TX_RATE_TAG}; |
| 53 | + |
| 54 | +// return YamlValidator::validate_tags(yml, tags); |
| 55 | +// } |
| 56 | + |
| 57 | +} /* namespace yaml */ |
| 58 | +} /* namespace ddspipe */ |
| 59 | +} /* namespace eprosima */ |
0 commit comments