⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ireader.h

📁 GIS格式转换软件vc源码.GIS格式转换软件vc源码.
💻 H
字号:
#ifndef IREADER_H
#define IREADER_H
// $Id: ireader.h,v 17.0 2005/10/28 21:08:33 geh Exp $
/*! \file ireader.h
    \brief Defines the IFMEUniversalReader interface.
*/
/*! \internal
============================================================================

   Name     : ireader.h

   System   : FME Developer Kit

   Language : C++

   Purpose  : Declaration of IFMEUniversalReader

  
  
  
   Author               Date            Changes made
   ------------------   ------------    -------------------------------
   Dale Lutz            Jul 22, 1997    Original definition
   Dale Lutz            Aug 20, 1997    Added readSchema method
   Dale Lutz            Aug 29, 1997    Added "id" method
   Kevin Wiebe          Jan 19, 2000    Moved some setconstraints defs out of here.
   Hieu Nguyen          Feb 22, 2002    Added nativeReaderHasSpatialIndex()
   Hieu Nguyen          Mar 12, 2002    Replaced nativeReaderHasSpatialIndex with 
                                        getProperties
   Juan Chu Chow        Oct 31, 2002    Added the "fme_specified_feature" as a possible value for
                                        the "fme_search_type" for the setConstraint() method.
   Juan Chu Chow        Nov 08, 2002    Added the kFME_PropCache option to the
                                        getProperties method().
   Juan Chu Chow        Apr 09, 2003    Removed kFME_PropCache, it is replaced by
                                        kFME_PropPersistentCacheLoaded for the getProperties() method.
   Tom Weir             Jun 01, 2004    Fixed documentation.
   Kaustav Mukherjee    Nov 16, 2004    Added the internal tag to hide this revision control part.
                                        Fixed some minor formatting bugs.
                                        

                  Copyright (c) 1994 - 2004, Safe Software Inc.
                              All Rights Reserved

    This software may not be copied or reproduced, in all or in part, 
    without the prior written consent of Safe Software Inc.

    The entire risk as to the results and performance of the software,
    supporting text and other information contained in this file
    (collectively called the "Software") is with the user.  Although
    Safe Software Incorporated has used considerable efforts in preparing 
    the Software, Safe Software Incorporated does not warrant the
    accuracy or completeness of the Software. In no event will Safe Software 
    Incorporated be liable for damages, including loss of profits or 
    consequential damages, arising out of the use of the Software.
*/

/*! \class IFMEUniversalReader
    \brief Reader class
 
*/

#include "fmetypes.h"

class IFMEFeature;

//===========================================================================
// Abstract Interface Class -- all methods are virtual and it has no data

class IFMEUniversalReader
{
public:

   // -----------------------------------------------------------------------
   /*! This method opens the reader. 
   // If anything goes wrong, a non-zero error message number is returned. 
   // This message number is the index of a description string in the
   // messages file for this reader found in the FME messages directory */
   virtual FME_MsgNum open(const char* datasetName,
                           const IFMEStringArray& parameters) = 0;

   // -----------------------------------------------------------------------
   /*! This method terminates the reader mid-stream.                       */
   virtual FME_MsgNum abort() = 0;

   // -----------------------------------------------------------------------
   /*! This method closes the reader after it has exhausted its data source. */
   virtual FME_MsgNum close() = 0;

   // -----------------------------------------------------------------------
   /*! This method reads the next feature in the data source, filling in the 
   // empty feature object provided.  If an error occurs, a message
   // is returned, otherwise a return of zero indicates that all
   // is well.  If the data source is exhausted and no feature data could
   // be read, then the endOfFile parameter is returned as FME_TRUE,
   // otherwise, it should be set to FME_FALSE.  When endOfFile is FME_TRUE,
   // the returned feature will be discarded and is assumed to be empty. */
   virtual FME_MsgNum read(IFMEFeature& feature,
                           FME_Boolean& endOfFile) = 0;
   
   // -----------------------------------------------------------------------
   /*! This method returns the next schema feature for the data source, 
   // filling in the empty feature object provided.  If an error occurs, a 
   // message is returned, otherwise a return of zero indicates that all
   // is well.  Once all the schema features have been returned,
   // the endOfSchema parameter is returned as FME_TRUE,
   // otherwise, it should be set to FME_FALSE.  When endOfSchema is FME_TRUE,
   // the returned feature will be discarded and is assumed to be empty. */
   virtual FME_MsgNum readSchema(IFMEFeature& feature,
                                 FME_Boolean& endOfSchema) = 0;

   // -----------------------------------------------------------------------
   /*! This method specifies the spatial and attribute constraints to be used
   //  when reading the data.  The spatial and attribute query 
   //  is specified in the feature object. This only need be implemented
   //  by those readers which return spatialEnables() as true, otherwise
   //  they can do nothing.  This can be called at any time after the
   //  reader is created.  If any read is in progress then it is terminated
   //  and the next read will reflect the new constraints.
   //  
   //  The constraint feature must have an attribute called <b>"fme_search_type"</b>
   //  (C++ Constant:  kFMERead_SearchType)on it. 
   //  The value of this attribute indicates the kind of search to be done.  
   //  The supported values are:
   //  <dl><dt><b>"fme_envelope_intersects"</b> (C++ Constant: kFMERead_EnvelopeIntersects)</dt>
   //      <dd>When this is the value, then the bounding  box of the feature 
   //          is used as the query envelope.  Future reads of the data will 
   //          return only those features in the envelope area. </dd>
   //      <dt><b>"fme_closest"</b> (C++ Constant: kFMERead_Closest)</dt>
   //      <dd>When this is the value, then a future read will only return the 
   //          single feature that was the closest to the center of the 
   //          bounding box of the passed in feature.  Normally, a point feature
   //          is used.  In addition, when this search method is used, a maximum
   //          distance must be given in an additional 'fme_max_distance' 
   //          attribute.</dd>
   //      <dt><b>"fme_specified_feature"</b> (C++ Constant: kFMERead_SpecifiedFeature)</dt>
   //      <dd>When this is the value, then a future read will only return the 
   //          single feature that is specified by an additional 'fme_index' 
   //          attribute which takes a non-negative integer as value, that is 
   //          integers starting from 0.  If the index is out of range, then no 
   //          features will be returned on subsequent read() calls. It is best 
   //          for the feature cache to be loaded before this constraint is set, 
   //          if the cache is not loaded then the reader will automatically read 
   //          all features from the specified data set into the cache.  To load
   //          the feature cache manually, simply read through all of the features
   //          with the read() method, until the read() method flag returns FME_TRUE.
   //          </dd>
   //  </dl>                                                                       */
   virtual FME_MsgNum setConstraints(const IFMEFeature& feature) = 0;

   // -----------------------------------------------------------------------
   /*! This method will populate an IFMEStringArray with values for the given 
   // property category.
   //
   //  If a property category is found, the array should be populated with
   //  <property>/<value> pairs, as appropriate for that property category.  Therefore
   //  the returned array should always have an even number of entries.
   //  The property category may choose to return an empty array.  The method 
   //  itself will have a return value of FME_TRUE.
   //
   //  If the property category was unrecognized, the method itself will have a 
   //  return value of FME_FALSE.
   //
   //  This method handles the following property categories:
   //  <dl>
   //      <dt><b>"fme_prop_spatial_index"</b> (C++ Constant: kFME_PropSpatialIndex)</dt>
   //      <dd>         If the reader being used is spatially enabled, then
   //                   IFMEStringArray values will contain the property/value pair
   //                   "fme_prop_spatial_index" "FME_TRUE"
   //                   If the reader being used is not spatially enabled, then
   //                   IFMEStringArray values will contain the property/value pair
   //                   "fme_prop_spatial_index" "FME_FALSE"
   //                   If the reader does not know the correct value, it will leave
   //                   the IFMEStringArray values array empty and return FME_FALSE.
   //      </dd>
   //      <dt><b>"fme_prop_persistent_cache_loaded"</b> (C++ Constant: kFME_PropPersistentCacheLoaded)</dt>
   //      <dd>
   //                   If the reader persistent cache is loaded, then the
   //                   IFMEStringArray values will contain the property/value pair
   //                   "fme_prop_persistent_cache_loaded" "FME_TRUE"
   //                   If the reader persistent cache is not loaded, then the the 
   //                   IFMEStringArray values will contain the property/value pair
   //                   "fme_prop_persistent_cache_loaded" "FME_FALSE"
   //                   If the reader does not know the correct value, it will leave
   //                   the IFMEStringArray values array empty and return FME_FALSE.
   //      </dd>
   //      <dt><b>"fme_prop_coord_sys_aware"</b> (C++ Constant: kFME_PropCoordSysAware)</dt>
   //      <dd>
   //                   If the reader is coordinate system aware, then the 
   //                   IFMEStringArray will contain the property/value pair
   //                   "fme_prop_coord_sys_aware" "FME_TRUE", otherwise
   //                   "fme_prop_coord_sys_aware" "FME_FALSE".
   //                   If the reader does not know the correct value, it will leave
   //                   the IFMEStringArray values array empty and return FME_FALSE.
   //      </dd>
   //      <dt><b>"*"</b> (C++ Constant: kFME_ReaderPropAll)</dt>
   //      <dd>   Returns all properties for all known property categories.
   //             Each property is returned as a property/value pair of entries.
   //      </dd>
   //  </dl>
   // */   
   virtual FME_Boolean getProperties(const char* propertyCategory, IFMEStringArray& values) = 0;

   
protected:
   // -----------------------------------------------------------------------
   /* No one should be creating an instance of this directly, so we
   // make the constructor protected. */
   IFMEUniversalReader() {}; 

   // -----------------------------------------------------------------------
   /* Destructor -- does nothing */
   virtual ~IFMEUniversalReader() {};
 
private:
   // Hide methods that we don't want called.
   //---------------------------------------------------------------
   // copy constructor
   IFMEUniversalReader(const IFMEUniversalReader&);

   //---------------------------------------------------------------
   // assignment operator.
   IFMEUniversalReader& operator=(const IFMEUniversalReader&);
};

#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -