Skip to content

Code for #30 - encapsulate host/port/... in a structure...

Created a NDS::parameters object as part of the public API. Instances of this type contain connection parameters (host/port/gap handling/...). This object pulls default configuration from the environment, allowing the user to default the connection completely.

To connect with all values taken from the environment you would call:

NDS::connection conn(NDS::parameters());

This will pull from NDS2_CLIENT_HOSTNAME + NDS2_CLIENT_PORT first (as as they are more specific) and then from NDSSERVER for host/port details.

Remove the get_parameter/set_parameter calls. Remove the get_host/ get_port/get_connection calls. These calls are now forwarded to the parameters object. Try to minimize the api surface of a connection object.

conn->get_host() translates to conn->parameters().host() conn->get_protocol() translates to conn->parameters.protocol() conn->set_parameter("GAP_HANDLER", "ABORT_HANDLER") translates to conn->parameters().set("GAP_HANDLER", "ABORT_HANDLER")

The parameters object may be copied or moved. The idea is that this object can be used to initialize multiple connections. Either explicitly by the user, or implicitly by the system if we move to a 'connectionless' connection object.

The get_host/get_parameter/... calls were not removed from the SWIG layer as they are required for backwards compatibility. A new connection.parameters() call was added, and a connection constructor taking a parameters object as also added.

This commit adds several new test files as well.

This obsoletes and replaces !5 (closed)

Merge request reports