Code review comment for lp:~matej-sekoranja/epics-base/pcas-variable-length-arrays

Revision history for this message
Matej Sekoranja (matej-sekoranja) wrote :

I need to get an indication whether casPV implementation support variable arrays or not.

I can create a method "virtual bool casPV::supports_variable_arrays() const { return false; }" with the default implementation as shown. If the method returns "false" then I will execute the following code before calling casPV::read :

if (!protoIn.getBounds() && this->info.getElementCount() > 1)
{
    // convert to atomic
    gddBounds bds;
    bds.setSize ( this->info.getElementCount() );
    bds.setFirst ( 0u );
    protoIn.setDimension ( 1u, & bds );
}

This will make code work as you've described above (using max number of elements for the PV when 0 count is requested).

OK to implement?

« Back to merge proposal