Accessing providers through PiPS

The PiPS Client API allows applications to obtain a list of providers that have been registered with the framework. Applications can then initialize the providers they want to use and begin exchanging data with other endpoints connected to the same encapsulated services.

The following code sample shows how to query the list of registered providers, iterate through the list and initialize each one, and obtain a handle to the default provider:
int i ;
pips_provider_t* provider ;
const char* const* registered_providers ;
int num_providers = pips_get_registered_providers( 
        &registered_providers ) ;

for ( i = 0 ; i < num_providers ; ++i ) {
    /* Initialize the i-th provider. */
    pips_provider_t* provider = pips_get_provider( 
        registered_providers[ i ] ) ;

    pips_init_provider( provider, NULL, NULL ) ;
}

/* Get the default provider. */
provider = pips_get_provider( NULL ) ;

This strategy is useful when you want to initialize all providers so you can use any of them later but start using the default provider right away. You would likely put this code near the beginning of your program, in the setup section.