What is the recommended method(s) for accessing data from a previous or upcoming block of data from a bulkio input stream? Edit: I am using c++.
For example, if I wanted to perform convolution on a stream of incoming data where each calculation is dependent on some number of values forward/backward in the stream how would I reach into the "next" block of data or "previous" block of data to perform the convolution calculations at the block boundaries? Or temporarily store this information somewhere within the component so it can be used from one block to the next?
Or a simpler example, if I send a repeating vector of 8 octet values into my component, I want the component to simply flip from 0 to 1 or vice versa whenever a 1 is received (dependent on last index of the previous block of data to calculate the first index of the next block of data).
Desired:
in: [0,0,0,1,0,0,0] [0,0,0,1,0,0,0] [0,0,0,1,0,0,0] ->
out: [1,1,1,0,0,0,0] [0,0,0,1,1,1,1] [1,1,1,0,0,0,0]
What I have been able to achieve:
in: [0,0,0,1,0,0,0] [0,0,0,1,0,0,0] [0,0,0,1,0,0,0] ->
out: [1,1,1,0,0,0,0] [1,1,1,0,0,0,0] [1,1,1,0,0,0,0]
I've thought to store the relevant information from the previously processed block in a variable somewhere inside the component code serviceFunction() although I haven't found a way to do this without the value being reinitialized (is each block of data a new call to serviceFunction()?).
Alternatively, I thought to make a read-only property to hold the values I care about but I suspect there may be a better approach I am unaware of.
Thanks,
-Mark