Skip to content

Commit 4e901c6

Browse files
committed
Address requested changes
Signed-off-by: David Laseca Perez <davidlaseca@eprosima.com>
1 parent d0d705a commit 4e901c6

5 files changed

Lines changed: 31 additions & 31 deletions

File tree

ddsrouter_yaml/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ compile_test_library(
7777
###############################################################################
7878
# Resources
7979
###############################################################################
80+
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS
81+
"${PROJECT_SOURCE_DIR}/../resources/configurations/ddsrouter_config_schema.json")
82+
8083
file(READ "${PROJECT_SOURCE_DIR}/../resources/configurations/ddsrouter_config_schema.json"
8184
DDSROUTER_CONFIG_SCHEMA_CONTENT)
8285

ddsrouter_yaml/src/cpp/YamlReaderConfiguration.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,16 @@ YamlReaderConfiguration::load_ddsrouter_configuration(
6969
break;
7070

7171
case ddspipe::yaml::YamlReaderVersion::V_4_0:
72-
EPROSIMA_LOG_WARNING(DDSROUTER_YAML,
73-
"The yaml configuration version "
74-
<< version
75-
<< " is deprecated and will be removed in a future release. "
72+
EPROSIMA_LOG_WARNING(DDSROUTER_YAML, "The yaml configuration version "
73+
<< version << " is deprecated and will be removed in a future release. "
7674
<< "Please update to " << ddspipe::yaml::YamlReaderVersion::LATEST << ".");
7775
break;
7876

7977
default:
80-
throw eprosima::utils::ConfigurationException(
81-
utils::Formatter()
82-
<< "The yaml configuration version " << version
83-
<< " is unknown and not supported. Please update to "
84-
<< ddspipe::yaml::YamlReaderVersion::LATEST << ".");
78+
// Defensive fallback. With mandatory schema validation enabled, it is not necessary.
79+
throw eprosima::utils::ConfigurationException(utils::Formatter()
80+
<< "The yaml configuration version " << version << " is unknown and not supported."
81+
<< "Please update to " << ddspipe::yaml::YamlReaderVersion::LATEST << ".");
8582
break;
8683
}
8784
}

ddsrouter_yaml/src/cpp/YamlReader_configuration.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ namespace eprosima {
3434
namespace ddspipe {
3535
namespace yaml {
3636

37-
template <>
37+
template<>
3838
void YamlReader::fill(
3939
ddsrouter::core::SpecsConfiguration& object,
4040
const Yaml& yml,
@@ -95,7 +95,7 @@ void YamlReader::fill(
9595
}
9696
}
9797

98-
template <>
98+
template<>
9999
ddsrouter::core::types::ParticipantKind YamlReader::get(
100100
const Yaml& yml,
101101
const YamlReaderVersion /* version */)
@@ -105,7 +105,7 @@ ddsrouter::core::types::ParticipantKind YamlReader::get(
105105
*ddsrouter::core::types::ParticipantKindBuilder::get_instance());
106106
}
107107

108-
template <>
108+
template<>
109109
std::shared_ptr<participants::ParticipantConfiguration>
110110
YamlReader::get<std::shared_ptr<participants::ParticipantConfiguration>>(
111111
const Yaml& yml,
@@ -141,13 +141,13 @@ YamlReader::get<std::shared_ptr<participants::ParticipantConfiguration>>(
141141
YamlReader::get<participants::XmlParticipantConfiguration>(yml, version));
142142

143143
default:
144-
// Non recheable code
144+
// Non reachable code
145145
throw eprosima::utils::ConfigurationException(
146146
utils::Formatter() << "Unknown or non valid Participant kind: " << kind << ".");
147147
}
148148
}
149149

150-
template <>
150+
template<>
151151
void YamlReader::fill(
152152
core::DdsPipeConfiguration& object,
153153
const Yaml& yml,
@@ -216,7 +216,7 @@ void YamlReader::fill(
216216
}
217217
}
218218

219-
template <>
219+
template<>
220220
core::DdsPipeConfiguration YamlReader::get<core::DdsPipeConfiguration>(
221221
const Yaml& yml,
222222
const YamlReaderVersion version)
@@ -226,7 +226,7 @@ core::DdsPipeConfiguration YamlReader::get<core::DdsPipeConfiguration>(
226226
return object;
227227
}
228228

229-
template <>
229+
template<>
230230
void YamlReader::fill(
231231
ddsrouter::core::DdsRouterConfiguration& object,
232232
const Yaml& yml,
@@ -241,20 +241,20 @@ void YamlReader::fill(
241241
if (!participants_configurations_yml.IsSequence())
242242
{
243243
throw eprosima::utils::ConfigurationException(
244-
utils::Formatter() <<
245-
"Participant configurations must be specified in an array under tag: " <<
246-
COLLECTION_PARTICIPANTS_TAG);
244+
utils::Formatter()
245+
<< "Participant configurations must be specified in an array under tag: "
246+
<< COLLECTION_PARTICIPANTS_TAG);
247247
}
248248

249249
for (auto conf : participants_configurations_yml)
250250
{
251251
ddsrouter::core::types::ParticipantKind kind =
252252
YamlReader::get<ddsrouter::core::types::ParticipantKind>(conf, PARTICIPANT_KIND_TAG, version);
253253
object.participants_configurations.insert(
254-
{
255-
kind,
256-
YamlReader::get<std::shared_ptr<participants::ParticipantConfiguration>>(conf, version)
257-
}
254+
{
255+
kind,
256+
YamlReader::get<std::shared_ptr<participants::ParticipantConfiguration>>(conf, version)
257+
}
258258
);
259259
}
260260

@@ -293,7 +293,7 @@ void YamlReader::fill(
293293
}
294294
}
295295

296-
template <>
296+
template<>
297297
ddsrouter::core::DdsRouterConfiguration YamlReader::get<ddsrouter::core::DdsRouterConfiguration>(
298298
const Yaml& yml,
299299
const YamlReaderVersion version)

ddsrouter_yaml/test/unittest/ddsrouter_yaml_validator/valid_config_files_router/docu_example.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ participants:
113113

114114
# Simple DDS Participant configured with ROS 2 Easy Mode
115115

116-
- name: Participant1 # Participant Name = Participant1
116+
- name: Participant2 # Participant Name = Participant2
117117

118118
kind: simple # Participant Kind = local (= simple)
119119

120-
domain: 7 # DomainId = 7
120+
domain: 7 # DomainId = 7
121121

122122
ros2-easy-mode: "2.2.2.2" # Remote discovery server address
123123

@@ -191,4 +191,4 @@ topic-routes:
191191
routes:
192192
- src: Participant1
193193
dst:
194-
- Participant0
194+
- Participant0

docs/rst/user_manual/configuration.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -705,8 +705,8 @@ Network Address
705705
Network Addresses are elements that can be configured for specific Participants.
706706
An Address is defined by:
707707

708-
* *IP*: IP of the host (public IP in case of WAN communication).
709-
* *Port*: Port where the Participant is listening.
708+
* *IP*: IP of the host (public IP in case of WAN communication). This field is mandatory if ``domain`` is not specified.
709+
* *Port*: Port where the Participant is listening. This field is mandatory.
710710
* *External Port*: Public port accessible for external entities (only for TCP listening-addresses).
711711
* *Transport Protocol*: ``UDP`` or ``TCP``.
712712
If it is not set, it would be chosen by default depending on the Participant Kind.
@@ -1078,11 +1078,11 @@ A complete example of all the configurations described on this page can be found
10781078
10791079
# Simple DDS Participant configured with ROS 2 Easy Mode
10801080
1081-
- name: Participant1 # Participant Name = Participant1
1081+
- name: Participant2 # Participant Name = Participant2
10821082
10831083
kind: simple # Participant Kind = local (= simple)
10841084
1085-
domain: 7 # DomainId = 7
1085+
domain: 7 # DomainId = 7
10861086
10871087
ros2-easy-mode: "2.2.2.2" # Remote discovery server address
10881088

0 commit comments

Comments
 (0)