Re: [Quickfix-developers] catch getField business rejects
Brought to you by:
orenmnero
|
From: Caleb E. <cal...@gm...> - 2005-11-22 19:21:50
|
On 11/22/05, Reiner Nix <rei...@ma...> wrote:
>
> Having get and set method without throwing an exception but able to manag=
e
> null values. So a setFieldXXX (null) should suppress submitting the value
> in
> the FIX message where getFieldXXX() for an unset value should return null=
.
I don't think this particular interface would work in C++ (we're dealing
with either FIX::FieldBase or std::string objects and there is no "null").
It would be possible to provide some additional getField/setField overloads
in FieldMap that would do what you want though:
namespace FIX {
struct nothrow {};
class FieldMap {
...
bool getField (FieldBase& field, nothrow) // doesn't throw; returns true is
hasField (field)
bool getField (int field, std::string&) // doesn't throw, returns true if
hasField (field)
I can't really see the value in them, but these could also be added:
bool setField (const FieldBase&, nothrow) // doesn't throw (and has no
effect) if value is empty
bool setField (int field, const std::string& value, nothrow) // same as
above
If people really want these interfaces they'd be very simple to add.
--
Caleb Epstein
caleb dot epstein at gmail dot com
|