本文整理汇总了C++中CArchive::SerializeClass方法的典型用法代码示例。如果您正苦于以下问题:C++ CArchive::SerializeClass方法的具体用法?C++ CArchive::SerializeClass怎么用?C++ CArchive::SerializeClass使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CArchive
的用法示例。
在下文中一共展示了CArchive::SerializeClass方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Serialize
void CBigBrotherDoc::Serialize(CArchive& ar)
{
ASSERT_VALID(this);
CDocument::Serialize(ar);
ar.MapObject(this);
ar.SerializeClass(RUNTIME_CLASS(CBigBrotherDoc));
if (ar.IsStoring())
{
// Store to archive
ar << m_PingSize;
ar << m_MaxThreads;
ar << m_MaxLogTime;
ar << m_bSaveOnShutdown;
ar << m_AutoSave;
ar << m_LogFile;
ar << m_bStoreLastActivity;
ar << m_RootBrother;
m_Brotherhood.Serialize(ar);
}
else
{
UINT schema = ar.GetObjectSchema();
#ifndef NDEBUG
{
CString tmp;
tmp.Format("Doc-OSchema: %u\n",schema);
TRACE0(tmp);
}
#endif
CleanUp();
m_ThisMap.RemoveAll();
// Read from archive
ar >> m_PingSize;
ar >> m_MaxThreads;
ar >> m_MaxLogTime;
if(schema>=2){
ar >> m_bSaveOnShutdown;
ar >> m_AutoSave;
}
ar >> m_LogFile;
if(schema>=3)
ar >> m_bStoreLastActivity;
ar >> m_RootBrother;
m_Brotherhood.Serialize(ar);
// Read from archive
m_ThisMap.RemoveAll();
// Log loading
CString logLine;
logLine.Format(IDS_LOG_LOADFILE,(LPCTSTR)GetTitle());
logLine=CTime::GetCurrentTime().Format(IDS_LOG_DATEFORMAT)+" "+logLine;
LogLine(logLine);
}