RE: [Quickfix-developers] Re: IsSetField is not available in the C# assemblies
Brought to you by:
orenmnero
|
From: Rob K. <ro...@ri...> - 2003-06-24 14:31:38
|
I assume you would like to be able to do the following
//Example 1**********************************************************
MsgType mt =3D new MsgType();
if(message.getHeader().isSet(mt))
//a MsgType field exists and it's value is already in the mt variable
else
//the message does not contain a MsgType Field. just an example
//Example =
2**************************************************************
XmlData xd =3D new XmlData()
if(message.isSet(xd))
//an XmlData field exists and it's value is already in the mt variable
else
//the message does not contain a MsgType Field.
//***********************************************************************=
*
To get the above capability, paste the following code into the public =
sections of both the Message class and the Header class in the =
src/Net/message.h file. There is probably a better way to do this, =
which is why I never submitted it before, but it works well. it was =
Oren's suggestion for a quick Fix (no pun intended) that he gave me =
through this message board. Maybe he could add it to the release.
//begin copy
bool Message::isSet( StringField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
bool Message::isSet( BooleanField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
bool Message::isSet( CharField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
bool Message::isSet( IntField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
bool Message::isSet( DoubleField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
bool Message::isSet( UtcTimeStampField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
bool Message::isSet( UtcDateField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
bool Message::isSet( UtcTimeOnlyField* f){
try{getField(f);return true;}
catch(Exception & e){}
return false;
}
//end Copy
-----Original Message-----
From: sil...@tu... [mailto:sil...@tu...]
Sent: Tuesday, June 24, 2003 1:39 AM
To: mur...@pe...
Cc: qui...@li...
Subject: [Quickfix-developers] Re: IsSetField is not available in the C# =
assemblies
What do you mean?
How can I resolve this problem?
--- murphypa <murphypa@pe...> wrote:
> Re this topic:
>=20
> IsSetField is not available in the C# assemblies
> (neither on the Message=20
> nor on the Group classes).
> As I do not want to trap exceptions when I do not
> need to - I added the=20
> call to the Message
> and Group class headers.
>=20
> What is the recommended way of doing these
> additions?
>=20
> sincerely,
> mpa
|