Class Hierarchy   Compound List   File List   Compound Members   File Members   Related Pages  

SDTSIndexedReader Class Reference

Base class for all the SDTSFeature type readers. More...

#include <sdts_al.h>

Class diagram for SDTSIndexedReader:

SDTSPolygonReader SDTSPointReader SDTSLineReader SDTSAttrReader

List of all members.


Public Members

SDTSFeatureGetNextFeature ()
Fetch the next available feature from this reader. More...

virtual void Rewind ()
Rewind so that the next feature returned by GetNextFeature() will be the first in the module.

void FillIndex ()
Read all features into a memory indexed cached. More...

void ClearIndex ()
Free all features in the index (if filled). More...

int IsIndexed ()
Returns TRUE if the module is indexed, otherwise it returns FALSE. More...

SDTSFeatureGetIndexedFeatureRef ( int )
Fetch a feature based on it's record number. More...

char** ScanModuleReferences ( const char * = "ATID" )
Scan an entire SDTS module for record references with the given field name. More...


Detailed Description

Base class for all the SDTSFeature type readers.

Provides feature caching semantics and fetching based on a record number.


Member Function Documentation

SDTSFeature * SDTSIndexedReader::GetNextFeature ()

Fetch the next available feature from this reader.

The returned SDTSFeature * is to an internal indexed object if the IsIndexed() method returns TRUE, otherwise the returned feature becomes the responsibility of the caller to destroy with delete.

Note that the Rewind() method can be used to start over at the beginning of the modules feature list.

Returns:
next feature, or NULL if no more are left. Please review above ownership/delete semantics.

void SDTSIndexedReader::FillIndex ()

Read all features into a memory indexed cached.

The ClearIndex() method can be used to free all indexed features. FillIndex() does nothing, if an index has already been built.

void SDTSIndexedReader::ClearIndex ()

Free all features in the index (if filled).

After this the reader is considered to not be indexed, and IsIndexed() will return FALSE untill the index is forcably filled again.

int SDTSIndexedReader::IsIndexed ()

Returns TRUE if the module is indexed, otherwise it returns FALSE.

If the module is indexed all the feature have already been read into memory, and searches based on the record number can be performed efficiently.

SDTSFeature * SDTSIndexedReader::GetIndexedFeatureRef (int iRecordId)

Fetch a feature based on it's record number.

This method will forceably fill the feature cache, reading all the features in the file into memory, if they haven't already been loaded. The ClearIndex() method can be used to flush this cache when no longer needed.

Parameters:
iRecordId - the record to fetch, normally based on the nRecord field of an SDTSModId.

Returns:
a pointer to an internal feature (not to be deleted) or NULL if there is no matching feature.

char ** SDTSIndexedReader::ScanModuleReferences (const char * pszFName = "ATID")

Scan an entire SDTS module for record references with the given field name.

The fields are required to have a MODN subfield from which the module is extracted.

This method is normally used to find all the attribute modules referred to by a point, line or polygon module to build a unified schema.

This method will have the side effect of rewinding unindexed readers because the scanning operation requires reading all records in the module from disk.

Parameters:
pszFName - the field name to search for. By default "ATID" is used.

Returns:
a NULL terminated list of module names. Free with CSLDestroy().

The documentation for this classwas generated from the following files:
Generated at Wed Sep 22 10:32:07 1999 for SDTS_AL by doxygen  written by Dimitri van Heesch, © 1997-1999