FDO API Reference Feature Data Objects

FeatureReader.h

Go to the documentation of this file.
00001 #ifndef FDO_XML_FEATUREREADER_H_
00002 #define FDO_XML_FEATUREREADER_H_
00003 
00004 //
00005 // Copyright (C) 2004-2006  Autodesk, Inc.
00006 // 
00007 // This library is free software; you can redistribute it and/or
00008 // modify it under the terms of version 2.1 of the GNU Lesser
00009 // General Public License as published by the Free Software Foundation.
00010 // 
00011 // This library is distributed in the hope that it will be useful,
00012 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00013 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014 // Lesser General Public License for more details.
00015 // 
00016 // You should have received a copy of the GNU Lesser General Public
00017 // License along with this library; if not, write to the Free Software
00018 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
00019 //
00020 
00021 #ifdef _WIN32
00022 #pragma once
00023 #endif
00024 
00025 #include <FdoStd.h>
00026 #include <Fdo/Xml/FeatureHandler.h>
00027 
00028 class FdoXmlFeatureFlags;
00029 class FdoXmlFeaturePropertyReader;
00030 
00031 
00032 /// \brief
00033 /// FdoXmlFeatureReader reads GML format features from a XML
00034 /// document. The reading is done procedurally, rather than through events.
00035 /// Each feature can be read in 3 steps:
00036 /// <ol>
00037 ///     <li> call ReadNext() to get the next feature.
00038 ///     <li> call GetClassDefinition() to get the current feature's property list.
00039 ///     <li> call GetProperty() for each feature property to retrieve.
00040 /// </ol>
00041 /// This class allows random access to the properties of the current feature, meaning that 
00042 /// ReadNext() accumulates a list of these properties. This may have slight performance implications.
00043 /// If performance is a concern then FdoXmlFeaturePropertyReader should be used instead.
00044 class FdoXmlFeatureReader : 
00045     public FdoIFeatureReader,
00046     public FdoXmlFeatureHandler
00047 {
00048 public:
00049 
00050     /// \brief
00051     /// creates a Feature Reader for reading features from XML.
00052     /// 
00053     /// \param reader 
00054     /// Input XML document reader. Please refer to the reader parameter of 
00055     /// FdoXmlFeaturePropertyReader::Create() for a description of how the features are
00056     /// read from the document. An FdoXmlFeaturePropertyReader is automatically wrapped 
00057     /// around this reader. This Feature Property Reader can be retrieved by calling 
00058     /// GetFeaturePropertyReader().
00059     /// \param flags 
00060     /// Input options for controlling the 
00061     /// deserializing of the features. If NULL then the 
00062     /// default flags are used.
00063     /// 
00064     /// \return
00065     /// Returns FdoXmlFeatureReader
00066     /// 
00067     FDO_API static FdoXmlFeatureReader * Create( 
00068         FdoXmlReader*                   reader,
00069         FdoXmlFeatureFlags*      flags = NULL
00070         );
00071 
00072     /// \brief
00073     /// Gets the feature property reader that was passed to this object.
00074     /// 
00075     /// \return
00076     /// Returns FdoXmlFeaturePropertyReader
00077     /// 
00078     FDO_API virtual FdoXmlFeaturePropertyReader* GetFeaturePropertyReader() = 0;
00079 
00080 
00081     /// \brief
00082     /// Gets the feature schemas describing the features being read.
00083     /// 
00084     /// \return
00085     /// Returns FdoFeatureSchemaCollection
00086     /// 
00087     FDO_API virtual FdoFeatureSchemaCollection* GetFeatureSchemas() = 0;
00088 
00089     /// \brief
00090     /// Sets the feature schemas describing the features being read. 
00091     /// 
00092     /// \remarks
00093     /// The feature schemas
00094     /// provide directions on how to deserialize the features and convert their property
00095     /// values from the strings in the XML document to their proper types. If any 
00096     /// feature, whose class definition is not present in these schemas, is encountered 
00097     /// then one of the following is done:
00098     /// <ul>
00099     ///     <li> an exception is thrown when flags->errorLevel is Normal or higher. The 
00100     ///       exception reports all such features.
00101     ///     <li> these features are silently skipped When the flags->errorLevel is below 
00102     ///       Normal.
00103     /// </ul>
00104     /// 
00105     /// \param value 
00106     /// Input the feature schemas
00107     /// 
00108     /// \return
00109     /// Returns nothing
00110     /// 
00111     FDO_API virtual void SetFeatureSchemas(FdoFeatureSchemaCollection* schemas) = 0;
00112 
00113 };
00114 
00115 /// \brief
00116 /// FdoXmlSpatialContextReaderP is a FdoPtr on FdoXmlSpatialContextReader, provided for convenience.
00117 typedef FdoPtr<FdoXmlFeatureReader> FdoXmlFeatureReaderP;
00118 
00119 #endif
00120 
00121 

Comments or suggestions? Send us feedback.