Skip to main content

dds_create_domain

Function dds_create_domain 

Source
pub unsafe extern "C" fn dds_create_domain(
    domain: dds_domainid_t,
    config: *const c_char,
) -> dds_entity_t
Expand description

@brief Creates a domain with a given configuration @ingroup domain @component domain

To explicitly create a domain based on a configuration passed as a string. A domain created in this manner must be explicitly deleted by calling @ref dds_delete on the domain (or on DDS_CYCLONEDDS_HANDLE).

It will not be created if a domain with the given domain id already exists. This could have been created implicitly by a previous call to this function, @ref dds_create_participant or @ref dds_create_domain_with_rawconfig.

The domain configuration is constructed by amending the default configuration with the Domain configuration (fragments) for which the domain id is specifed as β€œany” and those for which the domain id matches the specified domain id in the order in which they are encountered in the configuration.

Using NULL or β€œβ€ as config will create a domain with default settings.

@param[in] domain The domain to be created. DDS_DEFAULT_DOMAIN is not allowed. @param[in] config A configuration string containing file names and/or XML fragments representing the configuration.

@returns A valid entity handle or an error code.

@retval DDS_RETCODE_BAD_PARAMETER Illegal value for domain id or the configfile parameter is NULL. @retval DDS_RETCODE_PRECONDITION_NOT_MET The domain already existed and cannot be created again. @retval DDS_RETCODE_ERROR An internal error has occurred.