#include <DTDBDataHandle.h>
Public Member Functions | |
DTDBDataHandle () | |
virtual | ~DTDBDataHandle () |
Static Public Member Functions | |
static int | nearestInt (double d) |
static bool | toBool (short s) |
static short | toShort (bool b) |
Description: Class to convert data types from/to DB types
Definition at line 33 of file DTDBDataHandle.h.
DTDBDataHandle::DTDBDataHandle | ( | ) |
DTDBDataHandle::~DTDBDataHandle | ( | ) | [virtual] |
int DTDBDataHandle::nearestInt | ( | double | d | ) | [static] |
Operations
Definition at line 46 of file DTDBDataHandle.cc.
{ if ( d > 0.0 ) d += 0.5; else d -= 0.5; return static_cast<int>( d ); }
bool DTDBDataHandle::toBool | ( | short | s | ) | [static] |
Definition at line 55 of file DTDBDataHandle.cc.
References alignCSCRings::s.
{ union u_short_bool { short s_num; bool b_num; }; union u_short_bool dataBuffer; dataBuffer.s_num = s; return dataBuffer.b_num; }
short DTDBDataHandle::toShort | ( | bool | b | ) | [static] |
Definition at line 68 of file DTDBDataHandle.cc.
References b.
{ union u_short_bool { short s_num; bool b_num; }; union u_short_bool dataBuffer; dataBuffer.s_num = 0; dataBuffer.b_num = b; return dataBuffer.s_num; }