datavessel.h
来自「一个长度信息管理系统。主要包含了界面编程和对文件操作。」· C头文件 代码 · 共 94 行
H
94 行
#include <afxtempl.h> //定义CArray()
#ifndef _TREEFUNCTION_H
#define _TREEFUNCTION_H
enum enumCellType
{
ct_Length = 1,
ct_Point ,
};
// 数据单元的结构基类
class CCellBase
{
public:
CCellBase ()
{
m_CellType = ct_Length;
m_No = 0;
}
//
bool InValid()
{
return true;
}
void SetNo(long no);
long GetNo();
void SetCellType(enumCellType CellType);
enumCellType GetCellType();
private:
enumCellType m_CellType; // 单元类型 1 : 长度 2 :点
long m_No; //序号
};
typedef CCellBase* LPCCellBase;
typedef CArray<LPCCellBase, LPCCellBase> CCellBaseArray;
typedef CCellBaseArray* LPCCellBaseArray;
//长度数据单元的结构
class CLength:public CCellBase
{
private:
double m_Length; // 长度
public:
CLength()
{
m_Length = 0;
}
double GetLen();
CLength(double len)
{
m_Length = len;
}
};
// 数据容器
class CCellArray
{
public:
bool Add(LPCCellBase pCellBase);
bool Remove(long index);
LPCCellBase GetArrayItem(int n);
bool RemoveAll();
long GetCount();
private:
CCellBaseArray m_CellArray;
};
typedef CCellArray* LPCCellArray;
class SysApplication
{
public:
// 初始化系统
void InitInstance();
// 退出
void ExitInstance();
long GetCount();
LPCCellArray GetCellArray();
private:
CCellArray m_DataArray;
};
#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?