Changes between Version 2 and Version 3 of FDORfc34


Ignore:
Timestamp:
Apr 15, 2009, 1:08:36 PM (15 years ago)
Author:
gregboone
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • FDORfc34

    v2 v3  
    2222== Motivation ==
    2323
     24To Provide faster access to data returned from readers in the FDO API.
     25
    2426== Overview ==
     27
     28Currently, data returned in Feature readers or Data readers can only be accessed using named properties. For example, 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 string comparison.
     29
     30{{{
     31FdoPtr<FdoISelect> spSelectCmd = static_cast<FdoISelect>(mConnection->CreateCommand(FdoCommandType_Select));
     32spSelectCmd->SetFeatureClassName (L"Foo");
     33
     34FdoPtr<FdoIdentifierCollection> spIds = spSelectCmd->GetPropertyNames ();
     35FdoPtr<FdoIdentifier> spId = FdoComputedIdentifier::Create(L"AVG_ID", FdoPtr<FdoExpression>(FdoExpression::Parse(L"Avg(ID)")));
     36spIds->Add(spId);
     37
     38FdoPtr<FdoIFeatureReader> spReader = spSelectCmd->Execute ();
     39while (spReader->ReadNext())
     40{
     41    double avg = spReader->GetDouble(L"AVG_ID");
     42}
     43}}}
     44
     45The goal of this RFC is to add overloaded methods to the various FDO reader interfaces that accept an integer argument representing the indexed location of the property in the reader's in-memory representation of the feature. It is expected that this will speed up processing and provide a better end-user experience. User would be able to access their data using an index into the feature reader collection as follows:
     46
     47{{{
     48FdoPtr<FdoISelect> spSelectCmd = static_cast<FdoISelect>(mConnection->CreateCommand(FdoCommandType_Select));
     49spSelectCmd->SetFeatureClassName (L"Foo");
     50
     51FdoPtr<FdoIdentifierCollection> spIds = spSelectCmd->GetPropertyNames ();
     52FdoPtr<FdoIdentifier> spId = FdoComputedIdentifier::Create(L"AVG_ID", FdoPtr<FdoExpression>(FdoExpression::Parse(L"Avg(ID)")));
     53spIds->Add(spId);
     54
     55FdoPtr<FdoIFeatureReader> spReader = spSelectCmd->Execute ();
     56while (spReader->ReadNext())
     57{
     58    double avg = spReader->GetDouble(0); // 0 is the index of the AVG_ID property
     59}
     60}}}
     61
    2562
    2663== Requirements ==