SDTSIndexedReader Class Reference

#include <sdts_al.h>

Inheritance diagram for SDTSIndexedReader:
SDTSAttrReader SDTSLineReader SDTSPointReader SDTSPolygonReader

List of all members.

Public Member Functions

SDTSFeatureGetNextFeature ()
virtual void Rewind ()
void FillIndex ()
void ClearIndex ()
int IsIndexed ()
SDTSFeatureGetIndexedFeatureRef (int)
char ** ScanModuleReferences (const char *="ATID")

Detailed Description

Base class for all the SDTSFeature type readers. Provides feature caching semantics and fetching based on a record number.


Member Function Documentation

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.

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.

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.
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.
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.

void SDTSIndexedReader::Rewind (  )  [virtual]

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

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 class was generated from the following files:

Generated on 2 Aug 2014 for SDTS_AL by  doxygen 1.6.1