FDO API Reference Feature Data Objects

SpatialContextFlags.h

Go to the documentation of this file.
00001 #ifndef FDO_XML_SPATIALCONTEXTFLAGS_H
00002 #define FDO_XML_SPATIALCONTEXTFLAGS_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/Flags.h>
00027 
00028 /// \brief
00029 /// FdoXmlSpatialContextFlags extends FdoXmlFlags to specify flags 
00030 /// specific to Spatial Contexts.
00031 class FdoXmlSpatialContextFlags : public FdoXmlFlags
00032 {
00033 public:
00034         /// \brief
00035         /// The FdoXmlSpatialContextFlags::ConflictOption specifies how 
00036         /// to handle Spatial Contexts that are already in the DataStore, 
00037         ///  when Deserializing:
00038     enum ConflictOption {
00039             /// Add new spatial contexts to the FDO DataStore and
00040         /// if the Spatial Context already exists, throw an exception.
00041             /// is thrown.
00042         ConflictOption_Add,
00043             /// Update the spatial context if it already exists and
00044             /// add it if it doesn't exist.
00045         ConflictOption_Update,
00046             /// Add new spatial contexts and
00047             /// silently skip spatial contexts already in the DataStore.
00048         ConflictOption_Skip
00049     };
00050 
00051     /// \brief
00052     /// Constructs an FdoXmlSpatialContextFlags object.
00053     /// 
00054     /// \param url 
00055     /// Base URL for generating well-known references to 
00056     /// GML coordinate systems and transformations
00057     /// \param errorLevel 
00058     /// Input The error level for reading spatial contexts. Controls how 
00059     /// strict the error reporting is.
00060     /// \param nameAdjust 
00061     /// Input true: apply name adjustment to all elements. 
00062     /// false: apply name adjustment only to elements with fdo:nameAdjust="true"
00063     /// \param conflictOption 
00064     /// Input option for Deserializing Spatial Contexts. 
00065     /// Specified how Spatial Contexts, already in the FDO connection, are handled.
00066     /// \param includeDefault 
00067     /// Input true: When Serializing Spatial Contexts, serialize
00068     /// all contexts including the default.
00069     /// false: skip the default Spatial Context.
00070     /// 
00071     /// \return
00072     /// Returns FdoXmlSpatialContextFlags
00073     /// 
00074     FDO_API static FdoXmlSpatialContextFlags* Create( 
00075         FdoString*                                  url = L"fdo.osgeo.org/schemas/feature",
00076         ErrorLevel                                  errorLevel = ErrorLevel_Normal,
00077         FdoBoolean                                  nameAdjust = true,
00078         ConflictOption  conflictOption = ConflictOption_Add,
00079         FdoBoolean                                  includeDefault = false
00080     );
00081 
00082     /// \brief
00083     /// Sets the current option for handling Spatial Contexts
00084     /// already in the connection.
00085     /// 
00086     /// \param conflictOption 
00087     /// Input option for Deserializing Spatial Contexts. 
00088     /// Specified how Spatial Contexts, already in the FDO connection, are handled.
00089     /// 
00090     FDO_API void SetConflictOption( ConflictOption conflictOption );
00091     
00092     /// \brief
00093     /// Get the current option for handling Spatial Contexts
00094     /// already in the connection.
00095     /// 
00096     /// \return
00097     /// Returns the current conflict option.
00098     /// 
00099     FDO_API ConflictOption GetConflictOption() const;
00100 
00101     /// \brief
00102     /// Sets the default Spatial Context inclusion flag.
00103     /// 
00104     /// \param includeDefault 
00105     /// Input true: When Serializing Spatial Contexts, serialize
00106     /// all contexts including the default.
00107     /// false: skip the default Spatial Context.
00108     /// 
00109     FDO_API void SetIncludeDefault( FdoBoolean includeDefault );
00110 
00111     /// \brief
00112     /// Gets the default Spatial Context inclusion flag.
00113     /// 
00114     /// \return
00115     /// Returns the default Spatial Context inclusion flag.
00116     /// 
00117     FDO_API FdoBoolean GetIncludeDefault() const;
00118 
00119 
00120 protected:
00121     /// default constructor to keep linux from complaining
00122     FdoXmlSpatialContextFlags() {}
00123     FDO_API FdoXmlSpatialContextFlags( 
00124         FdoString*              url,
00125         ErrorLevel              errorLevel,
00126         FdoBoolean              nameAdjust,
00127         ConflictOption          conflictOption,
00128         FdoBoolean              includeDefault
00129     );
00130     FDO_API virtual ~FdoXmlSpatialContextFlags();
00131 
00132 private:
00133     ConflictOption          mConflictOption;
00134     FdoBoolean              mIncludeDefault;
00135 };
00136 
00137 /// \ingroup (typedefs)
00138 /// \brief
00139 /// FdoXmlSpatialContextFlagsP is a FdoPtr on FdoXmlSpatialContextFlags, provided for convenience.
00140 typedef FdoPtr<FdoXmlSpatialContextFlags> FdoXmlSpatialContextFlagsP;
00141 
00142 #endif
00143 
00144 

Comments or suggestions? Send us feedback.