B2BITS CME MDP Handler API Reference
Public Member Functions | Protected Member Functions | List of all members
Channel Class Referenceabstract

Channel. More...

#include <B2BITS_CmeMdpChannel.h>

Public Member Functions

virtual MarketDataServicegetService () const =0
 Returns owning market data service. More...
 
virtual ChannelID getId () const =0
 Returns channel id. More...
 
virtual const ChannelOptionsgetOptions () const =0
 Returns channel options. More...
 
virtual ResolvergetResolver ()=0
 Returns default resolver. More...
 
virtual ResolvergetResolver (const std::string &id)=0
 Returns resolver by id. More...
 
virtual void getResolvers (ResolverVector *resolverVector)=0
 Returns all resolvers of the channel. More...
 
virtual ResolverfindResolver (const std::string &id)=0
 Finds resolver by id. More...
 
virtual ResolveraddResolver (const std::string &id)=0
 Adds a new resolver to the channel. More...
 
virtual void removeResolver (const std::string &id)=0
 Removes resolver from the channel. More...
 
virtual void removeResolvers ()=0
 Removes all resolvers from the channel. More...
 
virtual InstrumentgetInstrument (const std::string &symbol)=0
 Returns instrument by symbol. More...
 
virtual InstrumentgetInstrument (InstrumentID id)=0
 Returns instrument by id. More...
 
virtual void getInstruments (InstrumentVector &instrumentVector)=0
 Returns all instruments of the channel. More...
 
virtual InstrumentfindInstrument (const std::string &symbol)=0
 Finds instrument by symbol. More...
 
virtual InstrumentfindInstrument (InstrumentID id)=0
 Finds instrument by id. More...
 
virtual InstrumentaddInstrument (const std::string &symbol, InstrumentID id, const InstrumentOptions &instrumentOptions)=0
 Adds a new instrument to the channel. More...
 
virtual InstrumentaddInstrument (const std::string &symbol, InstrumentID id, const InstrumentOptions &instrumentOptions, InstrumentBuildOptions instrumentBuildOptions)=0
 Adds a new instrument to the channel. More...
 
virtual InstrumentaddInstrument (const InstrumentDefinition *instrumentDefinition)=0
 Adds a new instrument to the channel based on an instrument definition object. More...
 
virtual InstrumentaddInstrument (const InstrumentDefinition *instrumentDefinition, InstrumentBuildOptions instrumentBuildOptions)=0
 Adds a new instrument to the channel based on an instrument definition object. More...
 
virtual InstrumentaddInstrument (const MessageHeader &message)=0
 Adds a new instrument to the channel based on an instrument definition message. More...
 
virtual InstrumentaddInstrument (const MessageHeader &message, InstrumentBuildOptions instrumentBuildOptions)=0
 Adds a new instrument to the channel based on an instrument definition message. More...
 
virtual void removeInstrument (const std::string &symbol)=0
 Removes instrument from the channel. More...
 
virtual void removeInstrument (InstrumentID id)=0
 Removes instrument from the channel. More...
 
virtual void removeInstruments ()=0
 Removes all instruments from the channel. More...
 
virtual bool connectedInstrumentDefinitionData () const =0
 Indicates if the channel instrument definition data is connected. More...
 
virtual void connectInstrumentDefinitionData (ChannelDataListener *dataListener)=0
 Connects to the instrument definition data feeds of the channel. More...
 
virtual void disconnectInstrumentDefinitionData ()=0
 Disconnects from the instrument definition data feeds of the channel. More...
 
virtual bool connectedSnapshotData () const =0
 Indicates if the channel snapshot data is connected. More...
 
virtual void connectSnapshotData (ChannelDataListener *dataListener)=0
 Connects to the snapshot data feeds of the channel. More...
 
virtual void disconnectSnapshotData ()=0
 Disconnects from the snapshot data feeds of the channel. More...
 
virtual bool connectedIncrementalData () const =0
 Indicates if the channel incremental data is connected. More...
 
virtual void connectIncrementalData (ChannelDataListener *dataListener)=0
 Connects to the incremental data feeds of the channel. More...
 
virtual void disconnectIncrementalData ()=0
 Disconnects from the incremental data feeds of the channel. More...
 
virtual void getStatistics (ChannelStatistics &statistics)=0
 Returns channel statistics. More...
 
virtual void setTag (Tag tag)=0
 Assigns user tag to the channel. More...
 
virtual Tag getTag () const =0
 Returns channel user tag. More...
 
virtual void attachListener (ChannelListener *listener)=0
 Attaches event listener. More...
 

Protected Member Functions

virtual ~Channel ()
 

Detailed Description

Channel object provides access to market data of a particular CME channel. Channel object maintains a collection of resolvers and a collection of instruments.

Constructor & Destructor Documentation

virtual ~Channel ( )
inlineprotectedvirtual

Member Function Documentation

virtual MarketDataService* getService ( ) const
pure virtual
Returns
Reference to the market data service instance.
virtual ChannelID getId ( ) const
pure virtual
Returns
Id of the channel.
virtual const ChannelOptions& getOptions ( ) const
pure virtual
Returns
Options of the channel.
virtual Resolver* getResolver ( )
pure virtual
Returns
Reference to the default resolver.
virtual Resolver* getResolver ( const std::string &  id)
pure virtual
Parameters
idId of the resolver to return.
Returns
Reference to the resolver.
Exceptions
Generatesexception if the resolver doesn't exist.
virtual void getResolvers ( ResolverVector resolverVector)
pure virtual
Parameters
resolverVectorVector of resolver references to fill.
virtual Resolver* findResolver ( const std::string &  id)
pure virtual
Parameters
idId of the resolver to return.
Returns
Reference to the resolver. Returns null if the resolver doesn't exist.
virtual Resolver* addResolver ( const std::string &  id)
pure virtual
Parameters
idUnique id of the resolver to add.
Returns
Reference to the resolver added.
Exceptions
Generatesexception if the resolver already exists.
virtual void removeResolver ( const std::string &  id)
pure virtual
Parameters
idid of the resolver to remove.
virtual void removeResolvers ( )
pure virtual
virtual Instrument* getInstrument ( const std::string &  symbol)
pure virtual
Parameters
idSymbol of the instrument to return.
Returns
Reference to the instrument.
Exceptions
Generatesexception if the instrument doesn't exist.
virtual Instrument* getInstrument ( InstrumentID  id)
pure virtual
Parameters
idId of the instrument to return,
Returns
Reference to the instrument.
Exceptions
Generatesexception if the instrument doesn't exist.
virtual void getInstruments ( InstrumentVector instrumentVector)
pure virtual
Parameters
instrumentVectorVector of instrument references to fill.
virtual Instrument* findInstrument ( const std::string &  symbol)
pure virtual
Parameters
idSymbol of the instrument to return.
Returns
Reference to the instrument. Returns null if the instrument doesn't exist.
virtual Instrument* findInstrument ( InstrumentID  id)
pure virtual
Parameters
idId of the instrument to return,
Returns
Reference to the instrument. Returns null if the instrument doesn't exist.
virtual Instrument* addInstrument ( const std::string &  symbol,
InstrumentID  id,
const InstrumentOptions instrumentOptions 
)
pure virtual

All instrument build options are enabled.

Parameters
symbolUnique name of the instrument to add.
idUnique id of the instrument to add.
optionsInstrument options.
Returns
Reference to the instrument added.
Exceptions
Generatesexception if the instrument already exists.
virtual Instrument* addInstrument ( const std::string &  symbol,
InstrumentID  id,
const InstrumentOptions instrumentOptions,
InstrumentBuildOptions  instrumentBuildOptions 
)
pure virtual
Parameters
symbolUnique name of the instrument to add.
idUnique id of the instrument to add.
optionsInstrument options.
Returns
Reference to the instrument added.
Exceptions
Generatesexception if the instrument already exists.
virtual Instrument* addInstrument ( const InstrumentDefinition instrumentDefinition)
pure virtual

All instrument build options are enabled.

Parameters
instrumentDefinitionInstrument definition to derive instrument options from.
Returns
Reference to the instrument added.
Exceptions
Generatesexception if the instrument already exists.
Note
This overload is intended to add instrument from Resolver::onEvent callback.
virtual Instrument* addInstrument ( const InstrumentDefinition instrumentDefinition,
InstrumentBuildOptions  instrumentBuildOptions 
)
pure virtual
Parameters
instrumentDefinitionInstrument definition to derive instrument options from.
instrumentBuildOptionsInstrument build options.
Returns
Reference to the instrument added.
Exceptions
Generatesexception if the instrument already exists.
Note
This overload is intended to add instrument from Resolver::onEvent callback.
virtual Instrument* addInstrument ( const MessageHeader message)
pure virtual

All instrument build options are enabled.

Parameters
instrumentMessageInstrument definition (d) message to derive instrument options from.
Returns
Reference to the instrument added.
Exceptions
Generatesexception if the instrument already exists.
Note
This overload is intended to add instrument from Resolver::onMessage callback.
virtual Instrument* addInstrument ( const MessageHeader message,
InstrumentBuildOptions  instrumentBuildOptions 
)
pure virtual
Parameters
instrumentMessageInstrument definition (d) message to derive instrument options from.
instrumentBuildOptionsInstrument build options.
Returns
Reference to the instrument added.
Exceptions
Generatesexception if the instrument already exists.
Note
This overload is intended to add instrument from Resolver::onMessage callback.
virtual void removeInstrument ( const std::string &  symbol)
pure virtual
Parameters
Symbolof the instrument to remove.
virtual void removeInstrument ( InstrumentID  id)
pure virtual
Parameters
Idof the instrument to remove.
virtual void removeInstruments ( )
pure virtual
virtual bool connectedInstrumentDefinitionData ( ) const
pure virtual
Returns
True if the channel instrument definition data is connected.
virtual void connectInstrumentDefinitionData ( ChannelDataListener dataListener)
pure virtual
Parameters
listenerReference to callback interface to listen to channel data events. The listener must stay alive until the disconnectInstrumentDefinitionData method is called.
virtual void disconnectInstrumentDefinitionData ( )
pure virtual
virtual bool connectedSnapshotData ( ) const
pure virtual
Returns
True if the channel snapshot data is connected.
virtual void connectSnapshotData ( ChannelDataListener dataListener)
pure virtual
Parameters
listenerReference to callback interface to listen to channel data events. The listener must stay alive until the disconnectSnapshotData method is called.
virtual void disconnectSnapshotData ( )
pure virtual
virtual bool connectedIncrementalData ( ) const
pure virtual
Returns
True if the channel incremental data is connected.
virtual void connectIncrementalData ( ChannelDataListener dataListener)
pure virtual
Parameters
listenerReference to callback interface to listen to channel data events. The listener must stay alive until the disconnectIncrementalData method is called.
virtual void disconnectIncrementalData ( )
pure virtual
virtual void getStatistics ( ChannelStatistics statistics)
pure virtual
Parameters
statisticsReference to ChannelStatistics structure to fill.
virtual void setTag ( Tag  tag)
pure virtual
Parameters
tagTag value.
virtual Tag getTag ( ) const
pure virtual
Returns
Tag value.
virtual void attachListener ( ChannelListener listener)
pure virtual

Listener can be assigned only once and cannot be reset.

Parameters
listenerListener