Re: [Quickfix-developers] How to set custom/user-defined fields
Brought to you by:
orenmnero
From: Oren M. <om...@ri...> - 2004-05-17 15:26:13
|
Nope, that should be passed as a reference. I made the change and did=20= a performance test and it actually doesn't make any difference, at=20 least when using an optimizer. My guess is the optimizer is smart=20 enough to know that if you are passing in a const object, it might as=20 well pass it in as a reference anyway. With the optimizer turned off=20 it there would be a significant difference. In any case I'll check in=20= the change. --oren On May 17, 2004, at 9:08 AM, Caleb Epstein wrote: > On Mon, May 17, 2004 at 09:00:48AM -0500, Vijay Singh Yadav wrote: > > > Hello All, This should be a fairly elementary question. How does one > > set a user-defined tag in a message (I need to do this for both > > NewOrderSingle and CancelReplace classses).=A0 We have a custom tag > > 9707 that needs to take a value 20 so I need to append 9707=3D20 to > > all the messages I have. My current code works but this is a new > > requirement I would like to introduce this change with minimal > > impact. > > =A0=A0=A0=A0=A0=A0=A0 Use one of these methods: > > =A0=A0=A0=A0=A0=A0=A0 FieldMap::setField (const FieldBase& field, bool = overwrite =3D=20 > true); > =A0=A0=A0=A0=A0=A0=A0 FieldMap::setField (int field, const = std::string value); > > =A0=A0=A0=A0=A0=A0=A0 The message classes all derive from FieldMap. > > =A0=A0=A0=A0=A0=A0=A0 Oren: any reason the second form of setField = takes a "const > =A0=A0=A0=A0=A0=A0=A0 std::string" and not a "const std::string&"? > > --=20 > Caleb Epstein |=A0 bklyn . org=A0 | Military secrets are the most = fleeting=20 > of all. > =A0=A0=A0 cae at=A0=A0=A0 | Brooklyn Dust | =A0=A0=A0=A0=A0=A0=A0 = =A0=A0=A0=A0=A0=A0=A0 -- Spock, "The=20 > Enterprise > bklyn dot org |=A0=A0 Bunny Mfg.=A0 | =A0=A0=A0=A0=A0=A0=A0 =A0=A0=A0=A0= =A0=A0=A0 Incident", stardate=20 > 5027.4 > > > > ------------------------------------------------------- > This SF.Net email is sponsored by: SourceForge.net Broadband > Sign-up now for SourceForge Broadband and get the fastest > 6.0/768 connection for only $19.95/mo for the first 3 months! > http://ads.osdn.com/?ad_id=3D2562&alloc_id=3D6184&op=3Dclick > _______________________________________________ > Quickfix-developers mailing list > Qui...@li... > https://lists.sourceforge.net/lists/listinfo/quickfix-developers |