epics-base / pvaClientCPP

pvaClientCPP is an EPICS V4 C++ module
http://epics-pvdata.sourceforge.net/index.html
Other
2 stars 8 forks source link

fix issue 63; add PvaClientData::getSinglePVField; simplify getDouble… #64

Closed mrkraimer closed 4 years ago

mrkraimer commented 4 years ago

…, putDouble, etc

mrkraimer commented 4 years ago

Issue 63 was caused by a single line of code in putDoubleArray. But while reviewing the code and what caused the error I realized that by just adding a private method

PvaClientData::getSinglePVField

A lot of code duplicated in getDouble, getDoubleArray, getString, getStringArray, putDouble,etc. could be replaced by a call to getSinglePVField. In addition to removing many lines of code it prevents the error the caused issue 63.

A also added more tests to exampleCPP/testClient. The new tests did show the bug that caused issue 63 and show the the new code works.