On 06/22/2016 01:09 PM, Jiří Činčura wrote:
>> input/output metadata (that's IMessageMetadata, yes?) provide you with a
> Yes.
>
>> set of methods needed to access data in buffer correctly
>> unavoidable one is getOffset() - it returns offset in a buffer where
>> data is placed       #include <unistd.h>
>>
> How's some called? I see only getRelation, getOffset, getType etc.
> Currently I'm "reading" the values manually like this:
> "int value = *((char*)inMsg + offset)" where the offset I get from
> "inputMetadata->getOffset(status, i)".
>
> I was looking something like "int* readAsInt(<status>, <buffer>,
> <index>)". But maybe I'm in wrong mindset.

Using call to virtual function (all calls in interfaces are virtual) is 
not very good idea from performance POV. Therefore it was decided that 
API provides metadata (including offsets) for a message, but last phase 
of parsing buffer is done by user in a way you've mentioned few lines 
before. Required for it info (including offsets or even pointers if one 
is using same buffer for all records) should be cached before scanning 
records set.

>
> Looking at your TypeMix union seems to be good idea (I'm used to to not
> be able to access memory directly in C#, so I haven't thought about it).
>
> I might eventually pass that to C#, probably. Let's see where I shoot
> myself into foot.

I hope you will not - the code around is true simple.



------------------------------------------------------------------------------
Attend Shape: An AT&T Tech Expo July 15-16. Meet us at AT&T Park in San
Francisco, CA to explore cutting-edge tech and listen to tech luminaries
present their vision of the future. This family event has something for
everyone, including kids. Get more information and register today.
http://sdm.link/attshape
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to