Author |
Message
|
satyasheel15 |
Posted: Mon May 10, 2004 12:29 pm Post subject: Parsing the element |
|
|
Voyager
Joined: 04 Mar 2003 Posts: 86
|
Question:
We have one message coming which has a 64 bit message header. Each bit represent the presence and absence of a particular field in the message body. We are trying to see how best to design a message set for working with this message.
Do we have to use BLOB or there exists any other alternatives.
Regards
Sheel |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 10, 2004 12:35 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
So you have a message that has two sections, a header with 64 booleans and a body with the rest of your data fields.
So model it that way. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
satyasheel15 |
Posted: Mon May 10, 2004 12:44 pm Post subject: |
|
|
Voyager
Joined: 04 Mar 2003 Posts: 86
|
Thanks for the prompt reply.
I understand that we can model in the message set by that way. But in the ESQL , how to handle 64 bit header of the message without using the BLOB. Using the blob is not the correct alternative so we are looking for alternative scenario. Please suggest.
Regards |
|
Back to top |
|
 |
jefflowrey |
Posted: Mon May 10, 2004 12:59 pm Post subject: |
|
|
Grand Poobah
Joined: 16 Oct 2002 Posts: 19981
|
Hrm.
It's not clear that you can model at the bit level, only at the byte level. _________________ I am *not* the model of the modern major general. |
|
Back to top |
|
 |
wooda |
Posted: Tue May 11, 2004 12:36 am Post subject: |
|
|
 Master
Joined: 21 Nov 2003 Posts: 265 Location: UK
|
Hi Sheel ,
The way to do this would be to bring in the message as a BLOB.
Expand the 64 bit fields into 64 integer fields (1 byte each).
Reconstruct the bitstream with the 64 1 byte integers followed by the rest of the unparsed message body (ie the bit after the 64 bit fields).
Then reparse the whole lot against a message set which has 64 integers followed by your other fields each set to repeat value of (a.k.a repeat reference) the corresponding integer (previously bit fields).
So fields which are missing will have a corresponding repeat reference intger set to 0 and those which are present will have a corresponding repeat reference integer set to 1. |
|
Back to top |
|
 |
JLRowe |
Posted: Tue May 11, 2004 7:29 am Post subject: |
|
|
 Yatiri
Joined: 25 May 2002 Posts: 664 Location: South East London
|
Also, watch out for endian-ness!
On some platforms 1 is bit 0, 128 is bit 7, some others have 1 as bit 7 and 128 as bit 0. |
|
Back to top |
|
 |
|