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
00005 AlgoImpl::AlgoImpl( AlgoPos * al, std::string label )
00006 : ParS_(al->ParS_),
00007 ParE_(al->ParE_),
00008 start_(al->start_), end_(al->end_), incr_(al->incr_),
00009 curr_(al->curr_), count_(al->count_),
00010 terminate_(al->terminate_), err_(al->err_),
00011 label_(label)
00012 {
00013
00014 al->registerAlgo(this);
00015 }
00016
00017 AlgoImpl::~AlgoImpl( void )
00018 { }
00019
00020 int
00021 AlgoImpl::copyno( void ) const
00022 {
00023 return incr_ ? curr_ : count_ ;
00024 }
00025
00026 void
00027 AlgoImpl::terminate( void )
00028 {
00029 terminate_ = true;
00030 }
00031
00032 void
00033 AlgoImpl::checkTermination( void )
00034 {
00035 terminate();
00036 }
00037
00038 std::string
00039 AlgoImpl::d2s( double x )
00040 {
00041 char buffer [25];
00042 int len = snprintf( buffer, 25, "%g", x );
00043 if( len >= 25 )
00044 edm::LogError( "DoubleToString" ) << "Length truncated (from " << len << ")";
00045 return std::string( buffer );
00046 }
00047