コード例 #1
0
void OTag::Serialize(CArchive& ar)
   {
   if (ar.IsStoring())
      {
      ar << name;
      ar << description;
      ar << enableProcessing;
      ar << nativeType;
      ar << active;
      ar.SerializeClass(RUNTIME_CLASS(OAnalogData));
      pProcess->Serialize(ar);
      }
   else
      {
      UINT version = ar.m_nObjectSchema;
      ASSERT_KINDOF( CDoc, ar.m_pDocument );
      ar >> name;
      ar >> description;
      ar >> enableProcessing;
      ar >> nativeType;
      ar >> active;

      value.ChangeType( nativeType );
      ar.SerializeClass(RUNTIME_CLASS(OAnalogData));
      pProcess->Serialize(ar);
      }
   }
コード例 #2
0
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);
	}
コード例 #3
0
void OModbusTag::Serialize(CArchive& ar)
   {
   if (ar.IsStoring())
      {
      ar << (BOOL)m_IsOutput;
      //ar << offset;
      ar << simType;
      }
   else
      {
      UINT version = ar.m_nObjectSchema;
      BOOL temp;
      ar >> temp; m_IsOutput = temp;
      //ar >> offset;
      ar >> simType;
      }
   ar.SerializeClass(RUNTIME_CLASS(OTag));
   OTag::Serialize(ar);
   }
コード例 #4
0
void ODevice::Serialize(CArchive& ar)
   {
   if (ar.IsStoring())
      {
      ar << backup;
      ar << simulate;
      //ar.SerializeClass(RUNTIME_CLASS(ODeviceParams));
      //primary.Serialize(ar);
      }
   else
      {
      UINT version = ar.m_nObjectSchema;
      ar >> backup;
      ar >> simulate;
      //ar.SerializeClass(RUNTIME_CLASS(ODeviceParams));
      //primary.Serialize(ar);
      }
   ar.SerializeClass(RUNTIME_CLASS(OTagGroup));
   OTagGroup::Serialize(ar);
   }