Skip to content

Commit

Permalink
make backwardcompatible; inc. vers to 2.17
Browse files Browse the repository at this point in the history
  • Loading branch information
gaede authored and tmadlener committed Nov 5, 2021
1 parent 6f74f9f commit bc119cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 19 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ include(GNUInstallDirs)

# project version
SET( LCIO_VERSION_MAJOR 2 )
SET( LCIO_VERSION_MINOR 16 )
SET( LCIO_VERSION_PATCH 1 )
SET( LCIO_VERSION_MINOR 17 )
SET( LCIO_VERSION_PATCH 0 )

### set correct LCIO version in relevant files ############################

Expand Down
37 changes: 20 additions & 17 deletions src/cpp/src/SIO/SIOLCParameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

namespace SIO {

void SIOLCParameters::read( sio::read_device &device, EVENT::LCParameters& params, sio::version_type /*vers*/ ) {
void SIOLCParameters::read( sio::read_device &device, EVENT::LCParameters& params, sio::version_type vers ) {
int nIntParameters ;
SIO_DATA( device , &nIntParameters , 1 ) ;
for(int i=0; i< nIntParameters ; i++ ) {
Expand All @@ -33,18 +33,21 @@ namespace SIO {
}
params.setValues( key , floatVec ) ;
}
int nDoubleParameters ;
SIO_DATA( device , &nDoubleParameters , 1 ) ;
for(int i=0; i< nDoubleParameters ; i++ ) {
std::string key;
SIO_SDATA( device, key ) ;
int nDouble ;
SIO_DATA( device , &nDouble , 1 ) ;
EVENT::DoubleVec doubleVec(nDouble) ;
for(int j=0; j< nDouble ; j++ ) {
SIO_DATA( device , &doubleVec[j] , 1 ) ;
if( vers > SIO_VERSION_ENCODE( 2, 16 ) ) {

int nDoubleParameters ;
SIO_DATA( device , &nDoubleParameters , 1 ) ;
for(int i=0; i< nDoubleParameters ; i++ ) {
std::string key;
SIO_SDATA( device, key ) ;
int nDouble ;
SIO_DATA( device , &nDouble , 1 ) ;
EVENT::DoubleVec doubleVec(nDouble) ;
for(int j=0; j< nDouble ; j++ ) {
SIO_DATA( device , &doubleVec[j] , 1 ) ;
}
params.setValues( key , doubleVec ) ;
}
params.setValues( key , doubleVec ) ;
}
int nStringParameters ;
SIO_DATA( device , &nStringParameters , 1 ) ;
Expand Down Expand Up @@ -97,11 +100,11 @@ namespace SIO {
EVENT::DoubleVec doubleVec ;
params.getDoubleVals( doubleKeys[i], doubleVec ) ;
int nDouble = doubleVec.size() ; // = params.getNDouble( doubleKeys[i] ) ;
SIO_SDATA( device, doubleKeys[i] ) ;
SIO_DATA( device , &nDouble , 1 ) ;
for(int j=0; j< nDouble ; j++ ){
SIO_SDATA( device, doubleVec[j] ) ;
}
SIO_SDATA( device, doubleKeys[i] ) ;
SIO_DATA( device , &nDouble , 1 ) ;
for(int j=0; j< nDouble ; j++ ){
SIO_SDATA( device, doubleVec[j] ) ;
}
}
EVENT::StringVec stringKeys ;
int nStringParameters = params.getStringKeys( stringKeys ).size() ;
Expand Down

0 comments on commit bc119cd

Please sign in to comment.