CMS 3D CMS Logo

Public Member Functions | Static Public Member Functions

DTDBDataHandle Class Reference

#include <DTDBDataHandle.h>

List of all members.

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/12/07 15:12:16
Revision:
1.2
Author:
Paolo Ronchese INFN Padova

Definition at line 33 of file DTDBDataHandle.h.


Constructor & Destructor Documentation

DTDBDataHandle::DTDBDataHandle ( )

Constructor

Definition at line 34 of file DTDBDataHandle.cc.

                               {
}
DTDBDataHandle::~DTDBDataHandle ( ) [virtual]

Destructor

Definition at line 40 of file DTDBDataHandle.cc.

                                {
}

Member Function Documentation

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;

}