void CObjectOStream::WriteContainer(const CContainerTypeInfo* cType, TConstObjectPtr containerPtr) { BEGIN_OBJECT_FRAME2(eFrameArray, cType); BeginContainer(cType); CContainerTypeInfo::CConstIterator i; if ( cType->InitIterator(i, containerPtr) ) { TTypeInfo elementType = cType->GetElementType(); BEGIN_OBJECT_FRAME2(eFrameArrayElement, elementType); do { BeginContainerElement(elementType); WriteObject(cType->GetElementPtr(i), elementType); EndContainerElement(); } while ( cType->NextElement(i) ); END_OBJECT_FRAME(); } EndContainer(); END_OBJECT_FRAME(); }
void CObjectOStream::WriteClassMember(const CMemberId& memberId, TTypeInfo memberType, TConstObjectPtr memberPtr) { BEGIN_OBJECT_FRAME2(eFrameClassMember, memberId); BeginClassMember(memberId); WriteObject(memberPtr, memberType); EndClassMember(); END_OBJECT_FRAME(); }
void CObjectOStream::WriteClass(const CClassTypeInfo* classType, TConstObjectPtr classPtr) { BEGIN_OBJECT_FRAME2(eFrameClass, classType); BeginClass(classType); for ( CClassTypeInfo::CIterator i(classType); i.Valid(); ++i ) { classType->GetMemberInfo(*i)->WriteMember(*this, classPtr); } EndClass(); END_OBJECT_FRAME(); }
void CObjectOStream::WriteContainer(const CContainerTypeInfo* cType, TConstObjectPtr containerPtr) { BEGIN_OBJECT_FRAME2(eFrameArray, cType); BeginContainer(cType); CContainerTypeInfo::CConstIterator i; if ( cType->InitIterator(i, containerPtr) ) { TTypeInfo elementType = cType->GetElementType(); BEGIN_OBJECT_FRAME2(eFrameArrayElement, elementType); const CPointerTypeInfo* pointerType = dynamic_cast<const CPointerTypeInfo*>(elementType); do { TConstObjectPtr elementPtr = cType->GetElementPtr(i); if ( pointerType && !pointerType->GetObjectPointer(elementPtr) ) { if ( GetVerifyData() == eSerialVerifyData_Yes ) { ThrowError(fUnassigned, "NULL element while writing container "+ cType->GetName()); } continue; } BeginContainerElement(elementType); WriteObject(elementPtr, elementType); EndContainerElement(); } while ( cType->NextElement(i) ); END_OBJECT_FRAME(); } EndContainer(); END_OBJECT_FRAME(); }
bool CObjectOStream::WriteClassMember(const CMemberId& memberId, const CDelayBuffer& buffer) { if ( !buffer.HaveFormat(GetDataFormat()) ) return false; BEGIN_OBJECT_FRAME2(eFrameClassMember, memberId); BeginClassMember(memberId); Write(buffer.GetSource()); EndClassMember(); END_OBJECT_FRAME(); return true; }
void CObjectOStream::Write(TConstObjectPtr object, TTypeInfo typeInfo) { // root writer BEGIN_OBJECT_FRAME2(eFrameNamed, typeInfo); WriteFileHeader(typeInfo); WriteObject(object, typeInfo); EndOfWrite(); END_OBJECT_FRAME(); if ( GetAutoSeparator() ) Separator(*this); }
void CObjectOStream::Write(const CConstObjectInfo& object) { // root writer BEGIN_OBJECT_FRAME2(eFrameNamed, object.GetTypeInfo()); WriteFileHeader(object.GetTypeInfo()); WriteObject(object); EndOfWrite(); END_OBJECT_FRAME(); if ( GetAutoSeparator() ) Separator(*this); }
void CObjectOStream::WriteNamedType(TTypeInfo #ifndef VIRTUAL_MID_LEVEL_IO namedTypeInfo #endif , TTypeInfo objectType, TConstObjectPtr objectPtr) { #ifndef VIRTUAL_MID_LEVEL_IO BEGIN_OBJECT_FRAME2(eFrameNamed, namedTypeInfo); BeginNamedType(namedTypeInfo); #endif WriteObject(objectPtr, objectType); #ifndef VIRTUAL_MID_LEVEL_IO EndNamedType(); END_OBJECT_FRAME(); #endif }