/data3/calcul/jacquem/working_dir/Micromegas/micromegasFrameWork/lcio/src/cpp/src/IMPL/LCGenericObjectImpl.cc

Go to the documentation of this file.
00001 
00002 #include "IMPL/LCGenericObjectImpl.h"
00003 
00004 using namespace EVENT ;
00005 
00006 namespace IMPL {
00007   
00008 
00009   std::string  LCGenericObjectImpl::_typeName = "LCGenericObject" ;
00010   std::string  LCGenericObjectImpl::_dataDescription = "" ;
00011 
00012 
00013 
00014   LCGenericObjectImpl::LCGenericObjectImpl():
00015   _isFixedSize( false ) {
00016     
00017   }
00018 
00019 
00020   LCGenericObjectImpl::LCGenericObjectImpl(int nInt, int nFloat, int nDouble):
00021     _isFixedSize( true ) {  // FIXME - fixed size is a collection property !!!
00022     _intVec.resize( nInt ) ;
00023     _floatVec.resize( nFloat ) ;
00024     _doubleVec.resize( nDouble ) ;
00025   }
00026 
00027   int LCGenericObjectImpl::getNInt() const{
00028     return _intVec.size() ;
00029   }
00030   int LCGenericObjectImpl::getNFloat() const{
00031     return _floatVec.size() ;
00032   }
00033   
00034   int LCGenericObjectImpl::getNDouble() const{
00035     return _doubleVec.size() ;
00036   }
00037   
00038   int LCGenericObjectImpl::getIntVal(int index) const{
00039     return _intVec[ index ] ;
00040   }
00041 
00042   float LCGenericObjectImpl::getFloatVal(int index) const{
00043     return _floatVec[ index ] ;
00044   }
00045 
00046   double LCGenericObjectImpl::getDoubleVal(int index) const{
00047     return _doubleVec[ index ] ;
00048   }
00049   
00050   bool LCGenericObjectImpl::isFixedSize() const{
00051     return _isFixedSize ;
00052   }
00053   
00054   void LCGenericObjectImpl::setIntVal(unsigned index, int value) {
00055     if( _intVec.size() <= index && !_isFixedSize ) 
00056       _intVec.resize( index+1 ) ;
00057     _intVec[ index ] = value ;
00058   }
00059   
00060   void LCGenericObjectImpl::setFloatVal(unsigned index, float value){
00061     if( _floatVec.size() <= index && !_isFixedSize ) 
00062       _floatVec.resize( index+1 ) ;
00063     _floatVec[ index ] = value ;
00064   }
00065   
00066   void LCGenericObjectImpl::setDoubleVal(unsigned index, double value){
00067     if( _doubleVec.size() <= index && !_isFixedSize ) 
00068       _doubleVec.resize( index+1 ) ;
00069     _doubleVec[ index ] = value ;
00070   }
00071 
00072   const std::string  LCGenericObjectImpl::getTypeName() const {
00073     return _typeName ;
00074   }
00075 
00076   const std::string  LCGenericObjectImpl::getDataDescription() const {
00077     return _dataDescription ;
00078   }
00079 
00080 }

Generated on Mon Jan 7 13:15:21 2013 for MicromegasFramework by  doxygen 1.4.7