MCPcopy Create free account
hub / github.com/Tripwire/tripwire-open-source / ReadObject

Method ReadObject

src/core/serializerimpl.cpp:391–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391void cSerializerImpl::ReadObject(iTypedSerializable* pObj)
392{
393 cDebug d("cSerializerImpl::ReadObjectDynCreate");
394 //d.TraceDetail("Entering... archive offset = %d\n", mpArchive->CurrentPos());
395
396 // NOTE -- type index stuff is gone; see the comment in WriteObject()
397 int32 /*typeIdx,*/ size;
398 // first, get the type...
399 /*
400 mpArchive->ReadInt32(typeIdx);
401 if((typeIdx < 0) || (typeIdx >= mTypeArray.size()))
402 {
403 // unknown type index!
404 d.TraceError("Encountered bad index into TypeArray: %d\n", typeIdx);
405 ThrowAndAssert(eSerializerInputStremTypeArray());
406 }
407 const cType* pType = mTypeArray[typeIdx];
408 */
409
410 // read in the version
411 int32 dummy, version;
412 mpArchive->ReadInt32(dummy); // old type array index
413 mpArchive->ReadInt32(version);
414
415 // read in the size and the index...
416 mpArchive->ReadInt32(size);
417
418 // use the size to assert that the file format is correct
419 if (size != (int)0xffffffff)
420 {
421 // unknown type index!
422 d.TraceError("Encountered bad size: %d\n", size);
423 ThrowAndAssert(eSerializerInputStremTypeArray(_T(""), mFileName, eSerializer::TY_FILE));
424 }
425
426 // remember current position
427 //int64 sizePos = mpArchive->CurrentPos();
428
429 // read in the object!
430 pObj->Read(this, version);
431
432 // seek past this object in case filepos is not correct!
433 //mpArchive->Seek(sizePos + size, cBidirArchive::BEGINNING);
434}
435
436
437///////////////////////////////////////////////////////////////////////////////

Callers 11

ReadMethod · 0.80
ReadObjectFromArchiveFunction · 0.80
ReadConfigTextMethod · 0.80
ReadMethod · 0.80
ReadMethod · 0.80
CreateFCOMethod · 0.80
TestSerializerImplFunction · 0.80
TestFCOName2Function · 0.80
TestTextReportViewerFunction · 0.80
TestFCOReportFunction · 0.80
ReadMethod · 0.80

Calls 3

TraceErrorMethod · 0.60
ReadInt32Method · 0.45
ReadMethod · 0.45

Tested by 5

ReadMethod · 0.64
TestSerializerImplFunction · 0.64
TestFCOName2Function · 0.64
TestTextReportViewerFunction · 0.64
TestFCOReportFunction · 0.64