replace pvatypemap.h with pv/typemap.h in pvDataCPP

This commit is contained in:
Michael Davidsaver
2017-10-03 14:53:33 +02:00
parent d9a4061064
commit fbf301c151
3 changed files with 4 additions and 43 deletions

View File

@ -1,39 +0,0 @@
/* #define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE)
*
* BASETYPE is suffix of type from epicsTypes.h
* epics ## BASETYPE -> eg. epicsUInt8
* PVATYPE is storage type
* PVATYPE -> eg epics::pvData::uint8
* DBFTYPE is suffix of DBF_*
* DBF_ ## DBFTYPE -> eg. DBF_UCHAR
* PVACODE is suffix of ScalarType enum
* epics::pvData::pv ## PVACODE -> epics::pvData::pvUByte
*/
CASE(UInt8, epics::pvData::uint8, UCHAR, UByte)
CASE(Int8, epics::pvData::int8, CHAR, Byte)
CASE(UInt16, epics::pvData::uint16, USHORT, UShort)
CASE(Int16, epics::pvData::int16, SHORT, Short)
CASE(UInt32, epics::pvData::uint32, ULONG, UInt)
CASE(Int32, epics::pvData::int32, LONG, Int)
CASE(Float32, float, FLOAT, Float)
CASE(Float64, double, DOUBLE, Double)
#ifndef CASE_SKIP_BOOL
CASE(UInt8, epics::pvData::boolean, UCHAR, Boolean)
#endif
#ifdef CASE_REAL_INT64
CASE(UInt64, epics::pvData::uint64, UINT64, ULong)
CASE(Int64, epics::pvData::int64, INT64, Long)
#elif defined(CASE_SQUEEZE_INT64)
CASE(UInt32, epics::pvData::uint64, ULONG, ULong)
CASE(Int32, epics::pvData::int64, LONG, Long)
#else
/* nothing */
#endif
#ifdef CASE_ENUM
// yes really, Base uses SHORT (16-bit) while PVD uses Int (32-bit)
CASE(Enum16, epics::pvData::int32, ENUM, Int)
#endif
#ifdef CASE_STRING
CASE(Int8, std::string, CHAR, String)
#endif
/* #undef CASE */

View File

@ -325,7 +325,7 @@ int pvaGetDBFtype(const DBLINK *plink)
switch(ftype) {
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case pvd::pv##PVACODE: return DBF_##DBFTYPE;
#define CASE_SQUEEZE_INT64
#include "pvatypemap.h"
#include "pv/typemap.h"
#undef CASE_SQUEEZE_INT64
#undef CASE
case pvd::pvString: return DBF_STRING; // TODO: long string?
@ -391,7 +391,7 @@ long pvaGetValue(DBLINK *plink, short dbrType, void *pbuffer,
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case DBR_##DBFTYPE: *((epics##BASETYPE*)pbuffer) = self->valueS->getAs<epics##BASETYPE>(); break;
#define CASE_SKIP_BOOL
#define CASE_ENUM
#include "pvatypemap.h"
#include "pv/typemap.h"
#undef CASE_SKIP_BOOL
#undef CASE_ENUM
#undef CASE

View File

@ -591,7 +591,7 @@ pvd::ScalarType DBR2PVD(short dbr)
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case DBR_##DBFTYPE: return pvd::pv##PVACODE;
#define CASE_ENUM
#define CASE_SKIP_BOOL
#include "pvatypemap.h"
#include "pv/typemap.h"
#undef CASE_ENUM
#undef CASE_SKIP_BOOL
#undef CASE
@ -606,7 +606,7 @@ short PVD2DBR(pvd::ScalarType pvt)
switch(pvt) {
#define CASE(BASETYPE, PVATYPE, DBFTYPE, PVACODE) case pvd::pv##PVACODE: return DBR_##DBFTYPE;
#define CASE_SQUEEZE_INT64
#include "pvatypemap.h"
#include "pv/typemap.h"
#undef CASE_SQUEEZE_INT64
#undef CASE
default: