CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions
DTDBDataHandle Class Reference

#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)
 

Detailed Description

Description: Class to convert data types from/to DB types

Date:
2007/11/24 12:29:51
Revision:
1.1.2.1
Author
Paolo Ronchese INFN Padova

Definition at line 30 of file DTDBDataHandle.h.

Constructor & Destructor Documentation

DTDBDataHandle::DTDBDataHandle ( )

Constructor

Definition at line 31 of file DTDBDataHandle.cc.

31 {}
DTDBDataHandle::~DTDBDataHandle ( )
virtual

Destructor

Definition at line 36 of file DTDBDataHandle.cc.

36 {}

Member Function Documentation

int DTDBDataHandle::nearestInt ( double  d)
static

Operations

Definition at line 41 of file DTDBDataHandle.cc.

References ztail::d.

41  {
42  if (d > 0.0)
43  d += 0.5;
44  else
45  d -= 0.5;
46  return static_cast<int>(d);
47 }
tuple d
Definition: ztail.py:151
bool DTDBDataHandle::toBool ( short  s)
static

Definition at line 49 of file DTDBDataHandle.cc.

References alignCSCRings::s.

49  {
50  union u_short_bool {
51  short s_num;
52  bool b_num;
53  };
54  union u_short_bool dataBuffer;
55  dataBuffer.s_num = s;
56  return dataBuffer.b_num;
57 }
short DTDBDataHandle::toShort ( bool  b)
static

Definition at line 59 of file DTDBDataHandle.cc.

References b.

59  {
60  union u_short_bool {
61  short s_num;
62  bool b_num;
63  };
64  union u_short_bool dataBuffer;
65  dataBuffer.s_num = 0;
66  dataBuffer.b_num = b;
67  return dataBuffer.s_num;
68 }
double b
Definition: hdecay.h:118