Changes between Initial Version and Version 1 of MapGuideRfc82


Ignore:
Timestamp:
08/13/09 21:23:15 (15 years ago)
Author:
klain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • MapGuideRfc82

    v1 v1  
     1= !MapGuide RFC 82 - Extend MgReader Access by Index =
     2
     3This page contains a change request (RFC) for the !MapGuide Open Source project.
     4More !MapGuide RFCs can be found on the [wiki:MapGuideRfcs RFCs] page.
     5
     6== Status ==
     7
     8||RFC Template Version||(1.0)||
     9||Submission Date||August 14, 2009||
     10||Last Modified||(Klain Qin) (Fri Aug 14 09:46:19 2009)||
     11||Author||(Klain Qin)||
     12||RFC Status||Draft||
     13||Implementation Status||(pending)||
     14||Proposed Milestone||(2.2)||
     15||Assigned PSC guide(s)||(Tom Fukushima)||
     16||'''Voting History'''||(vote date)||
     17||+1||||
     18||+0||||
     19||-0||||
     20||-1||||
     21
     22== Overview ==
     23
     24This proposal is a continuation of FDO RFC 34(http://trac.osgeo.org/fdo/wiki/FDORfc34). FDO RFC 34 has enhanced the capability of FdoIReader to support indexed access. This proposal is to enhance the MgReader in MapGuide Feature Service API to support indexed access too.
     25
     26== Motivation ==
     27
     28To provide faster access to data returned from MapGuide Feature Service API.
     29To provide enhanced compatibility with ADO.Net Reader/Record Interfaces.
     30
     31== Proposed Solution ==
     32
     33The following reader interfaces will be updated to allow for indexed access.
     34
     35=== Interface MgReader ===
     36{{{
     37/////////////////////////////////////////////////////////////////
     38/// \brief
     39/// Provides a forward-only, read-only iterator for reading data.
     40/// You must call ReadNext before you can access any data. This
     41/// is a base class for MgDataReader, MgFeatureReader, and
     42/// MgSqlDataReader.
     43///
     44
     45class MG_PLATFORMBASE_API  MgReader : public MgSerializable
     46{
     47PUBLISHED_API:
     48...
     49...
     50...
     51    /////////////////////////////////////////////////////////////////////
     52    /// \brief
     53    /// Determines whether the value of the specified property is
     54    /// null.
     55    ///
     56    /// <!-- Syntax in .Net, Java, and PHP -->
     57    /// \htmlinclude DotNetSyntaxTop.html
     58    /// virtual bool IsNull(string propertyName);
     59    /// \htmlinclude SyntaxBottom.html
     60    /// \htmlinclude JavaSyntaxTop.html
     61    /// virtual boolean IsNull(String propertyName);
     62    /// \htmlinclude SyntaxBottom.html
     63    /// \htmlinclude PHPSyntaxTop.html
     64    /// virtual bool IsNull(string propertyName);
     65    /// \htmlinclude SyntaxBottom.html
     66    ///
     67    /// \param index (int)
     68    /// The position of the property in the list of
     69    /// properties belonging to the feature currently
     70    /// being read.
     71    ///
     72    /// \return
     73    /// Returns true if the value is null; otherwise returns false.
     74    ///
     75    virtual bool IsNull(INT32 index) = 0;
     76
     77    /////////////////////////////////////////////////////////////////////
     78    /// \brief
     79    /// Gets the Boolean value of the specified property.
     80    ///
     81    /// \remarks
     82    /// No conversion is performed. Therefore, the property must be of
     83    /// MgPropertyType::Boolean type or an
     84    /// MgInvalidPropertyTypeException is thrown.
     85    ///
     86    /// <!-- Syntax in .Net, Java, and PHP -->
     87    /// \htmlinclude DotNetSyntaxTop.html
     88    /// virtual bool GetBoolean(string propertyName);
     89    /// \htmlinclude SyntaxBottom.html
     90    /// \htmlinclude JavaSyntaxTop.html
     91    /// virtual boolean GetBoolean(String propertyName);
     92    /// \htmlinclude SyntaxBottom.html
     93    /// \htmlinclude PHPSyntaxTop.html
     94    /// virtual bool GetBoolean(string propertyName);
     95    /// \htmlinclude SyntaxBottom.html
     96    ///
     97    /// \param index (int)
     98    /// The position of the property in the list of
     99    /// properties belonging to the feature currently
     100    /// being read.
     101    ///
     102    /// \return
     103    /// Returns the Boolean value.
     104    ///
     105    /// \exception MgInvalidPropertyTypeException.
     106    ///
     107    ///
     108    virtual bool GetBoolean(INT32 index) = 0;
     109
     110    /////////////////////////////////////////////////////////////////////
     111    /// \brief
     112    /// Gets the Byte value of the specified property.
     113    ///
     114    /// \remarks
     115    /// No conversion is performed. Therefore, the property must be
     116    /// of type MgPropertyType::Byte or an
     117    /// MgInvalidPropertyTypeException is thrown.
     118    ///
     119    /// <!-- Syntax in .Net, Java, and PHP -->
     120    /// \htmlinclude DotNetSyntaxTop.html
     121    /// virtual unsigned char GetByte(string propertyName);
     122    /// \htmlinclude SyntaxBottom.html
     123    /// \htmlinclude JavaSyntaxTop.html
     124    /// virtual signed char GetByte(String propertyName);
     125    /// \htmlinclude SyntaxBottom.html
     126    /// \htmlinclude PHPSyntaxTop.html
     127    /// virtual int GetByte(string propertyName);
     128    /// \htmlinclude SyntaxBottom.html
     129    ///
     130    /// \param index (int)
     131    /// The position of the property in the list of
     132    /// properties belonging to the feature currently
     133    /// being read.
     134    ///
     135    /// \return
     136    /// Returns the Byte value.
     137    ///
     138    /// \exception MgInvalidPropertyTypeException.
     139    ///
     140    ///
     141    virtual BYTE GetByte(INT32 index) = 0;
     142
     143    /////////////////////////////////////////////////////////////////////
     144    /// \brief
     145    /// Gets the MgDateTime value of the specified property.
     146    ///
     147    /// \remarks
     148    /// No conversion is performed. Therefore, the property must be
     149    /// of type MgPropertyType::DateTime or an
     150    /// MgInvalidPropertyTypeException is thrown.
     151    ///
     152    /// <!-- Syntax in .Net, Java, and PHP -->
     153    /// \htmlinclude DotNetSyntaxTop.html
     154    /// virtual MgDateTime GetDateTime(string propertyName);
     155    /// \htmlinclude SyntaxBottom.html
     156    /// \htmlinclude JavaSyntaxTop.html
     157    /// virtual MgDateTime GetDateTime(String propertyName);
     158    /// \htmlinclude SyntaxBottom.html
     159    /// \htmlinclude PHPSyntaxTop.html
     160    /// virtual MgDateTime GetDateTime(string propertyName);
     161    /// \htmlinclude SyntaxBottom.html
     162    ///
     163    /// \param index (int)
     164    /// The position of the property in the list of
     165    /// properties belonging to the feature currently
     166    /// being read.
     167    ///
     168    /// \return
     169    /// Returns an MgDateTime object.
     170    ///
     171    /// \exception MgInvalidPropertyTypeException.
     172    ///
     173    ///
     174    virtual MgDateTime* GetDateTime(INT32 index) = 0;
     175
     176    /////////////////////////////////////////////////////////////////////
     177    /// \brief
     178    /// Gets the Single value of the specified property.
     179    ///
     180    /// \remarks
     181    /// No conversion is performed. Therefore, the property must be a
     182    /// of type MgPropertyType::Single or an
     183    /// MgInvalidPropertyTypeException is thrown.
     184    ///
     185    /// <!-- Syntax in .Net, Java, and PHP -->
     186    /// \htmlinclude DotNetSyntaxTop.html
     187    /// virtual float GetSingle(string propertyName);
     188    /// \htmlinclude SyntaxBottom.html
     189    /// \htmlinclude JavaSyntaxTop.html
     190    /// virtual float GetSingle(String propertyName);
     191    /// \htmlinclude SyntaxBottom.html
     192    /// \htmlinclude PHPSyntaxTop.html
     193    /// virtual float GetSingle(string propertyName);
     194    /// \htmlinclude SyntaxBottom.html
     195    ///
     196    /// \param index (int)
     197    /// The position of the property in the list of
     198    /// properties belonging to the feature currently
     199    /// being read.
     200    ///
     201    /// \return
     202    /// Returns the single value.
     203    ///
     204    /// \exception MgInvalidPropertyTypeException.
     205    ///
     206    ///
     207    virtual float GetSingle(INT32 index) = 0;
     208
     209    /////////////////////////////////////////////////////////////////////
     210    /// \brief
     211    /// Gets the Double value of the specified property.
     212    ///
     213    /// \remarks
     214    /// No conversion is performed. Therefore, the property must be a
     215    /// of type MgPropertyType::Double or an
     216    /// MgInvalidPropertyTypeException is thrown.
     217    ///
     218    /// <!-- Syntax in .Net, Java, and PHP -->
     219    /// \htmlinclude DotNetSyntaxTop.html
     220    /// virtual double GetDouble(string propertyName);
     221    /// \htmlinclude SyntaxBottom.html
     222    /// \htmlinclude JavaSyntaxTop.html
     223    /// virtual double GetDouble(String propertyName);
     224    /// \htmlinclude SyntaxBottom.html
     225    /// \htmlinclude PHPSyntaxTop.html
     226    /// virtual double GetDouble(string propertyName);
     227    /// \htmlinclude SyntaxBottom.html
     228    ///
     229    /// \param index (int)
     230    /// The position of the property in the list of
     231    /// properties belonging to the feature currently
     232    /// being read.
     233    ///
     234    /// \return
     235    /// Returns the double value.
     236    ///
     237    /// \exception MgInvalidPropertyTypeException.
     238    ///
     239    ///
     240    virtual double GetDouble(INT32 index) = 0;
     241
     242    /////////////////////////////////////////////////////////////////////
     243    /// \brief
     244    /// Gets the 16 bit integer value of the specified property.
     245    ///
     246    /// \remarks
     247    /// No conversion is performed. Therefore the property must be a
     248    /// of type MgPropertyType::Int16 or an
     249    /// MgInvalidPropertyTypeException is thrown.
     250    ///
     251    /// <!-- Syntax in .Net, Java, and PHP -->
     252    /// \htmlinclude DotNetSyntaxTop.html
     253    /// virtual short GetInt16(string propertyName);
     254    /// \htmlinclude SyntaxBottom.html
     255    /// \htmlinclude JavaSyntaxTop.html
     256    /// virtual short GetInt16(String propertyName);
     257    /// \htmlinclude SyntaxBottom.html
     258    /// \htmlinclude PHPSyntaxTop.html
     259    /// virtual int GetInt16(string propertyName);
     260    /// \htmlinclude SyntaxBottom.html
     261    ///
     262    /// \param index (int)
     263    /// The position of the property in the list of
     264    /// properties belonging to the feature currently
     265    /// being read.
     266    ///
     267    /// \return
     268    /// Returns the 16 bit integer value.
     269    ///
     270    /// \exception MgInvalidPropertyTypeException
     271    ///
     272    ///
     273    virtual INT16 GetInt16(INT32 index) = 0;
     274
     275    /////////////////////////////////////////////////////////////////////
     276    /// \brief
     277    /// Gets the 32 bit integer value of the specified property.
     278    ///
     279    /// \remarks
     280    /// No conversion is performed. Therefore, the property must be a
     281    /// of type MgPropertyType::Int32 or an
     282    /// MgInvalidPropertyTypeException is thrown.
     283    ///
     284    /// <!-- Syntax in .Net, Java, and PHP -->
     285    /// \htmlinclude DotNetSyntaxTop.html
     286    /// virtual int GetInt32(string propertyName);
     287    /// \htmlinclude SyntaxBottom.html
     288    /// \htmlinclude JavaSyntaxTop.html
     289    /// virtual int GetInt32(String propertyName);
     290    /// \htmlinclude SyntaxBottom.html
     291    /// \htmlinclude PHPSyntaxTop.html
     292    /// virtual int GetInt32(string propertyName);
     293    /// \htmlinclude SyntaxBottom.html
     294    ///
     295    /// \param index (int)
     296    /// The position of the property in the list of
     297    /// properties belonging to the feature currently
     298    /// being read.
     299    ///
     300    /// \return
     301    /// Returns the integer 32 bits value.
     302    ///
     303    /// \exception MgInvalidPropertyTypeException.
     304    ///
     305    ///
     306    virtual INT32 GetInt32(INT32 index) = 0;
     307
     308    /////////////////////////////////////////////////////////////////////
     309    /// \brief
     310    /// Gets the 64 bit integer value of the specified property.
     311    ///
     312    /// \remarks
     313    /// No conversion is performed. Therefore, the property must be a
     314    /// of type MgPropertyType::Int64 or an
     315    /// MgInvalidPropertyTypeException is thrown.
     316    ///
     317    /// <!-- Syntax in .Net, Java, and PHP -->
     318    /// \htmlinclude DotNetSyntaxTop.html
     319    ///  virtual long GetInt64(string propertyName);
     320    /// \htmlinclude SyntaxBottom.html
     321    /// \htmlinclude JavaSyntaxTop.html
     322    ///  virtual long GetInt64(String propertyName);
     323    /// \htmlinclude SyntaxBottom.html
     324    /// \htmlinclude PHPSyntaxTop.html
     325    ///  virtual string GetInt64(string propertyName);
     326    /// \htmlinclude SyntaxBottom.html
     327    ///
     328    /// \param index (int)
     329    /// The position of the property in the list of
     330    /// properties belonging to the feature currently
     331    /// being read.
     332    ///
     333    /// \return
     334    /// Returns the integer 64 bits value.
     335    ///
     336    /// \exception MgInvalidPropertyTypeException.
     337    ///
     338    /// \note
     339    /// INT64 is actually a pointer to an Integer64 object
     340    ///
     341    virtual INT64 GetInt64(INT32 index) = 0;
     342
     343    /////////////////////////////////////////////////////////////////////
     344    /// \brief
     345    /// Gets the string value of the specified property.
     346    ///
     347    /// \remarks
     348    /// No conversion is performed. Therefore, the property must be a
     349    /// of type MgPropertyType::String or an
     350    /// MgInvalidPropertyTypeException is thrown.
     351    ///
     352    /// <!-- Syntax in .Net, Java, and PHP -->
     353    /// \htmlinclude DotNetSyntaxTop.html
     354    /// virtual string GetString(string propertyName);
     355    /// \htmlinclude SyntaxBottom.html
     356    /// \htmlinclude JavaSyntaxTop.html
     357    /// virtual String GetString(String propertyName);
     358    /// \htmlinclude SyntaxBottom.html
     359    /// \htmlinclude PHPSyntaxTop.html
     360    /// virtual string GetString(string propertyName);
     361    /// \htmlinclude SyntaxBottom.html
     362    ///
     363    /// \param index (int)
     364    /// The position of the property in the list of
     365    /// properties belonging to the feature currently
     366    /// being read.
     367    ///
     368    /// \return
     369    /// Returns the string value.
     370    ///
     371    /// \exception MgInvalidPropertyTypeException.
     372    ///
     373    ///
     374    virtual STRING GetString(INT32 index) = 0;
     375
     376    /////////////////////////////////////////////////////////////////////
     377    /// \brief
     378    /// Gets the \link BLOB BLOB \endlink value of the specified property.
     379    ///
     380    /// \remarks
     381    /// No conversion is performed. Therefore, the property must be
     382    /// of type MgPropertyType::Blob or an
     383    /// MgInvalidPropertyTypeException is thrown.
     384    ///
     385    /// <!-- Syntax in .Net, Java, and PHP -->
     386    /// \htmlinclude DotNetSyntaxTop.html
     387    /// virtual MgByteReader GetBLOB(string propertyName);
     388    /// \htmlinclude SyntaxBottom.html
     389    /// \htmlinclude JavaSyntaxTop.html
     390    /// virtual MgByteReader GetBLOB(String propertyName);
     391    /// \htmlinclude SyntaxBottom.html
     392    /// \htmlinclude PHPSyntaxTop.html
     393    /// virtual MgByteReader GetBLOB(string propertyName);
     394    /// \htmlinclude SyntaxBottom.html
     395    ///
     396    /// \param index (int)
     397    /// The position of the property in the list of
     398    /// properties belonging to the feature currently
     399    /// being read.
     400    ///
     401    /// \return
     402    /// Returns the BLOB value in an MgByteReader object.
     403    ///
     404    /// \exception MgInvalidPropertyTypeException
     405    ///
     406    ///
     407    virtual MgByteReader* GetBLOB(INT32 index) = 0;
     408
     409    /////////////////////////////////////////////////////////////////////
     410    /// \brief
     411    /// Gets the CLOB value of the specified property.
     412    ///
     413    /// \remarks
     414    /// No conversion is performed. Therefore, the property must be a
     415    /// of type MgPropertyType::Clob or an
     416    /// MgInvalidPropertyTypeException is thrown.
     417    ///
     418    /// <!-- Syntax in .Net, Java, and PHP -->
     419    /// \htmlinclude DotNetSyntaxTop.html
     420    /// virtual MgByteReader GetCLOB(string propertyName);
     421    /// \htmlinclude SyntaxBottom.html
     422    /// \htmlinclude JavaSyntaxTop.html
     423    /// virtual MgByteReader GetCLOB(String propertyName);
     424    /// \htmlinclude SyntaxBottom.html
     425    /// \htmlinclude PHPSyntaxTop.html
     426    /// virtual MgByteReader GetCLOB(string propertyName);
     427    /// \htmlinclude SyntaxBottom.html
     428    ///
     429    /// \param index (int)
     430    /// The position of the property in the list of
     431    /// properties belonging to the feature currently
     432    /// being read.
     433    ///
     434    /// \return
     435    /// Returns the CLOB value in an MgByteReader object.
     436    ///
     437    /// \exception MgInvalidPropertyTypeException.
     438    ///
     439    ///
     440    virtual MgByteReader* GetCLOB(INT32 index) = 0;
     441
     442    /////////////////////////////////////////////////////////////////////
     443    /// \brief
     444    /// Gets the Geometry for the specified property.
     445    ///
     446    /// \remarks
     447    /// No conversion is performed. Therefore, the property must be a
     448    /// of type MgPropertyType::Geometry or an
     449    /// MgInvalidPropertyTypeException is thrown.
     450    ///
     451    /// <!-- Syntax in .Net, Java, and PHP -->
     452    /// \htmlinclude DotNetSyntaxTop.html
     453    /// virtual MgByteReader GetGeometry(string propertyName);
     454    /// \htmlinclude SyntaxBottom.html
     455    /// \htmlinclude JavaSyntaxTop.html
     456    /// virtual MgByteReader GetGeometry(String propertyName);
     457    /// \htmlinclude SyntaxBottom.html
     458    /// \htmlinclude PHPSyntaxTop.html
     459    /// virtual MgByteReader GetGeometry(string propertyName);
     460    /// \htmlinclude SyntaxBottom.html
     461    ///
     462    /// \param index (int)
     463    /// The position of the property in the list of
     464    /// properties belonging to the feature currently
     465    /// being read.
     466    ///
     467    /// \return
     468    /// Returns a geometry in AGF binary format in an MgByteReader
     469    /// object.
     470    ///
     471    /// \exception MgInvalidPropertyTypeException
     472    ///
     473    ///
     474    virtual MgByteReader* GetGeometry(INT32 index) = 0;
     475
     476    ///////////////////////////////////////////////////////////////////////
     477    /// \brief
     478    /// Gets the raster object of the specified property.
     479    ///
     480    /// \remarks
     481    /// The property must be of type MgPropertyType::Raster, or an
     482    /// MgInvalidPropertyTypeException is thrown.
     483    ///
     484    /// <!-- Syntax in .Net, Java, and PHP -->
     485    /// \htmlinclude DotNetSyntaxTop.html
     486    /// virtual MgRaster GetRaster(string propertyName);
     487    /// \htmlinclude SyntaxBottom.html
     488    /// \htmlinclude JavaSyntaxTop.html
     489    /// virtual MgRaster GetRaster(String propertyName);
     490    /// \htmlinclude SyntaxBottom.html
     491    /// \htmlinclude PHPSyntaxTop.html
     492    /// virtual MgRaster GetRaster(string propertyName);
     493    /// \htmlinclude SyntaxBottom.html
     494    ///
     495    /// \param index (int)
     496    /// The position of the property in the list of
     497    /// properties belonging to the feature currently
     498    /// being read.
     499    ///
     500    /// \return
     501    /// Returns an MgRaster object.
     502    ///
     503    /// \exception MgConnectionNotOpenException MgNullPropertyValueException
     504    /// \exception MgFdoException MgInvalidPropertyTypeException
     505    /// \exception MgInvalidPropertyTypeException.
     506    ///
     507    ///
     508    virtual MgRaster* GetRaster(INT32 index) = 0;
     509};
     510}}}
     511
     512=== Interface MgFeatureReader ===
     513{{{
     514class MG_PLATFORMBASE_API MgFeatureReader : public MgReader
     515{
     516    DECLARE_CLASSNAME(MgFeatureReader)
     517
     518PUBLISHED_API:
     519...
     520...
     521...
     522    ///////////////////////////////////////////////////////////////////////
     523    /// \brief
     524    /// Use this method to obtain the values of the properties
     525    /// belonging to an object contained in the feature class
     526    /// instance. Such an object is a property of the feature class
     527    /// instance with a type of MgPropertyType::Feature.
     528    ///
     529    /// <!-- Syntax in .Net, Java, and PHP -->
     530    /// \htmlinclude DotNetSyntaxTop.html
     531    /// virtual MgFeatureReader GetFeatureObject(string propertyName);
     532    /// \htmlinclude SyntaxBottom.html
     533    /// \htmlinclude JavaSyntaxTop.html
     534    /// virtual MgFeatureReader GetFeatureObject(String propertyName);
     535    /// \htmlinclude SyntaxBottom.html
     536    /// \htmlinclude PHPSyntaxTop.html
     537    /// virtual MgFeatureReader GetFeatureObject(string propertyName);
     538    /// \htmlinclude SyntaxBottom.html
     539    ///
     540    /// \param index (int)
     541    /// The position of the property in the list of
     542    /// properties belonging to the feature currently
     543    /// being read.
     544    ///
     545    /// \return
     546    /// Returns an MgFeatureReader object, which can be used to
     547    /// access properties of an object contained in the feature
     548    /// object.
     549    ///
     550    /// \exception MgInvalidArgumentException
     551    ///  if the property type is not a
     552    ///  feature.
     553    /// \exception MgConnectionNotOpenException
     554    /// \exception MgNullPropertyValueException
     555    /// \exception MgFdoException
     556    ///
     557    virtual MgFeatureReader* GetFeatureObject(INT32 index) = 0;
     558
     559INTERNAL_API:
     560
     561    //////////////////////////////////////////////////////////////////
     562    /// \brief
     563    /// Gets the Geometry for the specified property. No conversion is
     564    /// performed, thus the property must be a of type Geometry or the result
     565    /// is NULL
     566    ///
     567    /// \param index (int)
     568    /// The position of the property in the list of
     569    /// properties belonging to the feature currently
     570    /// being read.
     571    ///
     572    /// \return
     573    /// Returns a ByteReader object
     574    ///
     575    virtual BYTE_ARRAY_OUT GetGeometry(INT32 index, INT32& length) = 0;
     576...
     577...
     578...
     579}}}
     580== Implications ==
     581
     582This RFC depends on FDO RFC 34 (http://trac.osgeo.org/fdo/wiki/FDORfc34). If FDORfc34 can't be approved, this RFC won't be approved either.
     583
     584It adds new virtual functions to existing reader interfaces, so API documentation needs to be updated. However, there will be no impact on existing applications.
     585
     586== Test Plan ==
     587
     588New unit tests will be added to test the indexed access.
     589
     590== Funding/Resources ==
     591
     592Supplied by Autodesk.