Changeset 4006126 in tol
- Timestamp:
- Nov 7, 2009, 4:24:25 PM (17 years ago)
- Branches:
- 1941-docker-image-to-test, devel, master
- Children:
- 0020b903
- Parents:
- e8916d6
- Location:
- tol/OIS
- Files:
-
- 4 edited
-
oiscompress.cpp (modified) (1 diff)
-
oiscreator.cpp (modified) (10 diffs)
-
oisloader.cpp (modified) (10 diffs)
-
tol_ois.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
tol/OIS/oiscompress.cpp
re8916d6 r4006126 350 350 } 351 351 return(ok); 352 353 352 }; 354 353 -
tol/OIS/oiscreator.cpp
re8916d6 r4006126 36 36 #include <tol/tol_bvmatgra.h> 37 37 #include <tol/tol_bstruct.h> 38 #include "tol_ois_macros.h" 38 39 39 40 40 41 BTraceInit("oiscreator.cpp"); 41 42 42 //#define TRACE_OIS_HIERARCHY43 #ifdef TRACE_OIS_HIERARCHY44 static FILE* logHrchyWrite_ =45 fopen((BSys::TolAppData()+"syslog/OisHierarchyLogWrite.log").String(),"w");46 #endif47 43 48 44 … … 328 324 //-------------------------------------------------------------------- 329 325 { 330 int sz = v.Size(); 331 EWrite(sz,stream); 332 Ensure(Write((const void*)v.String(),1,sz, stream)); 326 TRACE_OIS_STREAM("WRITE",stream,"BText", v); 327 int length = v.Length(); 328 EWrite(length,stream); 329 Ensure(Write((const void*)v.String(),1,length, stream)); 333 330 return(true); 334 331 }; … … 338 335 //-------------------------------------------------------------------- 339 336 { 337 TRACE_OIS_STREAM("WRITE",stream,"BDat", BText("")<<v); 340 338 double x = v.Value(); 341 339 EWrite(x, stream); … … 347 345 //-------------------------------------------------------------------- 348 346 { 347 TRACE_OIS_STREAM("WRITE",stream,"BComplex", BText("")<<v); 349 348 EWrite(v.X(), stream); 350 349 EWrite(v.Y(), stream); … … 356 355 //-------------------------------------------------------------------- 357 356 { 357 TRACE_OIS_STREAM("WRITE",stream,"BDate", BText("")<<v); 358 358 double h = v.Hash(); 359 359 return(Write(h,stream)); … … 364 364 //-------------------------------------------------------------------- 365 365 { 366 TRACE_OIS_STREAM("WRITE",stream,"BDat*", BText("")<<s); 366 367 Ensure(Write(buf,sizeof(BDat),s,stream)); 367 368 return(true); … … 372 373 //-------------------------------------------------------------------- 373 374 { 375 TRACE_OIS_STREAM("WRITE",stream,"BPol", x.Name()); 374 376 int s = x.Size(); 375 377 EWrite(s, stream); … … 392 394 //-------------------------------------------------------------------- 393 395 { 394 BMemberOwner::BClassByNameHash::const_iterator iterC;395 396 int n = 0; 396 397 int s = x.size(); 398 TRACE_OIS_STREAM("WRITE",stream,"BMemberOwner", ""); 399 BMemberOwner::BClassByNameHash::const_iterator iterC; 397 400 EWrite(s,stream); 398 401 for(iterC=x.begin(); iterC!=x.end(); iterC++, n++) … … 407 410 //-------------------------------------------------------------------- 408 411 { 412 TRACE_OIS_STREAM("WRITE",stream,"BClass", BText("")<<cls.FullName()); 409 413 Ensure(Write(cls, *(cls.parentHash_), object_)); 410 414 Ensure(Write(cls, *(cls.ascentHash_), object_)); … … 863 867 Ensure(Write(nb.Set())); 864 868 char hasClass = nb.Class()!=NULL; 865 Ensure(Write(hasClass, object_));869 Ensure(Write(hasClass, set_)); 866 870 if(hasClass) 867 871 { 868 Ensure(Write(nb.Class()->FullName(), object_)); 872 BText className = nb.Class()->FullName(); 873 Ensure(Write(className, set_)); 869 874 } 870 875 return(true); -
tol/OIS/oisloader.cpp
re8916d6 r4006126 41 41 #include <tol/tol_bnameblock.h> 42 42 #include <tol/tol_bstruct.h> 43 #include "tol_ois_macros.h" 43 44 44 45 BTraceInit("oisloader.cpp"); 45 46 46 47 //#define TRACE_OIS_HIERARCHY48 #ifdef TRACE_OIS_HIERARCHY49 static FILE* logHrchyRead_ =50 fopen((BSys::TolAppData()+"syslog/OisHierarchyLogRead.log").String,"w");51 #endif52 47 53 48 //-------------------------------------------------------------------- … … 261 256 //-------------------------------------------------------------------- 262 257 { 258 TRACE_OIS_STREAM("READ",stream,"BText", v); 263 259 static char aux_[65536]; 264 int sz; 265 ERead(sz,stream); 266 Ensure(Read(aux_,1,sz, stream)); 267 aux_[sz]=0; 268 v.Copy(aux_); 260 if(control_.oisEngine_.oisVersion_<"02.13") 261 { 262 int sz; 263 ERead(sz,stream); 264 Ensure(Read(aux_,1,sz, stream)); 265 aux_[sz]=0; 266 v.Copy(aux_); 267 } 268 else 269 { 270 int length; 271 ERead(length,stream); 272 v.ReallocateBuffer(length+1); 273 v.PutLength(length); 274 Ensure(Read(v.Buffer(),1,length, stream)); 275 } 269 276 return(true); 270 277 }; … … 274 281 //-------------------------------------------------------------------- 275 282 { 283 TRACE_OIS_STREAM("READ",stream,"BDat", BText("")<<v); 276 284 if(control_.typeSizes_.sizeof_BDat_==sizeof(BDatOld)) 277 285 { … … 302 310 //-------------------------------------------------------------------- 303 311 { 312 TRACE_OIS_STREAM("READ",stream,"BComplex", BText("")<<v); 304 313 BDat x, y; 305 314 ERead(x, stream); … … 313 322 //-------------------------------------------------------------------- 314 323 { 324 TRACE_OIS_STREAM("READ",stream,"BDate", BText("")<<v); 315 325 double h; 316 326 ERead(h,stream); … … 323 333 //-------------------------------------------------------------------- 324 334 { 335 TRACE_OIS_STREAM("READ",stream,"BDat*", BText("")<<s); 325 336 if(control_.typeSizes_.sizeof_BDat_==sizeof(BDatOld)) 326 337 { … … 353 364 //-------------------------------------------------------------------- 354 365 { 366 TRACE_OIS_STREAM("READ",stream,"BPol", x.Name()); 355 367 int s, i; 356 368 bool ok = true; … … 396 408 //-------------------------------------------------------------------- 397 409 { 410 TRACE_OIS_STREAM("READ",stream,"BMemberOwner", ""); 398 411 BMemberOwner::BClassByNameHash::const_iterator iterC; 399 412 int n = 0; … … 422 435 //-------------------------------------------------------------------- 423 436 { 437 TRACE_OIS_STREAM("READ",stream,"BClass", BText("")<<cls.FullName()); 424 438 BMemberOwner::BClassByNameHash& parents = *cls.parentHash_; 425 439 Ensure(Read(cls,parents,stream)); … … 1141 1155 { 1142 1156 char hasClass; 1143 Ensure(Read(hasClass, object_)); 1157 if(control_.oisEngine_.oisVersion_>="02.13") 1158 { 1159 Ensure(Read(hasClass, set_)); 1160 } 1161 else 1162 { 1163 Ensure(Read(hasClass, object_)); 1164 } 1144 1165 if(hasClass) 1145 1166 { 1146 1167 BText className; 1147 Ensure(Read(className, object_)); 1168 if(control_.oisEngine_.oisVersion_>="02.13") 1169 { 1170 Ensure(Read(className, set_)); 1171 } 1172 else 1173 { 1174 Ensure(Read(className, object_)); 1175 } 1148 1176 if(control_.oisEngine_.oisVersion_<"02.09") 1149 1177 { -
tol/OIS/tol_ois.h
re8916d6 r4006126 39 39 //read old OIS files. This will be called a hard change. Then a 40 40 //traslation utility will be available. 41 #define OIS_VERSION "02.1 2"41 #define OIS_VERSION "02.13" 42 42 43 43 #define OIS_Load_Mode_Header 0
Note: See TracChangeset
for help on using the changeset viewer.
