EMA C++ Developers Guide : 5 Provider Classes : 5.1 OmmProvider Class : 5.1.7 Interactive Provider Example: Working with the OmmProvider Class
 
5.1.7 Interactive Provider Example: Working with the OmmProvider Class
The following example illustrates the simplest interactive application managing the OmmProvider class.
 
 
try
    {
        AppClient appClient;
 
        OmmProvider provider( OmmIProviderConfig().port( "14002" ), appClient );
 
        while ( itemHandle == 0 ) sleep(1000);
 
        for ( Int32 i = 0; i < 60; i++ )
        {
            provider.submit( UpdateMsg().domainType( MMT_MARKET_BY_ORDER ).payload( Map()
                .addKeyAscii( OrderNr, MapEntry::UpdateEnum, FieldList()
                    .addRealFromDouble( 3427, 7.76 + i * 0.1, OmmReal::ExponentNeg2Enum )
                    .addRealFromDouble( 3429, 9600 )
                    .addEnum( 3428, 2 )
                    .addRmtes( 212, EmaBuffer( "Market Maker", 12 ) )
                    .complete() )
                .complete() ), itemHandle );
 
            sleep( 1000 );
        }
    }
    catch ( const OmmException& excp )
    {
        cout << excp << endl;
    }
 
    return 0;