Public Member Functions | List of all members
SignalTypeConverter Class Reference

#include <SignalTypeConverter.h>

Public Member Functions

 SignalTypeConverter ()
 
template<typename T2 , typename T1 >
T2 convert (T1 val) const
 
template<typename INT = int, typename FLOAT >
INT floatToInt (FLOAT val) const
 

Detailed Description

Definition at line 23 of file SignalTypeConverter.h.

Constructor & Destructor Documentation

SignalTypeConverter::SignalTypeConverter ( )

Definition at line 7 of file SignalTypeConverter.cxx.

7 { }

Member Function Documentation

template<typename T2 , typename T1 >
T2 SignalTypeConverter::convert ( T1  val) const
inline

Definition at line 35 of file SignalTypeConverter.h.

35  {
36  if ( std::is_floating_point<T1>() && std::is_integral<T2>() ) {
37  return floatToInt<T2, T1>(val);
38  } else {
39  return T2(val);
40  }
41  }
Definition: 013_class.h:14
template<typename INT = int, typename FLOAT >
INT SignalTypeConverter::floatToInt ( FLOAT  val) const
inline

Definition at line 45 of file SignalTypeConverter.h.

45  {
46  if ( val < 0.0 ) return -floatToInt<INT, FLOAT>(-val);
47  return INT(val + 0.5);
48  }

The documentation for this class was generated from the following files: