12 #ifndef TILETPCNV_T_TILEPOOLCONTAINERCNV_H
13 #define TILETPCNV_T_TILEPOOLCONTAINERCNV_H
23 template<
class TRANS,
class PERS,
class CONV>
45 const std::vector<unsigned int>& param = pers->getParam();
48 unsigned int pers_type = (param.size()>0) ? param[0] : 0;
49 int hashType = pers_type & 0xF;
50 int type = (pers_type >> 4) & 0xF;
51 int unit = (pers_type >> 8) & 0xF;
52 uint32_t bsflags = pers_type & 0xFFFFF000;
57 <<
" - " << bsflags <<
" " <<
unit <<
" " <<
type <<
" " << hashType
58 << MSG::dec <<
" Nelements= " <<
vec.size() <<
endmsg;
62 if ( trans->get_hashType() != hashType ) {
64 <<
" does not match Trans hash type " << trans->get_hashType()
65 <<
" ==> reinitializing hash " <<
endmsg;
72 trans->set_bsflags(bsflags);
75 auto mutableContainer = std::make_unique<TileMutableDataContainer<TRANS>>();
76 if (mutableContainer->status().isFailure()) {
77 throw std::runtime_error(
"Failed to initialize Tile mutable Container");
81 if (mutableContainer->push_back(
m_elementCnv.createTransientConst(&(*
it),
log)).isFailure()) {
82 throw std::runtime_error(
"Failed to add Tile element to Collection");
86 std::vector<IdentifierHash>
hashes = mutableContainer->GetAllCurrentHashes();
89 auto newColl = std::make_unique<Collection>(std::move(*coll));
90 if (trans->addOrDelete(std::move(newColl),
hash).isFailure()) {
91 throw std::runtime_error(
"Failed to add Tile collection to Identifiable Container");
107 pers->reserve(1, 12288);
109 unsigned int pers_type = ((trans->get_hashType() & 0xF) |
110 ((trans->get_type() & 0xF)<<4) |
111 ((trans->get_unit() & 0xF)<<8) |
112 (trans->get_bsflags() & 0xFFFFF000) ) ;
113 pers->push_back_param(pers_type);
122 log <<
MSG::DEBUG << MSG::hex <<
"pers_type= 0x" << pers_type
123 <<
" - " << (trans->get_bsflags()>>12)
124 <<
" " << trans->get_unit()
125 <<
" " << trans->get_type()
126 <<
" " << trans->get_hashType()
127 << MSG::dec <<
" Nelements= " << pers->getVector().size() <<
endmsg;