Changeset 180 for XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.cpp
- Timestamp:
- 04/19/11 15:06:51 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XMLIO_V2/dev/dev_rv/src/xmlio/manager/tree_manager.cpp
r179 r180 178 178 const ENodeType genum = CContextGroup::GetType(); 179 179 const ENodeType denum = CDomain::GetType(); 180 const ENodeType ienum = CGrid::GetType(); 180 181 181 182 os.write (reinterpret_cast<const char*>(&genum) , sizeof(ENodeType)); … … 202 203 std::vector<boost::shared_ptr<CDomain> > & alldomain = 203 204 CDomain::GetAllVectobject(context->getId()); 205 std::vector<boost::shared_ptr<CGrid> > & allgrid = 206 CGrid::GetAllVectobject(context->getId()); 207 204 208 const StdSize alldomain_size = alldomain.size(); 209 const StdSize allgrid_size = allgrid.size(); 205 210 206 211 os.write (reinterpret_cast<const char*>(&alldomain_size), sizeof(StdSize)); 207 212 os.write (reinterpret_cast<const char*>(&allgrid_size), sizeof(StdSize)); 213 214 // Ãcriture successive des informations binaires de domaine. 208 215 for (StdSize j = 0; j < alldomain_size; j++) 209 216 { … … 222 229 os.write (id.data(), idsize * sizeof(char)); 223 230 } 224 domain->toBinary(os); 225 231 domain->toBinary(os); 232 } 233 234 // Ãcriture successive des informations binaires de grille. 235 for (StdSize j = 0; j < allgrid_size; j++) 236 { 237 boost::shared_ptr<CGrid> grid = allgrid[j]; 238 bool hid = grid->hasId(); 239 240 os.write (reinterpret_cast<const char*>(&ienum), sizeof(ENodeType)); 241 os.write (reinterpret_cast<const char*>(&hid), sizeof(bool)); 242 243 if (hid) 244 { 245 const StdString & id = grid->getId(); 246 const StdSize idsize = id.size(); 247 248 os.write (reinterpret_cast<const char*>(&idsize), sizeof(StdSize)); 249 os.write (id.data(), idsize * sizeof(char)); 250 } 251 grid->toBinary(os); 226 252 } 227 253 } … … 276 302 std::vector<boost::shared_ptr<CDomain> > & alldomain = 277 303 CDomain::GetAllVectobject(context->getId()); 304 std::vector<boost::shared_ptr<CGrid> > & allgrid = 305 CGrid::GetAllVectobject(context->getId()); 306 307 const StdSize allgrid_size = allgrid.size(); 278 308 const StdSize alldomain_size = alldomain.size(); 309 279 310 StdSize read_alldomain_size = 0; 311 StdSize read_allgrid_size = 0; 280 312 281 313 is.read (reinterpret_cast<char*>(&read_alldomain_size), sizeof(StdSize)); 314 is.read (reinterpret_cast<char*>(&read_allgrid_size), sizeof(StdSize)); 282 315 283 316 if (alldomain_size != read_alldomain_size) … … 286 319 << "] Bad domain group size !"); 287 320 321 if (alldomain_size != read_alldomain_size) 322 ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)", 323 << "[ read_allgrid_size = " << read_allgrid_size 324 << "] Bad grid group size !"); 325 326 // Lecture successive des informations binaires de domaine. 288 327 for (StdSize j = 0; j < alldomain_size; j++) 289 328 { … … 312 351 domain->fromBinary(is); 313 352 } 353 354 // Lecture successive des informations binaires de grille. 355 for (StdSize j = 0; j < allgrid_size; j++) 356 { 357 boost::shared_ptr<CGrid> grid = allgrid[j]; 358 bool hid = grid->hasId(); 359 ENodeType rrenum = Unknown; 360 361 is.read (reinterpret_cast<char*>(&rrenum), sizeof(ENodeType)); 362 is.read (reinterpret_cast<char*>(&hid), sizeof(bool)); 363 364 if (rrenum != CGrid::GetType()) 365 ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)", 366 << "[ rrenum = " << rrenum << "] Bad type !"); 367 368 if (hid) 369 { 370 StdSize size = 0; 371 is.read (reinterpret_cast<char*>(&size), sizeof(StdSize)); 372 StdString id(size, ' '); 373 is.read (const_cast<char *>(id.data()), size * sizeof(char)); 374 375 if (grid->getId().compare(id) != 0) 376 ERROR("CTreeManager::DomainsFromBinary(StdIStream & is)", 377 << "[ id = " << id << "] Bad id !"); 378 } 379 grid->fromBinary(is); 380 } 381 314 382 } 315 383 }
Note: See TracChangeset
for help on using the changeset viewer.