Table-driven parameter list handling
The old parameter list parsing was a mess of custom code with tons of duplicated checks, even though parameter list parsing really is a fairly straightforward affair. This commit changes it to a mostly table-driven implementation, where the vast majority of the settings are handled by a generic deserializer and the irregular ones (like reliability, locators) are handled by custom functions. The crazy ones (IPv4 address and port rely on additional state and are completely special-cased). Given these tables, the serialization, finalisation, validation, merging, unalias'ing can all be handled by a very small amount of custom code and an appropriately defined generic function for the common cases. This also makes it possible to have all QoS validation in place, and so removes the need for the specialized implementations for the various entity kinds in the upper layer. QoS inapplicable to an entity were previously ignored, allowing one to have invalid values set in a QoS object when creating an entity, provided that the invalid values are irrelevant to that entity. Whether this is a good thing or not is debatable, but certainly it is a good thing to avoid copying in inapplicable QoS settings. That in turn means the behaviour of the API can remain the same. It does turn out that the code used to return "inconsistent QoS" also for invalid values. That has now been rectified, and it returns "inconsistent QoS" or "bad parameter" as appropriate. Tests have been updated accordingly. Signed-off-by: Erik Boasson <eb@ilities.com>
This commit is contained in:
parent
8ae81db490
commit
3322fc086d
36 changed files with 2367 additions and 2735 deletions
|
@ -147,7 +147,7 @@ static struct proxy_writer *mkwr (bool auto_dispose)
|
|||
wr_iid = ddsi_iid_gen ();
|
||||
memset (pwr, 0, sizeof (*pwr));
|
||||
nn_xqos_init_empty (xqos);
|
||||
nn_xqos_mergein_missing (xqos, &gv.default_xqos_wr);
|
||||
nn_xqos_mergein_missing (xqos, &gv.default_xqos_wr, ~(uint64_t)0);
|
||||
xqos->ownership_strength.value = 0;
|
||||
xqos->writer_data_lifecycle.autodispose_unregistered_instances = auto_dispose;
|
||||
pwr->e.iid = wr_iid;
|
||||
|
@ -170,7 +170,7 @@ static struct rhc *mkrhc (dds_reader *rd, dds_history_kind_t hk, int32_t hdepth,
|
|||
rqos.history.kind = hk;
|
||||
rqos.history.depth = hdepth;
|
||||
rqos.destination_order.kind = dok;
|
||||
nn_xqos_mergein_missing (&rqos, &gv.default_xqos_rd);
|
||||
nn_xqos_mergein_missing (&rqos, &gv.default_xqos_rd, ~(uint64_t)0);
|
||||
thread_state_awake (lookup_thread_state ());
|
||||
rhc = dds_rhc_new (rd, mdtopic);
|
||||
dds_rhc_set_qos(rhc, &rqos);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue