博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
数据类的设计
阅读量:6469 次
发布时间:2019-06-23

本文共 2323 字,大约阅读时间需要 7 分钟。

**info.h

#pragma once_MB_DATABASE_BEGINclass MB_DATABASE_EXT CBeamSection:public CSection{public:	CBeamSection();	CBeamSection(const CBeamSection* pBeamSection);	virtual ~CBeamSection(void);	virtual CSection* Clone() const { return new CBeamSection(this);}	virtual void Copy(const CSection* pSection);	virtual BOOL Compare(const CSection* pSection) const;	CBeamSection & operator = (const CBeamSection &BeamSection){ Copy(&BeamSection);return *this; }	BOOL operator == (const CBeamSection &BeamSection) const { return Compare(&BeamSection); }	virtual BOOL Import(const CSection* pSection);	virtual void Serialize(CArchive& ar);}_MB_DATABASE_END

**info.cpp

_MB_DATABASE_BEGINCBeamSection::CBeamSection(){	m_enType=BST_STANDARD;	m_enSectionType=ST_SPC001;	m_dGrade = 0;	m_dH = 1.5;}CBeamSection::CBeamSection(const CBeamSection* pBeamSection){	Copy(pBeamSection);}CBeamSection::~CBeamSection(void){}void CBeamSection::Copy(const CSection* pSection){  if (this == pSection) return;	Import(pSection);	CSection::Copy(pSection);}BOOL CBeamSection::Compare(const CSection* pSection) const{	_ASSERTE_RT_BL(pSection);	if(!CSection::Compare(pSection))		return FALSE;	const CBeamSection* pBeamSection = dynamic_cast
(pSection); _ASSERTE_RT_BL(pBeamSection); if(m_enType != pBeamSection->m_enType) return FALSE; if(m_enSectionType != pBeamSection->m_enSectionType) return FALSE; if(!Equal2Dbl(m_dGrade, pBeamSection->m_dGrade)) return FALSE; if(!Equal2Dbl(m_dH, pBeamSection->m_dH)) return FALSE; return TRUE;}BOOL CBeamSection::Import(const CSection* pSection){ const CBeamSection* pBeamSection = dynamic_cast
(pSection); _ASSERTE_RT_BL(pBeamSection); m_enType = pBeamSection->m_enType; m_bSingleSlope = pBeamSection->m_bSingleSlope; m_dGrade = pBeamSection->m_dGrade; m_dH = pBeamSection->m_dH; return TRUE;}void CBeamSection::Serialize(CArchive& ar){ CSection::Serialize(ar); if(ar.IsStoring()) { _PRESAVE(_T("CBeamSection")) { _BEGINESAVE(DATABASE_VERSION1) ar<< m_bSingleSlope; ar<< m_dGrade; ar<< m_dH; MBasic::Serialize(ar,m_enType); _ENDSAVE } _POSTSAVE } else { _PREOPEN(_T("CBeamSection")) { case DATABASE_VERSION1: ar>> m_bSingleSlope; ar>> m_dGrade; ar>> m_dH; MBasic::Serialize(ar,m_enType); break; } _POSTOPEN }}_MB_DATABASE_END

转载地址:http://xedko.baihongyu.com/

你可能感兴趣的文章
Webserver管理系列:3、Windows Update
查看>>
HDOJ 2151
查看>>
open-falcon
查看>>
doc2vec使用说明(一)gensim工具包TaggedLineDocument
查看>>
Q:图像太大,在opencv上显示不完全
查看>>
利用ItextPdf、core-renderer-R8 来生成PDF
查看>>
NavigationController的使用
查看>>
多线程编程之Windows环境下创建新线程
查看>>
Unity3D NGUI 给button按钮添加单间事件
查看>>
密码的校验.大小写字母,数字,特殊字符中的至少3种
查看>>
ios 不同sdk4.3 6.0版本号,关于方法的兼容性的通用方法
查看>>
js滚动加载到底部
查看>>
Virtualbox 虚拟机网络不通
查看>>
memcache数据库和redis数据库的区别(理论)
查看>>
我的友情链接
查看>>
MyBatis+Spring结合
查看>>
Office 365之SkyDrive Pro
查看>>
Java Web 高性能开发
查看>>
初识Scala反射
查看>>
第三十九天
查看>>