= FDO RFC 34 - FDO Reader Access By Index = This page contains an change request (RFC) for the FDO Open Source project. More FDO RFCs can be found on the [wiki:FDORfcs RFCs] page. == Status == ||RFC Template Version||(1.0)|| ||Submission Date|| April 9, 2009 || ||Last Modified|| Greg Boone [[Timestamp]]|| ||Author||Greg Boone|| ||RFC Status||Not Ready|| ||Implementation Status||Pending|| ||Proposed Milestone||3.5.0.0|| ||Assigned PSC guide(s)||Greg Boone|| ||'''Voting History'''||(vote date)|| ||+1|| || ||+0|| || ||-0|| || ||-1|| || == Motivation == To Provide faster access to data returned from readers in the FDO API. == Overview == Currently, 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. {{{ FdoPtr spSelectCmd = static_cast(mConnection->CreateCommand(FdoCommandType_Select)); spSelectCmd->SetFeatureClassName (L"Foo"); FdoPtr spIds = spSelectCmd->GetPropertyNames (); FdoPtr spId = FdoComputedIdentifier::Create(L"AVG_ID", FdoPtr(FdoExpression::Parse(L"Avg(ID)"))); spIds->Add(spId); FdoPtr spReader = spSelectCmd->Execute (); while (spReader->ReadNext()) { double avg = spReader->GetDouble(L"AVG_ID"); } }}} The 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: {{{ FdoPtr spSelectCmd = static_cast(mConnection->CreateCommand(FdoCommandType_Select)); spSelectCmd->SetFeatureClassName (L"Foo"); FdoPtr spIds = spSelectCmd->GetPropertyNames (); FdoPtr spId = FdoComputedIdentifier::Create(L"AVG_ID", FdoPtr(FdoExpression::Parse(L"Avg(ID)"))); spIds->Add(spId); FdoPtr spReader = spSelectCmd->Execute (); while (spReader->ReadNext()) { double avg = spReader->GetDouble(0); // 0 is the index of the AVG_ID property } }}} == Requirements == == Provider Implementation == == Test Plan == Existing FDO Core unit tests will be expanded to test the proposed enhancements defined above. == Funding/Resources == Autodesk to provide resources / funding