14 #include <type_traits>
19 template<CNVDataType type>
137 static asynStatus (asynPortDriver::*
asyn_callback)(T* value,
size_t nElements,
int reason,
int addr);
145 static asynStatus (asynPortDriver::*
asyn_callback)(epicsInt8* value,
size_t nElements,
int reason,
int addr);
153 static asynStatus (asynPortDriver::*
asyn_callback)(
char** value,
size_t nElements,
int reason,
int addr);
161 static asynStatus (asynPortDriver::*
asyn_callback)(epicsFloat32* value,
size_t nElements,
int reason,
int addr);
169 static asynStatus (asynPortDriver::*
asyn_callback)(epicsFloat64* value,
size_t nElements,
int reason,
int addr);
177 static asynStatus (asynPortDriver::*
asyn_callback)(epicsInt8* value,
size_t nElements,
int reason,
int addr);
185 static asynStatus (asynPortDriver::*
asyn_callback)(epicsInt8* value,
size_t nElements,
int reason,
int addr);
193 static asynStatus (asynPortDriver::*
asyn_callback)(epicsInt16* value,
size_t nElements,
int reason,
int addr);
201 static asynStatus(asynPortDriver::*
asyn_callback)(epicsInt16* value,
size_t nElements,
int reason,
int addr);
209 static asynStatus (asynPortDriver::*
asyn_callback)(epicsInt32* value,
size_t nElements,
int reason,
int addr);
217 static asynStatus (asynPortDriver::*
asyn_callback)(epicsInt32* value,
size_t nElements,
int reason,
int addr);
225 static asynStatus (asynPortDriver::*
asyn_callback)(__int64* value,
size_t nElements,
int reason,
int addr);
233 static asynStatus (asynPortDriver::*
asyn_callback)(__int64* value,
size_t nElements,
int reason,
int addr);
241 template<
typename T,
typename U>
244 return static_cast<T
>(val);
247 template<
typename T,
typename U>
250 throw std::runtime_error(
"convertToScalar: illegal cast of pointer to simple type");
254 template<
typename T,
typename U>
257 throw std::runtime_error(
"convertToPtr: illegal cast of simple type to pointer");
262 template <
typename T,
bool is_
unsigned>
269 template <
typename T>
272 typedef typename std::make_signed<T>::type
type;
276 template <
typename T>
283 template<
typename T,
typename U>
286 if ( std::is_same<
typename MakeSigned<
typename std::remove_cv<T>::type >::type,
typename MakeSigned<
typename std::remove_cv<U>::type >::type >::value )
288 return reinterpret_cast<T*
>(val);
static void free(ctype)
function to free any memory associated with type
default case handles already signed types i.e. <T,false>
static T convertToScalar(U val)
convert one type to another
static void free(ctype val)
std::make_signed< T >::type type
static void free(ctype val)
static void free(ctype val)
MakeSignedImpl< T, std::is_unsigned< T >::value >::type type
Provide the underlying C data type ctype for a given network shared variable type.
static asynStatus(asynPortDriver::* asyn_callback)(T *value, size_t nElements, int reason, int addr)
static void free(ctype val)
static void free(ctype val)
static T * convertToPtr(U val)
static void free(ctype val)
int ctype
an instance of the underlying type
static void free(ctype val)
static void free(ctype val)
static void free(ctype val)
For a given C data type, provide the appropriate network shared variable type.
static const char * desc
description of type
static void free(ctype val)
static void free(ctype val)
static void free(ctype val)
like std::make_signed but also handles bool,float etc. types by passing them through rather than prod...