00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #ifndef INC_SML_OBJECT_H
00034 #define INC_SML_OBJECT_H
00035
00036 #ifndef INC_SML_STYPE_H
00037 #include <sml/stype.h>
00038 #endif
00039
00040 #ifndef INC_RVC_OBJITEM_H // For RVC::OBJITEM and RVC::OBJITEMLIST
00041 #include <rvc/objitem.h>
00042 #endif
00043
00044 #ifndef INC_MI32_ELEMTYPE_H
00045 #include <mi32/elemtype.h>
00046 #endif
00047
00048 #ifndef INC_MI32_COORDOP_H
00049 #include <mi32/coordop.h>
00050 #endif
00051
00052 #ifdef RVCSYSDLL
00053 #define RVCSYSLIBEXPORT MI_DLLEXPORT
00054 #define RVCSYSLIBCLASSEXPORT MI_DLLCLASSEXPORT
00055 #else
00056 #define RVCSYSLIBEXPORT MI_DLLIMPORT
00057 #define RVCSYSLIBCLASSEXPORT MI_DLLCLASSIMPORT
00058 #endif
00059
00060 #ifndef GENERATING_DOXYGEN_OUTPUT
00061 namespace RVC {
00062 class FILEHANDLE;
00063 class OBJECTOBSERVER;
00064 class OBJECT;
00065 }
00066 #endif
00067
00068 namespace SML {
00069 class CONTEXT;
00070 class ELEMDATA;
00071 class GEOSTRUCT;
00072 class OBJPROXY;
00073
00074
00081 class RVCSYSLIBCLASSEXPORT OBJECT {
00082 public:
00083
00084 void AddRef (
00085 );
00086
00087
00088
00089
00090
00091 static OBJECT* Allocate (
00092 RVC::OBJTYPE objtype
00093 );
00094
00098 ERRVALUE DeleteExisting (
00099 );
00100
00101
00102 int GetCurElemNum (
00103 ELEMTYPE elemtype
00104 ) const;
00105
00106 int GetElemData (
00107 ELEMDATA** pElemData,
00108 ELEMTYPE ElemType,
00109 bool bAllocIfNeeded = false
00110 );
00111
00113 const FILEPATH& GetFilePath (
00114 ) const;
00115
00116
00123 RVC::OBJECT* GetInterfaceBase (
00124 ) const;
00125
00126 RVC::OBJITEM& GetObjItem (
00127 );
00128
00129 const RVC::OBJITEM& GetObjItem (
00130 ) const;
00131
00132 RVC::OBJTYPE GetObjType (
00133 ) const;
00134
00135 STYPE GetSMLSTYPE (
00136 ) const;
00137
00138 bool IsDirty (
00139 ) const;
00140
00141 void Release (
00142 );
00143
00144
00145
00147 void SetDirty (
00148 bool bDirty = true
00149 );
00150
00152 void SetFilePath (
00153 const FILEPATH& filepath
00154 );
00155
00159 void SetIsUserTempObject (
00160 bool state
00161 );
00162
00164 void SetObjItem (
00165 const RVC::OBJITEM& item
00166 ) ;
00167
00171 ERRVALUE Setup (
00172 const RVC::OBJITEM& item,
00173 const RVC::CREDENTIALS* Credentials
00174 ) ;
00175
00176
00183 void Close (
00184 bool CloseDatabasesToo = false
00185 );
00186
00188 void CloseDatabases (
00189 );
00190
00192 int ConvertPointMapToObject (
00193 const DPOINT2D& src,
00194 const GEOSTRUCT* SrcGeoref,
00195 DPOINT2D* pDest
00196 );
00197
00199 int ConvertPointObjectToMap (
00200 const DPOINT2D& src,
00201 const GEOSTRUCT* DestGeoref,
00202 DPOINT2D* pDest
00203 );
00204
00207 void Free (
00208 );
00209
00210 const RVC::CREDENTIALS* GetCredentials (
00211 ) const;
00212
00215 OBJECT* Next (
00216 ) const;
00217
00218 #ifndef GENERATING_DOXYGEN_OUTPUT
00219 #if defined(RVCSYSDLL)
00226 // XXX Still used in qqcode.c
00227 DEPRECATED_MSG("Call GetInterface() and Open that")
00228 int Open (
00229 int mode
00230 );
00231 #endif
00232 #endif
00233
00234
00236 bool IsDoingForEach (
00237 ELEMTYPE ElemType
00238 ) const;
00239
00243 bool IsUserTempObject (
00244 ) const;
00245
00254 DEPRECATED int ReadGeoref (
00255 GEOSTRUCT **pGeostruct,
00256 const RVC::OBJITEM& ObjItem
00257 );
00258
00264 int ReadGeoref (
00265 GEOSTRUCT **pGeostruct,
00266 const RVC::OBJITEM* ObjItem = 0
00267 );
00268
00269 void OnInterfaceDestroy (
00270 );
00271
00272 void OnInterfaceAttach (
00273 const RVC::OBJITEM& ObjItem
00274 );
00275
00276 void OnInterfaceDetach (
00277 );
00278
00279 #ifndef GENERATING_DOXYGEN_OUTPUT
00280 static void SetRVCInterfaceProxy (
00281 OBJPROXY* proxy
00282 );
00283
00284 void SetCredentials (
00285 const RVC::CREDENTIALS* credentials
00286 );
00287
00288 #ifdef RVCSYSDLL // These methods are public but only for use inside RVCSYS
00289
00292 ERRVALUE OpenFileReal (
00293 int mode
00294 );
00295
00296 RVCINODENUM GetInodeReal (
00297 ) const;
00298
00299 ERRVALUE OpenReal (
00300 int mode,
00301 const RVC::CREDENTIALS* Credentials = 0
00302 );
00303 #endif
00304 #endif
00305
00306 protected:
00307
00308 static OBJPROXY* s_Proxy;
00309 mutable RVC::OBJECT* m_Interface;
00310
00311 void ConstructInterface (
00312 RVC::OBJTYPE
00313 ) const;
00314
00315
00316 OBJECT (
00317 STYPE type,
00318 CONTEXT* context
00319 );
00320
00321
00322 virtual ~OBJECT (
00323 );
00324
00325 #ifndef GENERATING_DOXYGEN_OUTPUT
00326
00327 virtual int v_OpenLow (
00328 int mode
00329 );
00330
00331 virtual void v_CloseLow (
00332 );
00333
00334 virtual RVC::OBJTYPE v_GetObjType (
00335 ) const;
00336
00337 #ifdef RVCSYSDLL
00339 protected:
00340 #else
00341 private:
00344 #endif
00345 INT32 m_RefCount;
00346
00347 OBJECT* m_prev;
00348 OBJECT* m_next;
00349 bool m_SystemTempObject;
00350 bool m_UserTempObject;
00351
00353 bool m_Dirty;
00354 bool m_bIsOpen;
00355
00356 RVC::OBJITEM m_ObjItem;
00357 STYPE m_stype;
00358 bool m_bOpenForWrite;
00359 GEOSTRUCT *m_georef;
00360 ELEMDATA *m_db[ELEMTYPE_NumTypes];
00361 UINT8 m_DoingForEach[ELEMTYPE_NumTypes];
00362 INT32 m_ElemNum[ELEMTYPE_NumTypes];
00363 CONTEXT* m_context;
00364 RVC::FILEHANDLE* m_fhandle;
00365 RVC::OBJECTOBSERVER* m_Observer;
00366 RVC::CREDENTIALS* m_Credentials;
00367 SPATREF::COORDOP_LIST* m_OpList;
00368
00369 friend class CONTEXT;
00370 friend class VM;
00371 friend class SYMBOL;
00372 #endif // GENERATING_DOXYGEN_OUTPUT
00373
00374 };
00375 }
00376
00377 typedef SML::OBJECT SMLOBJECT;
00378
00379
00380 #undef RVCSYSLIBEXPORT
00381 #undef RVCSYSLIBCLASSEXPORT
00382
00383 #endif // INC_SML_OBJECT_H
00384
00385