B2BITS FIX Antenna C++  2.27.0
Public Member Functions | List of all members
Bats::Application Class Referenceabstract

Represents BATS application. More...

#include <B2BITS_BatsApplication.h>

Public Member Functions

virtual UnitServicecreateService (const std::string &channelId, System::u8 unitId, const std::string &iface, const RuntimeParameters *params=NULL)=0
 Creates service by channel and unit id. More...
 
virtual UnitServicecreateService (const std::string &channelId, const std::string &symbol, const std::string &expiration, const std::string &putOrCall, const std::string &iface, const RuntimeParameters *params=NULL)=0
 Creates service by channel, and unit params. More...
 
virtual void createServices (const std::string &iface, const RuntimeParameters *params=NULL)=0
 Creates all services specified in configuration file. More...
 
virtual System::u8 findUnitId (const std::string &channelId, const std::string &symbol, const std::string &expiration, const std::string &putOrCall)=0
 Returns unit Id or throws if unit has not been configured. More...
 
virtual const RuntimeParametersgetChannelParams (const std::string &channelId) const =0
 Returns channel options. More...
 
virtual const RuntimeParametersgetParams () const =0
 Returns application parameters. More...
 
virtual UnitServicegetService (unsigned index) const =0
 Returns service by index. More...
 
virtual UnitServicegetService (const std::string &channelId, System::u8 unitId) const =0
 Returns service by channel and unit id. More...
 
virtual UnitServicegetService (const std::string &channelId, const std::string &symbol, const std::string &expiration, const std::string &putOrCall) const =0
 Returns service by channel, and unit params. More...
 
virtual unsigned getServicesCount () const =0
 Returns the number of created services. More...
 
virtual void release () const =0
 Destroys application. More...
 
virtual void removeService (const std::string &channelId, System::u8 unitId)=0
 Disconnects and destroys a service from the application. More...
 
virtual void removeServices ()=0
 Disconnects and destroys all services from the application. More...
 
virtual void setChannelParams (const std::string &channelId, const RuntimeParameters &params)=0
 Overrides application options for channel. More...
 

Detailed Description

Represents BATS application.

Member Function Documentation

◆ createService() [1/2]

virtual UnitService* Bats::Application::createService ( const std::string &  channelId,
System::u8  unitId,
const std::string &  iface,
const RuntimeParameters params = NULL 
)
pure virtual

Creates service by channel and unit id.

Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
unitIdId of the unit specified as unit@id attribute in XML configuration file
ifaceAddress of a local network interface to use when subscribing to multicast feed
paramsRuntime parameters, when specified, override current channel's parameters
Returns
pointer to created Bats::UnitService
Exceptions
Utils::Exceptionif error occurs, usually if service has been misconfigured
Note
If service has already been created this method is equal to getService(const std::string& channelId, System::u8 unitId) const

◆ createService() [2/2]

virtual UnitService* Bats::Application::createService ( const std::string &  channelId,
const std::string &  symbol,
const std::string &  expiration,
const std::string &  putOrCall,
const std::string &  iface,
const RuntimeParameters params = NULL 
)
pure virtual

Creates service by channel, and unit params.

Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
symbolSymbol to subscribe to. Proper unit will be found using unit@coderange attribute in XML configuration file
expirationunit@expiration attribute in XML configuration file
putOrCallunit@putorcall attribute in XML configuration file
ifaceAddress of a local network interface to use when subscribing to multicast feed
paramsRuntime parameters, when specified, override current channel's parameters
Returns
pointer to created Bats::UnitService
Exceptions
Utils::Exceptionif error occurs, usually if service has been misconfigured
Note
If service has already been created this method is equal to getService(const std::string& channelId, const std::string& symbol, const std::string& expiration, const std::string& putOrCall) const

◆ createServices()

virtual void Bats::Application::createServices ( const std::string &  iface,
const RuntimeParameters params = NULL 
)
pure virtual

Creates all services specified in configuration file.

Logs error message if some of the service have not been created

Parameters
ifaceAddress of a local network interface to use when subscribing to multicast feed
paramsRuntime parameters, when specified, override current channel's parameters
Exceptions
no

◆ findUnitId()

virtual System::u8 Bats::Application::findUnitId ( const std::string &  channelId,
const std::string &  symbol,
const std::string &  expiration,
const std::string &  putOrCall 
)
pure virtual

Returns unit Id or throws if unit has not been configured.

Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
symbolSymbol to subscribe to. Proper unit will be found using unit@coderange attribute in XML configuration file
expirationunit@expiration attribute in XML configuration file
putOrCallunit@putorcall attribute in XML configuration file
Returns
unit id
Exceptions
Utils::Exceptionif unit has not been configured

◆ getChannelParams()

virtual const RuntimeParameters& Bats::Application::getChannelParams ( const std::string &  channelId) const
pure virtual

Returns channel options.

Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
Returns
const reference to RuntimeParameters specified for particular channel
Exceptions
Utils::Exceptionif error occurs

◆ getParams()

virtual const RuntimeParameters& Bats::Application::getParams ( ) const
pure virtual

Returns application parameters.

Returns
const reference to RuntimeParameters passed to Engine::createBatsApplication
Exceptions
no

◆ getService() [1/3]

virtual UnitService* Bats::Application::getService ( unsigned  index) const
pure virtual

Returns service by index.

Returns service by zero based index

Parameters
indexZero-based index of the service, must be < getServicesCount()
Returns
pointer to Bats::UnitService or NULL if index is invalid
Exceptions
no

◆ getService() [2/3]

virtual UnitService* Bats::Application::getService ( const std::string &  channelId,
System::u8  unitId 
) const
pure virtual

Returns service by channel and unit id.

Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
unitIdId of the unit specified as unit@id attribute in XML configuration file
Returns
pointer to Bats::UnitService or NULL if service has not been created yet
Exceptions
no

◆ getService() [3/3]

virtual UnitService* Bats::Application::getService ( const std::string &  channelId,
const std::string &  symbol,
const std::string &  expiration,
const std::string &  putOrCall 
) const
pure virtual

Returns service by channel, and unit params.

Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
symbolSymbol to subscribe to. Proper unit will be found using unit@coderange attribute in XML configuration file
expirationunit@expiration attribute in XML configuration file
putOrCallunit@putorcall attribute in XML configuration file
Returns
pointer to Bats::UnitService or NULL if service has not been yet created
Exceptions
no

◆ getServicesCount()

virtual unsigned Bats::Application::getServicesCount ( ) const
pure virtual

Returns the number of created services.

You can get a signle service instance using getService(unsigned index) const method

Exceptions
no

◆ release()

virtual void Bats::Application::release ( ) const
pure virtual

Destroys application.

Disconnects and destroys all running services and threads.

Note
Method is synchronous and waits for threads to quit. Calling this method from one of incremental or worker threads will lead to deadlock.
Exceptions
no

◆ removeService()

virtual void Bats::Application::removeService ( const std::string &  channelId,
System::u8  unitId 
)
pure virtual

Disconnects and destroys a service from the application.

Note
Method is asynchronous, it returns immediately. Exact moment when service is removed can be handled with ApplicationListener::onServiceRemoved() notification. It is allowed to call this method from any thread.
Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
unitIdId of the unit specified as unit@id attribute in XML configuration file
Exceptions
Utils::Exceptionif error occurs

◆ removeServices()

virtual void Bats::Application::removeServices ( )
pure virtual

Disconnects and destroys all services from the application.

Note
Method is synchronous and waits for threads to quit. Calling this method from one of incremental or worker threads will lead to deadlock
Exceptions
no

◆ setChannelParams()

virtual void Bats::Application::setChannelParams ( const std::string &  channelId,
const RuntimeParameters params 
)
pure virtual

Overrides application options for channel.

Parameters
channelIdId of the channel, specified as channel@id attribute in XML configuration file
paramsparameters for particular channel
Exceptions
Utils::Exceptionif error occurs