Re: [Quickfix-developers] ExecutionReport
Brought to you by:
orenmnero
From: Caleb E. <ca...@bk...> - 2004-04-20 17:42:39
|
On Tue, Apr 20, 2004 at 07:12:29PM +0200, Bjo...@ub... wrote: > Hello, according to the fix documentation one should get a compiler > warning when accessing a tag, which is not defined for a message. > > Here an extract from the documentation: > void onMessage( const FIX41::NewOrderSingle& message, const FIX::SessionID& > ) > { > FIX::ClOrdID clOrdID; > message.get(clOrdID); > > // compile time error!! field not defined in FIX41 > FIX::ClearingAccount clearingAccount; > message.get(clearingAccount); > } > > When using something like this: > void FixApplication::onMessage( const FIX43::ExecutionReport& message, > const FIX::SessionID& sessionID) > { > > FIX::TradeRequestID toto; > message.getField( toto ); > > } > > I don't get any warnings. If you used "get" and not "getField" you would get a warning (perhaps an error?). The generic "getField" method will work with any class derived from FieldBase (though it will throw an exception if the field is not in the messsage). The type-safe, message-specific "get" methods are only provided for fields which are specified as being part of the message. -- Caleb Epstein | bklyn . org | BOFH excuse #64: cae at | Brooklyn Dust | bklyn dot org | Bunny Mfg. | CPU needs recalibration |