Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Service_Participant does not use ConfigStore #4138

Merged
merged 1 commit into from May 19, 2023

Conversation

jrw972
Copy link
Contributor

@jrw972 jrw972 commented May 9, 2023

Problem

The Service_Participant does not use the ConfigStore. See #4134.

Solution

Convert the Service_Participant to use the ConfigStore.

  • Methods that returned references to configuration values in Service_Participant have been removed.

  • Various strings have changed type.

  • Each configuration value has a canonical name starting with OPENDDS. The rest of the name is taken from its position in the config file by considering the section name. Camelcase is converted into all-caps with underscores. The canonical name resembles an environment variable to enable eventual support for environment variables. See Service_Participant.h for the current list of configuration values.

  • Argument parsing has been consolidated. Arguments starting with -DCPS, -Federation, or -OPENDDS are canonicalized and added to the ConfigStore. -DCPS and -Federation options are prefix with OPENDDS_COMMON_. The ability to passes options via -OPENDDS means that any configuration value can be changed via the command line once all modules have adopted the ConfigStore.

  • The configuration file is loaded into the ConfigStore. The section name and key are concatenated and canonicalized.

  • Configuration that involved more than setting a value has been implemented via an Internal DDS Listener. The appropriate values are written into the ConfigStore and then the listener is manually invoked for the changes. It is possible to set the listener for the reader if it is necessary to react to changes after the initial configuration.

@jrw972 jrw972 self-assigned this May 9, 2023
@jrw972 jrw972 force-pushed the internal-dds-improvements branch 5 times, most recently from 4f7226a to d114d93 Compare May 11, 2023 20:51
@iguessthislldo
Copy link
Member

  • Arguments starting with -DCPS, -Federation, or -OPENDDS are canonicalized and added to the ConfigStore. -DCPS and -Federation options are prefix with OPENDDS_COMMON_.

-OPENDDS isn't really consistent with existing arguments and capitalization and underscores should be avoided in command line arguments. I'd prefer --opendds-. but -OpenDDS would be consistent with what we already have.

@jrw972 jrw972 force-pushed the internal-dds-improvements branch 3 times, most recently from 1bc5cf1 to 5f219cf Compare May 15, 2023 17:37
dds/DCPS/Service_Participant.h Show resolved Hide resolved
dds/DCPS/Service_Participant.h Show resolved Hide resolved
dds/DCPS/Service_Participant.h Outdated Show resolved Hide resolved
dds/DCPS/Service_Participant.h Outdated Show resolved Hide resolved
@jrw972 jrw972 force-pushed the internal-dds-improvements branch 2 times, most recently from 1b2acec to 10f66c7 Compare May 17, 2023 14:35
dds/DCPS/Service_Participant.cpp Outdated Show resolved Hide resolved
dds/DCPS/Service_Participant.h Show resolved Hide resolved
@jrw972 jrw972 force-pushed the internal-dds-improvements branch 3 times, most recently from eefe48d to 8e20e64 Compare May 18, 2023 14:08
}

void
Service_Participant::n_chunks(size_t chunks)
{
n_chunks_ = chunks;
got_chunks = true;
config_store_.set_uint32(OPENDDS_COMMON_DCPS_CHUNKS, chunks);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Narrowing warnings here and below

dds/DCPS/Service_Participant.h Show resolved Hide resolved
Problem
-------

The `Service_Participant` does not use the `ConfigStore`.  See OpenDDS#4134.

Solution
--------

Convert the `Service_Participant` to use the `ConfigStore`.

* Methods that returned references to configuration values in
  `Service_Participant` have been removed.

* Various strings have changed type.

* Each configuration value has a canonical name starting with
  `OPENDDS`.  The rest of the name is taken from its position in the
  config file by considering the section name.  Camelcase is converted
  into all-caps with underscores.  The canonical name resembles an
  environment variable to enable eventual support for environment
  variables.  See `Service_Participant.h` for the current list of
  configuration values.

* Argument parsing has been consolidated.  Arguments starting with
  `-DCPS`, `-Federation`, or `-OpenDDS` are canonicalized and added to
  the `ConfigStore`.  `-DCPS` and `-Federation` options are prefixed
  with `OPENDDS_COMMON_`.  `-OpenDDS` options are prefixed with
  "OPENDDS_" after stripping `-OpenDDS`.  The ability to pass options
  via `-OpenDDS` means that any configuration value can be changed via
  the command line once all modules have adopted the `ConfigStore`.

* The configuration file is loaded into the `ConfigStore`.  The
  section name and key are concatenated and canonicalized.

* Configuration that involved more than setting a value has been
  implemented via an Internal DDS Listener.  The appropriate values
  are written into the `ConfigStore` and then the listener is manually
  invoked for the changes.  It is possible to set the listener for the
  reader if it is necessary to react to changes after the initial
  configuration.
@jrw972 jrw972 force-pushed the internal-dds-improvements branch from 8e20e64 to aa103fb Compare May 19, 2023 14:51
@jrw972 jrw972 merged commit caedb74 into OpenDDS:master May 19, 2023
120 of 124 checks passed
@jrw972 jrw972 deleted the internal-dds-improvements branch November 21, 2023 15:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants