Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CellIDDecoder: replace static pointer to string with static string #36

Merged
merged 1 commit into from
Jul 7, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 6 additions & 8 deletions src/cpp/include/UTIL/CellIDDecoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ namespace UTIL{

if( initString.size() == 0 ) {

initString = *_defaultEncoding ;
initString = _defaultEncoding ;

std::cout << " ----------------------------------------- " << std::endl
<< " WARNING: CellIDDecoder - no CellIDEncoding parameter in collection ! "
Expand Down Expand Up @@ -103,22 +103,20 @@ namespace UTIL{
* CellIDEncoding parameter is set in the collection, e.g. in older lcio files.
*/
static void setDefaultEncoding(const std::string& defaultEncoding ) {

delete _defaultEncoding ;

_defaultEncoding = new std::string( defaultEncoding ) ;

_defaultEncoding = std::string( defaultEncoding ) ;
}

protected:
BitField64* _b{} ;
const T* _oldHit{NULL} ;

static std::string* _defaultEncoding ;
static std::string _defaultEncoding;
} ;

template <class T>
std::string* CellIDDecoder<T>::_defaultEncoding
= new std::string("byte0:8,byte1:8,byte2:8,byte3:8,byte4:8,byte5:8,byte6:8,byte7:8") ;
std::string CellIDDecoder<T>::_defaultEncoding
= std::string("byte0:8,byte1:8,byte2:8,byte3:8,byte4:8,byte5:8,byte6:8,byte7:8") ;


} // namespace
Expand Down