[fdo-trac] #309: Add two additional IFeatureReader properties:
Count and IsEmpty
FDO
trac_fdo at osgeo.org
Tue Apr 22 08:22:44 EDT 2008
#309: Add two additional IFeatureReader properties: Count and IsEmpty
-------------------------+--------------------------------------------------
Reporter: MaksimS | Owner: gregboone
Type: enhancement | Status: new
Priority: minor | Milestone: 3.4.0
Component: FDO API | Version: 3.2.0
Severity: 3 | Resolution:
Keywords: | External_id:
-------------------------+--------------------------------------------------
Comment (by MaksimS):
Count would '''not''' get calculated on IFeatureReader instantiation (i.e.
via ISelect.Execute). The property would act as a function, when
explicitly called (get). If called, it should create an internal copy of
underlying reader, traversing it to return total number of feature
instances. If it's not calculated on IFeatureReader instantiation then
there're no performance side effects. A private member could be used for
storing once-calculated features count for faster consequent calls to
Count() function of the same instance of IFeatureReader.
Now, why IsEmpty when there's a Count? Because IsEmpty traverses only the
first record of possibly many records, returning False if ReadNext doesn't
return Nothing. IsEmpty() works on the same premises as above described
Count() mechanism.
So user can chain calls to get the results with less overhead:
{{{
If Not reader.IsEmpty
Dim cnt As Integer = reader.Count
...
End If
}}}
I think that it's better to have it implemented on unmanaged tier, since
doing it using managed bindings may sometimes lead to unexpected results.
--
Ticket URL: <http://trac.osgeo.org/fdo/ticket/309#comment:1>
FDO <http://fdo.osgeo.org/>
Feature Data Objects
More information about the fdo-trac
mailing list