Version: 0.6.0
contupdater.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Catalog)
3  * Purpose: Remote Connection classes.
4  * Author: Dmitry Baryshnikov (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 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/gxobject.h"
24 
25 #include <wx/hashmap.h>
26 
27 WX_DECLARE_HASH_MAP(int, wxString, wxIntegerHash, wxIntegerEqual, wxGxObjectMap);
28 
36 class WXDLLIMPEXP_GIS_CLT wxGxObjectContainerUpdater :
37  public wxGxObjectContainer,
38  public wxThreadHelper,
39  public IGxObjectNotifier
40 {
41  DECLARE_ABSTRACT_CLASS(wxGxObjectContainerUpdater)
42 public:
43  wxGxObjectContainerUpdater(wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
44  virtual ~wxGxObjectContainerUpdater();
45  //IGxObjectNotifier
46  virtual void OnGetUpdates();
47 protected:
48  virtual wxThread::ExitCode Entry();
49  virtual bool CreateAndRunThread(void);
50  virtual void StopThread();
51  virtual wxGxObject *GetChildByRemoteId(int nRemoteId) const;
52  virtual wxGxObjectMap GetRemoteObjects() = 0;
53  virtual void DeleteObject(int nRemoteId);
54  virtual void RenameObject(int nRemoteId, const wxString &sNewName);
55  virtual void AddObject(int nRemoteId, const wxString &sName) = 0;
56 protected:
57  wxGxObjectMap m_smObjects;
58  int m_nLongWait, m_nShortWait;
59  int m_nProcessUpdatesRequests;
60  bool m_bChildrenLoaded;
61 };
62 
70 class WXDLLIMPEXP_GIS_CLT wxGxRemoteId
71 {
72 public:
73  wxGxRemoteId();
74  wxGxRemoteId(int nRemoteId);
75  virtual ~wxGxRemoteId(void);
76  virtual int GetRemoteId() const;
77  virtual void SetRemoteId(int nRemoteId);
78 protected:
79  int m_nRemoteId;
80 };
81 
82 
Definition: catalog.h:136
Definition: gxobject.h:78
Definition: contupdater.h:70
Definition: contupdater.h:36
Definition: gxobject.h:37