tabrelation.h
来自「linux下一款GIS程序源码」· C头文件 代码 · 共 87 行
H
87 行
// tabrelation.h: interface for the TABRelation class.///*--------------------------------------------------------------------- * class TABRelation * * Class that maintains a relation between 2 tables through a field * in each table (the SQL "where table1.field1=table2.field2" found in * TABView datasets). * * An instance of this class is used to read data records from the * combined tables as if they were a single one. *--------------------------------------------------------------------*/#ifndef TABRelation_H#define TABRelation_H#include "tabfile.h"class TABRelation { private: /* Information about the main table. */ TABFile *m_poMainTable; char *m_pszMainFieldName; int m_nMainFieldNo; /* Information about the related table. * NOTE: The related field MUST be indexed. */ TABFile *m_poRelTable; char *m_pszRelFieldName; int m_nRelFieldNo; TABINDFile *m_poRelINDFileRef; int m_nRelFieldIndexNo; int m_nUniqueRecordNo; /* Main and Rel table field map: * For each field in the source tables, -1 means that the field is not * selected, and a value >=0 is the index of this field in the combined * FeatureDefn */ int *m_panMainTableFieldMap; int *m_panRelTableFieldMap; UGKFeatureDefn *m_poDefn; void ResetAllMembers(); UGKByte *BuildFieldKey(TABFeature *poFeature, int nFieldNo, TABFieldType eType, int nIndexNo);public: TABRelation(); virtual ~TABRelation(); int Init(const char *pszViewName, TABFile *poMainTable, TABFile *poRelTable, const char *pszMainFieldName, const char *pszRelFieldName, char **papszSelectedFields); int CreateRelFields(); UGKFeatureDefn *GetFeatureDefn() {return m_poDefn;}; TABFieldType GetNativeFieldType(int nFieldId); TABFeature *GetFeature(int nFeatureId); int SetFeature(TABFeature *poFeature, int nFeatureId=-1); int SetFeatureDefn(UGKFeatureDefn *poFeatureDefn, TABFieldType *paeMapInfoNativeFieldTypes=NULL); int AddFieldNative(const char *pszName, TABFieldType eMapInfoType, int nWidth=0, int nPrecision=0, UGKBool bIndexed=FALSE, UGKBool bUnique=FALSE); int SetFieldIndexed(int nFieldId); UGKBool IsFieldIndexed(int nFieldId); UGKBool IsFieldUnique(int nFieldId); const char *GetMainFieldName() {return m_pszMainFieldName;}; const char *GetRelFieldName() {return m_pszRelFieldName;};};#endif
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?