Re: [Pvmanager-devel] Data conversion from scalar to array
Brought to you by:
carcassi,
epics-jenkins
From: Carcassi, G. <car...@bn...> - 2010-12-08 15:52:36
|
Based on feedback and further thinking, here's where I am right now: * Data conversion should not be in the datasource. It's a mess otherwise: people implementing the epics3, epics4, simulation or whatever implement thing differently... (There are caveats in term of performance optimization, but I don't think they change the general rule) * What is a valid conversions is somewhat specific to the task at hand, so it is better to be explicit. Explicit should not mean onerous. So: vDouble("mypv") - means a VDouble and only a VDouble numericScalar("mypv") - means any scalar value and is converted to a VDouble numericValueOf("myPv") - means any scalar, array or multichannel array, take the first element and convert to a VDouble all return VDouble and the user can choose what is more appropriate. So, PVManager user side can choose, DataSource implementor only returns the native type, those operators take care of making the client-side conversion so that it always works regardless of implementation. And everybody is (hopefully) happy... Gabriele |