28 | | Currently, data returned in Feature readers or Data readers can only be accessed using named properties. In the following example, the feature reader returned from the select command has to be accessed using the !GetDouble method, with an input parameter that is the property name. In such an implementation, there is an associated cost to determining which property is being requested. Such a cost is typically encountered in performing a lookup based on the name, which inevitably results in some form of a costly string comparison. |
| 28 | Currently, data returned in Feature readers, data or SQL readers can only be accessed using named parameters that reflect the name exact name of the property or column being read. In the following example, the feature reader returned from the select command has to be accessed using the !GetDouble method, with an input parameter that is the property name. In such an implementation, there is an associated cost to determining which property is being requested. Such a cost is typically encountered in performing a lookup based on the parameter name, which inevitably results in some form of a string comparison. |
65 | | The following FDo interfaces will be updated to allow for indexed access: |
| 65 | The following FDO capability interface will be updated to expose a capability method that indicates if indexed access is supported by the provider. The default implementation of this property will be 'false'. Providers will not be required to implement this method. |
| 66 | |
| 67 | === Interface ICommandCapabilities === |
| 68 | |
| 69 | {{{ |
| 70 | /// \brief |
| 71 | /// The FdoICommandCapabilities interface declares the feature |
| 72 | /// provider's level of support for Commands. |
| 73 | class FdoICommandCapabilities : public FdoIDisposable |
| 74 | { |
| 75 | public: |
| 76 | ... |
| 77 | ... |
| 78 | ... |
| 79 | /// \brief |
| 80 | /// Determines if the provider supports accessing reader properties by index. |
| 81 | /// The default access method is by name. |
| 82 | /// |
| 83 | /// \return |
| 84 | /// Returns true if the provider supports ExecuteFeatureReader. |
| 85 | /// |
| 86 | FDO_API virtual bool SupportsReaderPropertyAccessByIndex() |
| 87 | }; |
| 88 | }}} |
| 89 | |
| 90 | The following FDO reader interfaces will be updated to allow for indexed access. The default implementation of these properties will throw a Not Implemented exception. Providers will not be required to implement this method. Clients are required to use the above !SupportsReaderPropertyAccessByIndex method to determine if they can use these newly added index operations. |