EPAM B2BITS ICE Impact Handler C++  1.1.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Groups Pages
Public Member Functions | List of all members
IceImpact::UnitService Class Referenceabstract

Represents UDP Multicast Service (one UDP multicast group with live data) More...

#include <B2BITS_IceImpactUnitService.h>

Public Member Functions

virtual ApplicationgetApplication () const =0
 Returns a pointer to Application object. More...
 
virtual const std::string & getChannelID () const =0
 Returns channel id. More...
 
virtual const int getPort () const =0
 Returns service port. More...
 
virtual BookDepth getBookDepth () const =0
 Returns book depth. More...
 
virtual const RuntimeParametersgetParams () const =0
 Returns parameters. More...
 
virtual void connect ()=0
 
virtual void disconnect ()=0
 
virtual bool isConnected ()=0
 Returns true if service is in connected state. More...
 
virtual void subscribeToInstrument (unsigned marketID, subscription_mask_t subscrMask, unsigned long long UserCookie)=0
 
virtual void unsubscribeFromInstrument (unsigned marketID, subscription_mask_t subscrMask=SubscriptionType::ALL, bool disconnectIfNoMoreSubscribed=true)=0
 
virtual bool getInstrumentBBO (unsigned marketID, BBOSnapshot &bbo)=0
 Returns true on success. More...
 
virtual bool getInstrumentTOP5Prices (unsigned marketID, TOP5PriceData &top5data, unsigned long long *UserCookie)=0
 
virtual bool getInstrumentTOP10Prices (unsigned marketID, TOP10PriceData &top10data, unsigned long long *UserCookie)=0
 
virtual bool getSubscription (unsigned marketID, subscription_mask_t &mask)=0
 Returns true on success. More...
 
virtual void subscribeToAllInstruments (subscription_mask_t subscrMask, unsigned long long UserCookie)=0
 
virtual void unsubscribeFromAllInstruments (subscription_mask_t subscrMask=SubscriptionType::ALL, bool disconnectIfNoMoreSubscribed=true)=0
 
virtual unsigned getEventFlowId ()=0
 

Detailed Description

Represents UDP Multicast Service (one UDP multicast group with live data)

Member Function Documentation

virtual void IceImpact::UnitService::connect ( )
pure virtual

Connects the service to the mutlicast group Note: this function should not be called from user callbacks (onBBO(), etc) to avoid potental deadlock situation Starts all threads required by the service. Service becomes connected to UDP multicast group

Exceptions
std::exceptionif error occurs
See Also
isConnected(), disconnect()
virtual void IceImpact::UnitService::disconnect ( )
pure virtual

Disconnects the service from the mutlicast group. Note: this function should not be called from user callbacks (onBBO(), etc) to avoid potental deadlock situation This method returns returns immediately, service becomes disconnected.

Exceptions
no
See Also
isConnected(), connect()
virtual Application* IceImpact::UnitService::getApplication ( ) const
pure virtual

Returns a pointer to Application object.

Returns
IceImpact::Application that owns this service
Exceptions
no
virtual BookDepth IceImpact::UnitService::getBookDepth ( ) const
pure virtual

Returns book depth.

Returns
book depth
Exceptions
no
virtual const std::string& IceImpact::UnitService::getChannelID ( ) const
pure virtual

Returns channel id.

Returns
Id of the channel
Exceptions
no
virtual unsigned IceImpact::UnitService::getEventFlowId ( )
pure virtual

Returns the event flow id assigned to this service. This value is set in eventFlowId member of Events passed to the user in callbacks. eventFlowId is assigned once when the service is first connected and does not change until IceImpact::Application::release is called.

Returns
unsigned
Exceptions
none
virtual bool IceImpact::UnitService::getInstrumentBBO ( unsigned  marketID,
BBOSnapshot bbo 
)
pure virtual

Returns true on success.

See Also
Application::getInstrumentBBO
Parameters
marketID
bbo
Returns
boolean
Exceptions
std::exception
virtual bool IceImpact::UnitService::getInstrumentTOP10Prices ( unsigned  marketID,
TOP10PriceData top10data,
unsigned long long *  UserCookie 
)
pure virtual

getInstrumentTOP10Prices by marketID With SubscriptionParams::tickerPlantMode enabled returns data regardless if instrument was previously subscribed or not.

See Also
getInstrumentTOP5Prices
Parameters
marketIDto get data for
top10dataTOP10 levels of the price book
UserCookieUser cookie supplied when subscribing to the insttrument
Returns
true if instrument is found, false otherwise
Exceptions
std::runtime_error
virtual bool IceImpact::UnitService::getInstrumentTOP5Prices ( unsigned  marketID,
TOP5PriceData top5data,
unsigned long long *  UserCookie 
)
pure virtual

getInstrumentTOP5Prices by marketID With SubscriptionParams::tickerPlantMode enabled returns data regardless if instrument was previously subscribed or not.

See Also
getInstrumentTOP10Prices
Parameters
marketIDto get data for
top5dataTOP5 levels of the price book
UserCookieUser cookie supplied when subscribing to the insttrument
Returns
true if instrument is found, false otherwise
Exceptions
std::runtime_error
virtual const RuntimeParameters& IceImpact::UnitService::getParams ( ) const
pure virtual

Returns parameters.

Returns
Parameters used by service
Exceptions
no
virtual const int IceImpact::UnitService::getPort ( ) const
pure virtual

Returns service port.

Returns
service port
Exceptions
no
virtual bool IceImpact::UnitService::getSubscription ( unsigned  marketID,
subscription_mask_t mask 
)
pure virtual

Returns true on success.

See Also
Application::getSubscription
Parameters
marketIDInstrument to query
maskSubscription mask
Returns
boolean
Exceptions
std::exception
virtual bool IceImpact::UnitService::isConnected ( )
pure virtual

Returns true if service is in connected state.

Returns
true if service is connected
Exceptions
no
See Also
connect(), disconnect()
virtual void IceImpact::UnitService::subscribeToAllInstruments ( subscription_mask_t  subscrMask,
unsigned long long  UserCookie 
)
pure virtual

Subscribes to all instruments.

See Also
Application::subscribeToAllInstruments Note: this function should not be called from user callbacks (onBBO(), etc) to avoid potental deadlock situation. The subscription mask and UserCookie parameters passed override the defaultSubscriptionMask and defaultUserCookie from SubscriptionParams structure respectively.
Parameters
subscrMask
UserCookie
Returns
void
Exceptions
std::exception
virtual void IceImpact::UnitService::subscribeToInstrument ( unsigned  marketID,
subscription_mask_t  subscrMask,
unsigned long long  UserCookie 
)
pure virtual

Subscribes by marketID. This call OR's current instrument subscription mask with the passed value. Note: this function should not be called from user callbacks (onBBO(), etc) to avoid potental deadlock situation

See Also
Application::subscribeToInstrument
Parameters
marketIDto subscribe to
subscrMask
UserCookie
Returns
void
Exceptions
std::exception
virtual void IceImpact::UnitService::unsubscribeFromAllInstruments ( subscription_mask_t  subscrMask = SubscriptionType::ALL,
bool  disconnectIfNoMoreSubscribed = true 
)
pure virtual

Unsubscribes from all instruments.

See Also
Application::unsubscribeFromAllInstruments Note: this function should not be called from user callbacks (onBBO(), etc) to avoid potental deadlock situation
Parameters
subscrMasksubscription mask to use
disconnectIfNoMoreSubscribedwill disconnect the service from UDP Multicast source if there's no more instruments subscribed provided service is not in ticker plant mode
See Also
SubscriptionParams::tickerPlantMode
Returns
void
Exceptions
std::exception
virtual void IceImpact::UnitService::unsubscribeFromInstrument ( unsigned  marketID,
subscription_mask_t  subscrMask = SubscriptionType::ALL,
bool  disconnectIfNoMoreSubscribed = true 
)
pure virtual

Unsubscribes by marketID. This call removes passed subscriptions bits from the current instrument's subscription mask. Note: this function should not be called from user callbacks (onBBO(), etc) to avoid potental deadlock situation

See Also
Application::unsubscribeFromInstrument
Parameters
marketIDto unsubscribe from
subscrMasksubscription mask to use
disconnectIfNoMoreSubscribedwill disconnect the service from UDP Multicast source if this has been the last instrument subscribed provided service is not in ticker plant mode
See Also
SubscriptionParams::tickerPlantMode
Returns
void
Exceptions
std::exception