CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DetectorDescription/ExprAlgo/src/AlgoImpl.cc

Go to the documentation of this file.
00001 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00002 #include "DetectorDescription/ExprAlgo/interface/AlgoImpl.h"
00003 #include "DetectorDescription/ExprAlgo/interface/AlgoPos.h"
00004 #include <cstdio>
00005 
00006 AlgoImpl::AlgoImpl( AlgoPos * al, std::string label )
00007   : ParS_(al->ParS_),
00008     ParE_(al->ParE_),
00009     start_(al->start_), end_(al->end_), incr_(al->incr_),
00010     curr_(al->curr_), count_(al->count_),
00011     terminate_(al->terminate_), err_(al->err_),
00012     label_(label)
00013 {
00014   // DCOUT('E', "AlgoImpl ctor called with label=" << label << " AlgoPos.ddname=" << al->ddname() );
00015   al->registerAlgo(this);
00016 } 
00017 
00018 AlgoImpl::~AlgoImpl( void )
00019 { }
00020 
00021 int
00022 AlgoImpl::copyno( void ) const
00023 {
00024   return incr_ ? curr_ : count_ ;
00025 }  
00026 
00027 void
00028 AlgoImpl::terminate( void )
00029 {
00030   terminate_ = true;
00031 }
00032 
00033 void
00034 AlgoImpl::checkTermination( void )
00035 {
00036   terminate();
00037 }  
00038   
00039 std::string
00040 AlgoImpl::d2s( double x )
00041 {
00042   char buffer [25]; 
00043   int len = snprintf( buffer, 25, "%g", x );
00044   if( len >= 25 )
00045     edm::LogError( "DoubleToString" ) << "Length truncated (from " << len << ")";
00046   return std::string( buffer );
00047 }
00048