EPAM B2BITS MarketData C++ library
1.0.0
|
This section describes the creation of a simple GTP application step by step.
Follow these instructions to get it to work:
Execute the following instruction to initialize market data engine.
The engine.properties file is required to read the engine configuration parameters. It must, by default, be present in the current directory. If the file is located elsewhere or has a different name specify the properties file name and path explicitly.
If an error occurs during initialization (the properties file is not found, a required property is missing etc.) the exception will be thrown.
An instance of Lse::Gtp::Application is created using an XML configuration file. The configuration file defines adaptor options, services and service options.
It is possible to have several instances of the Lse::Gtp::Application created at the same time. All the IO operations of all the services of an instance are processed by the same connection manager.
Define your application listener class to handle application level events:
Open the instance of Lse::Gtp::Application and specify a pointer to your application listener instance: application->open(&applicationListener);
If the XML configuration file was used, the services defined in it are created and added automatically. You can iterate through them or find a specific service by name:
The application listener is notified on events from the client thread - no synchronization is needed. However, if the same application listener is shared with several applications it may be notified from different concurrent client threads and synchronization may be needed.
Define your service listener class to handle service level events:
Connect the service to the market data and specify a pointer to your service listener instance:
The service listener is notified on events from different non-concurrent threads - no synchronization is needed. However, if the same service listener is shared with several services it can be notified from different concurrent threads and synchronization is needed.
application must be destroyed using the Application::release method or using the delete operator. The ngine must be stopped using the method B2bits::MD::Engine::destroy()