📄 record.h
字号:
// Record.h: interface for the Record class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_RECORD_H__EB77A4C5_0CC5_4A09_A3A0_82556CB2E00A__INCLUDED_)
#define AFX_RECORD_H__EB77A4C5_0CC5_4A09_A3A0_82556CB2E00A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "ANY.h"
#include "AFX.h"
#include "Relationship.h"
#include "Update.h"
#include "Condition.h"
#include "KEY.h" // Added by ClassView
#include "NormalForm.h"
class Relationship;
class CCondition;
struct AttrItem
{
BYTE type;
UINT uOffset;
AttrItem()
{
type=0;
uOffset=0;
}
AttrItem(BYTE t,UINT uoff)
{
type=t;
uOffset=uoff;
}
};
class Record
{
//非跨块记录首部格式为
//长度(UINT),是否存在(BYTE),记录ID(UINT),时间戳(int)
//长度只包括记录体
//共13字节
public:
BOOL AddValues(CString *values);
void Draw(UINT Count,CListCtrl &List,Relationship *R1,Relationship *R2,BYTE mask[]);
KEY AttrToKey(WORD pos);
Record * Shadow(BYTE *mask,Relationship *pR1=NULL,Relationship *pR2=NULL);
unsigned short Hash();
BOOL operator < (const Record &R2);
BOOL operator ==(const Record &R2);
Record * operator +(const Record &rcd2);
BOOL Fit(CNormalForm &Form);
BOOL Fit(WORD AttrNo,CString AttrValue);
ANY AttrToValue(WORD pos);
CString AttrToString(WORD pos,Relationship *pR1=NULL,Relationship *pR2=NULL);
UINT ID;
UINT m_length;//对varchar字符串,包括了/0和长度标志
int time;
Relationship *pattern;//关系模式
//ANY *body;//body[0]废弃
BYTE *body;
//Record *forward;
Record();
Record &operator =(const Record &rcd);
Record(Relationship *r);
Record(WORD AN,UINT Length);
//Record(CBlock *cb,OffsetTerm *o);
UINT GetAttrNum();
UINT GetHalfLength(WORD &half_attr_num);//得到最接近一半的长度
void Update(const CUpdate &update);
BOOL AddValue(CString v,UINT i);
//BYTE * RecordToByte();
Record * Split();
virtual ~Record();
};
#endif // !defined(AFX_RECORD_H__EB77A4C5_0CC5_4A09_A3A0_82556CB2E00A__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -