Thursday, 15 September 2011

.net - How to Iterate Through Array in C# Across Multiple Calls -


We have an application where we should de-serial some data from multiple streams into multiple objects.

The data array shows many messages of the variable length packaged together. No code in the stream is deletering

We want to do something like this:

  Zero decode (byte [] data) {Object0.ExtractMessage (data); Object1.ExtractMessage (data); Object2.ExtractMessage (data); ...}  

where each process data call knows where to start in the array. Ideally we do this without giving it in the DataIx context.

To do this, in C ++ we will just keep the hand around an indicator in the array, and each processed function will increase, as necessary

Every object class knows that the stream How to back up the points at the beginning of the next message of how their own messages are serialized and can be trusted (in C ++)

Is there some built-in mechanism in it that we can do ( unsafe without having to do this)? The operation is high frequency (~ 10kps) and very lightweight. We also do not want to copy or trim the array.

Thank you for your help.

Can not you just pass these array indexes? It is basically everything that is an indicator anyway, offset from a certain memory location


No comments:

Post a Comment