Skip to content

Commit

Permalink
Fix for conflicts caused by boost version header
Browse files Browse the repository at this point in the history
  • Loading branch information
ggovi committed May 9, 2015
1 parent 254d11d commit e21416c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CondCore/CondDB/interface/Serialization.h
Expand Up @@ -92,7 +92,7 @@ namespace cond {
static constexpr char const* ARCH_LABEL = "architecture";
//
static constexpr char const* TECHNOLOGY = "boost/serialization" ;
static constexpr char const* VERSION = BOOST_LIB_VERSION;
static std::string techVersion();
static std::string jsonString();
};

Expand Down Expand Up @@ -146,7 +146,7 @@ namespace cond {
std::string errorMsg("De-serialization failed: ");
std::string em( e.what() );
if( em == "unsupported version" ) {
errorMsg += "the current boost version ("+std::string(StreamerInfo::VERSION)+
errorMsg += "the current boost version ("+StreamerInfo::techVersion()+
") is unable to read the payload. Data might have been serialized with an incompatible version.";
} else if( em == "input stream error" ) {
errorMsg +="data size does not fit with the current class layout. The Class "+payloadType+" might have been changed with respect to the layout used in the upload.";
Expand Down
7 changes: 6 additions & 1 deletion CondCore/CondDB/src/Serialization.cc
Expand Up @@ -4,6 +4,7 @@
#include "FWCore/PluginManager/interface/PluginCapabilities.h"
//
#include <sstream>
#include "boost/version.hpp"
// root includes
#include "TStreamerInfo.h"
#include "TClass.h"
Expand Down Expand Up @@ -133,13 +134,17 @@ void cond::RootInputArchive::read( const std::type_info& destinationType, void*
m_streamer->read( destinationInstance, r_class );
}

std::string cond::StreamerInfo::techVersion(){
return BOOST_LIB_VERSION;
}

std::string cond::StreamerInfo::jsonString(){
std::stringstream ss;
ss<<" {"<<std::endl;
ss<<"\""<<CMSSW_VERSION_LABEL<<"\": \""<<currentCMSSWVersion()<<"\","<<std::endl;
ss<<"\""<<ARCH_LABEL<<"\": \""<<currentArchitecture()<<"\","<<std::endl;
ss<<"\""<<TECH_LABEL<<"\": \""<<TECHNOLOGY<<"\","<<std::endl;
ss<<"\""<<TECH_VERSION_LABEL<<"\": \""<<VERSION<<"\""<<std::endl;
ss<<"\""<<TECH_VERSION_LABEL<<"\": \""<<techVersion()<<"\""<<std::endl;
ss<<" }"<<std::endl;
return ss.str();
}
Expand Down
1 change: 0 additions & 1 deletion CondFormats/Serialization/interface/Archive.h
Expand Up @@ -6,7 +6,6 @@
#include "boost/archive/xml_iarchive.hpp"
#include "boost/archive/xml_oarchive.hpp"
#include "boost/archive/xml_oarchive.hpp"
#include "boost/version.hpp"

#include "CondFormats/Serialization/interface/eos/portable_iarchive.hpp"
#include "CondFormats/Serialization/interface/eos/portable_oarchive.hpp"
Expand Down

0 comments on commit e21416c

Please sign in to comment.