Version: 0.6.0
rxobjectclient.h
1 /******************************************************************************
2  * Project: wxGIS (GIS Remote)
3  * Purpose: wxRxObject class.
4  * Author: Baryshnikov Dmitriy (aka Bishop), polimax@mail.ru
5  ******************************************************************************
6 * Copyright (C) 2010-2012 Bishop
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 
22 #pragma once
23 
24 #include "wxgis/catalog/gxobject.h"
25 #include "wxgis/net/netconn.h"
26 #include "wxgis/net/netevent.h"
27 
28 class WXDLLIMPEXP_GIS_RS wxRxCatalog;
29 
33 class WXDLLIMPEXP_GIS_RS wxRxObject
34 {
35 public:
36  wxRxObject(void);
37  virtual ~wxRxObject(void);
38  virtual bool Create (wxRxCatalog* const pRxCatalog, long nId, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
39  virtual void OnNetEvent(wxGISNetEvent& event);
40  virtual void SetRemoteId(long nId);
41  virtual long GetRemoteId(void) const;
42 protected:
43  wxRxCatalog* m_pRxCatalog;
44  long m_nRemoteId;
45 };
46 
50 class WXDLLIMPEXP_GIS_RS wxRxObjectContainer :
51  public wxRxObject,
52  public wxGxObjectContainer
53 {
54  DECLARE_CLASS(wxRxObjectContainer)
55 public:
56  wxRxObjectContainer(void);
57  wxRxObjectContainer(wxRxCatalog* const pRxCatalog, long nId, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
58  virtual bool Create (wxRxCatalog* const pRxCatalog, long nId, wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
59  virtual ~wxRxObjectContainer(void);
60  //wxGxObject
61  virtual void Refresh(void);
62  //wxGxObjectContainer
63  virtual bool DestroyChildren();
64  virtual bool Destroy(void);
65 protected:
66  virtual void LoadRemoteChildren(const wxXmlNode* pChildrenNode);
67  virtual void GetRemoteChildren(void);
68 protected:
69  bool m_bIsChildrenLoaded;
70 };
71 
75 class WXDLLIMPEXP_GIS_RS wxRxCatalog : public wxRxObjectContainer
76 {
77  DECLARE_CLASS(wxRxCatalog)
78 public:
79  wxRxCatalog(void);
80  wxRxCatalog(wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
81  virtual ~wxRxCatalog(void);
82  virtual bool Create (wxGxObject *oParent, const wxString &soName = wxEmptyString, const CPLString &soPath = "");
83  //register / unregister pointer and uniq ID
84  virtual void RegisterRemoteObject(wxRxObject* pObj);
85  virtual void UnRegisterRemoteObject(long nId);
86  //get pointer by ID
87  virtual wxRxObject* const GetRegisterRemoteObject(long nId);
88  virtual void SendNetMessage(const wxNetMessage & msg);
89 protected:
90  wxGISNetClientConnection* m_pNetConn;
91  std::map<long, wxRxObject*> m_moRxObject; //map of registered IGxObject pointers
92 };
The base class for Remote GxObjects (RxObjects).
Definition: rxobjectclient.h:33
The network connection interface class.
Definition: netconn.h:88
The base class for Remote GxObjectContainers (RxObjectContainers).
Definition: rxobjectclient.h:50
Definition: gxobject.h:78
Definition: message.h:42
Definition: netevent.h:34
The root of Remote GxObjects (RxObjects).
Definition: rxobjectclient.h:75
Definition: gxobject.h:37