Version: 0.6.0
gxpostgisdataset.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: GxPostGISDataset classes.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2011,2013,2014 Dmitry Baryshnikov
7 *
8 * This program is free software: you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation, either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  ****************************************************************************/
21 #pragma once
22 
23 #include "wxgis/catalog/catalog.h"
24 
25 #ifdef wxGIS_USE_POSTGRES
26 
27 #include "wxgis/datasource/postgisdataset.h"
28 #include "wxgis/catalog/gxdataset.h"
29 #include "wxgis/catalog/contupdater.h"
30 
31 WX_DECLARE_STRING_HASH_MAP( wxString, wxGISIndexMap );
32 
40 class WXDLLIMPEXP_GIS_CLT wxGISPostGISBaseTable :
41  public wxGxRemoteId
42  {
43 public:
44  wxGISPostGISBaseTable(int nRemoteId, const wxString &sSchema, const wxString &soName, wxGISPostgresDataSource* pwxGISRemoteConn);
45  virtual ~wxGISPostGISBaseTable(void);
46  virtual wxULongLong GetTableSize();
47  virtual void FillIndixes();
48 protected:
49  wxString m_sTableName;
50  wxString m_sSchemaName;
51  wxString m_sFullyQualifiedName;
52  wxGISPostgresDataSource* m_pwxGISRemoteConn;
53  wxGISIndexMap m_msIndexs;
54  };
55 
63 class WXDLLIMPEXP_GIS_CLT wxGxPostGISTable :
64  public wxGxTable,
65  public wxGISPostGISBaseTable
66 {
67  DECLARE_CLASS(wxGxPostGISTable)
68 public:
69  wxGxPostGISTable(int nRemoteId, const wxString &sSchema, wxGISPostgresDataSource* pwxGISRemoteConn, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
70  virtual ~wxGxPostGISTable(void);
71  //wxGxObject
72  virtual wxString GetCategory(void) const {return wxString(_("PostGIS Table"));};
73  //wxGxDataset
74  virtual void FillMetadata(bool bForce);
75  //IGxDatasetEdit
76  virtual bool CanRename(void);
77  virtual bool CanCopy(const CPLString &szDestPath);
78  virtual bool CanMove(const CPLString &szDestPath);
79  virtual bool Rename(const wxString &sNewName);
80  virtual bool Delete(void);
81  virtual bool Copy(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
82  virtual bool Move(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
83 protected:
84  //create wxGISDataset without openning it
85  virtual wxGISDataset* const GetDatasetFast(void);
86 };
87 
95 class WXDLLIMPEXP_GIS_CLT wxGxPostGISFeatureDataset :
96  public wxGxFeatureDataset,
97  public wxGISPostGISBaseTable
98 {
99  DECLARE_CLASS(wxGxPostGISFeatureDataset)
100 public:
101  wxGxPostGISFeatureDataset(int nRemoteId, const wxString &sSchema, wxGISPostgresDataSource* pwxGISRemoteConn, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
102  virtual ~wxGxPostGISFeatureDataset(void);
103  //wxGxObject
104  virtual wxString GetCategory(void) const {return wxString(_("PostGIS Feature class"));};
105  //wxGxDataset
106  virtual void FillMetadata(bool bForce);
107  //IGxDatasetEdit
108  virtual bool CanRename(void);
109  virtual bool CanCopy(const CPLString &szDestPath);
110  virtual bool CanMove(const CPLString &szDestPath);
111  virtual bool Rename(const wxString &sNewName);
112  virtual bool Delete(void);
113  virtual bool Copy(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
114  virtual bool Move(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
115 protected:
116  //create wxGISDataset without openning it
117  virtual wxGISDataset* const GetDatasetFast(void);
118 };
119 
120 #endif //wxGIS_USE_POSTGRES
Definition: gxdataset.h:151
A TrackCancel interface class.
Definition: core.h:144
Definition: dataset.h:33
Definition: contupdater.h:70
Definition: gxdataset.h:124
Definition: gxobject.h:37