Version: 0.6.0
cursor.h
1 /******************************************************************************
2  * Project: wxGIS
3  * Purpose: Cursor class.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2011 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/datasource/gdalinh.h"
24 
25 #include <list>
26 
27 class wxGISTable;
28 
33 class WXDLLIMPEXP_GIS_DS wxFeatureCursor : public wxObject
34 {
35  DECLARE_CLASS(wxFeatureCursor)
36 public:
37  wxFeatureCursor(wxGISTable* pFeatureDataSet);
38  virtual ~wxFeatureCursor(void);
39 
40  bool IsOk() const;
41 
42  bool operator == ( const wxFeatureCursor& obj ) const;
43  bool operator != (const wxFeatureCursor& obj) const { return !(*this == obj); };
44 
45 
46  virtual void Add(wxGISFeature Feature);
47  virtual void Reset(void);
48  virtual void Clear(void);
49  virtual wxGISFeature Next(void);
50  virtual size_t GetCount(void) const;
51  virtual wxGISTable* GetDataset() const;
52 protected:
53  virtual wxObjectRefData *CreateRefData() const;
54  virtual wxObjectRefData *CloneRefData(const wxObjectRefData *data) const;
55 protected:
56  std::list<wxGISFeature>::const_iterator m_Iterator;
57 };
58 
59 
64 class wxFeatureCursorRefData : public wxObjectRefData
65 {
66  friend class wxFeatureCursor;
67 public:
68  wxFeatureCursorRefData(wxGISTable* pFeatureDataSet);
69  virtual ~wxFeatureCursorRefData();
70  bool operator == (const wxFeatureCursorRefData& data) const;
72 
73  std::list<wxGISFeature>::const_iterator Begin(void) const;
74  wxGISTable* GetDataset() const;
75 protected:
76  std::list<wxGISFeature> m_olFeatures;
77  wxGISTable* m_pFeatureDataSet;
78 };
Definition: table.h:37
Definition: gdalinh.h:117
The class represents an array of OGRFeatures, received by some selection.
Definition: cursor.h:33
The reference data class for wxFeatureCursor.
Definition: cursor.h:64