Version: 0.6.0
gxdataset.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: GxDataset classes.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2009-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 #include "wxgis/catalog/gxobject.h"
25 #include "wxgis/datasource/dataset.h"
26 #include "wxgis/datasource/table.h"
27 #include "wxgis/datasource/featuredataset.h"
28 
36 class WXDLLIMPEXP_GIS_CLT wxGxDataset :
37  public wxGxObject,
38  public IGxObjectEdit,
39  public IGxDataset
40 {
41  DECLARE_ABSTRACT_CLASS(wxGxDataset)
42 public:
43  wxGxDataset(wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
44  virtual ~wxGxDataset(void);
45  virtual wxGISDataset* const GetDataset(bool bCached = true, ITrackCancel* const pTrackCancel = NULL) = 0;
46  virtual wxGISEnumDatasetType GetType(void) const = 0;
47  virtual int GetSubType(void) const = 0;
48  virtual wxULongLong GetSize(void) const {return m_nSize;};
49  virtual wxDateTime GetModificationDate(void) const {return m_dtMod;};
50  virtual void FillMetadata(bool bForce = false);
51  virtual bool IsMetadataFilled() const;
52  //wxGxObject
53  virtual void SetPath(const CPLString &soPath);
54  //IGxObjectEdit
55  virtual bool CanDelete(void);
56  virtual bool CanRename(void);
57  virtual bool CanCopy(const CPLString &szDestPath);
58  virtual bool CanMove(const CPLString &szDestPath);
59  virtual bool Delete(void);
60  virtual bool Rename(const wxString &sNewName);
61  virtual bool Copy(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
62  virtual bool Move(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
63 protected:
64  //create wxGISDataset without openning it
65  virtual wxGISDataset* const GetDatasetFast(void) = 0;
66 protected:
67  wxGISDataset* m_pwxGISDataset;
68  wxULongLong m_nSize;
69  wxDateTime m_dtMod;
70  bool m_bIsMetadataFilled;
71 };
72 
80 class WXDLLIMPEXP_GIS_CLT wxGxDatasetContainer :
81  public wxGxObjectContainer,
82  public IGxObjectEdit,
83  public IGxDataset
84 {
85  DECLARE_ABSTRACT_CLASS(wxGxDatasetContainer)
86 public:
87  wxGxDatasetContainer(wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
88  virtual ~wxGxDatasetContainer(void);
89  virtual wxGISDataset* const GetDataset(bool bCached = true, ITrackCancel* const pTrackCancel = NULL) = 0;
90  virtual wxGISEnumDatasetType GetType(void) const = 0;
91  virtual int GetSubType(void) const = 0;
92  virtual wxULongLong GetSize(void) const {return m_nSize;};
93  virtual wxDateTime GetModificationDate(void) const {return m_dtMod;};
94  virtual void FillMetadata(bool bForce = false);
95  virtual bool IsMetadataFilled() const;
96  //wxGxObject
97  virtual void SetPath(const CPLString &soPath);
98  //IGxObjectEdit
99  virtual bool CanDelete(void);
100  virtual bool CanRename(void);
101  virtual bool CanCopy(const CPLString &szDestPath);
102  virtual bool CanMove(const CPLString &szDestPath);
103  virtual bool Delete(void);
104  virtual bool Rename(const wxString &sNewName);
105  virtual bool Copy(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
106  virtual bool Move(const CPLString &szDestPath, ITrackCancel* const pTrackCancel);
107 protected:
108  //create wxGISDataset without openning it
109  virtual wxGISDataset* const GetDatasetFast(void) = 0;
110 protected:
111  wxGISDataset* m_pwxGISDataset;
112  wxULongLong m_nSize;
113  wxDateTime m_dtMod;
114  bool m_bIsMetadataFilled;
115 };
116 
124 class WXDLLIMPEXP_GIS_CLT wxGxTable :
125  public wxGxDataset
126 {
127  DECLARE_CLASS(wxGxTable)
128 public:
129  wxGxTable(wxGISEnumTableType eType, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
130  virtual ~wxGxTable(void);
131  //wGxObject
132  virtual wxString GetCategory(void) const;
133  //wxGxDataset
134  virtual wxGISDataset* const GetDataset(bool bCache = true, ITrackCancel* const pTrackCancel = NULL);
135  virtual wxGISEnumDatasetType GetType(void) const {return enumGISTable;};
136  virtual int GetSubType(void) const { return m_eType; };
137 protected:
138  //create wxGISDataset without openning it
139  virtual wxGISDataset* const GetDatasetFast(void);
140 protected:
141  wxGISEnumTableType m_eType;
142 };
143 
151 class WXDLLIMPEXP_GIS_CLT wxGxFeatureDataset :
152  public wxGxDataset
153 {
154  DECLARE_CLASS(wxGxFeatureDataset)
155 public:
156  wxGxFeatureDataset(wxGISEnumVectorDatasetType eType, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
157  virtual ~wxGxFeatureDataset(void);
158  //wGxObject
159  virtual wxString GetCategory(void) const;
160  //wxGxDataset
161  virtual wxGISDataset* const GetDataset(bool bCache = true, ITrackCancel* const pTrackCancel = NULL);
162  virtual wxGISEnumDatasetType GetType(void) const {return enumGISFeatureDataset;};
163  virtual int GetSubType(void) const {return m_eType;};
164 protected:
165  virtual wxGISDataset* const GetDatasetFast(void);
166 protected:
167  wxGISEnumVectorDatasetType m_eType;
168 };
169 
177 class WXDLLIMPEXP_GIS_CLT wxGxRasterDataset :
178  public wxGxDataset
179 {
180  DECLARE_CLASS(wxGxRasterDataset)
181 public:
182  wxGxRasterDataset(wxGISEnumRasterDatasetType eType, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
183  virtual ~wxGxRasterDataset(void);
184  //wGxObject
185  virtual wxString GetCategory(void) const;
186  //wxGxDataset
187  virtual wxGISDataset* const GetDataset(bool bCache = true, ITrackCancel* const pTrackCancel = NULL);
188  virtual wxGISEnumDatasetType GetType(void) const {return enumGISRasterDataset;};
189  virtual int GetSubType(void) const {return m_eType;};
190 protected:
191  virtual wxGISDataset* const GetDatasetFast(void);
192 protected:
193  wxGISEnumRasterDatasetType m_eType;
194 };
Definition: catalog.h:103
Definition: gxdataset.h:151
A TrackCancel interface class.
Definition: core.h:144
Definition: gxdataset.h:80
Definition: gxobject.h:78
Definition: dataset.h:33
Definition: gxdataset.h:124
Definition: gxdataset.h:36
Definition: catalog.h:51
Definition: gxdataset.h:177
Definition: gxobject.h:37