Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

FeatureXMLHandler.h (Maintainer: Ole Schulz-Trieglaff)

Go to the documentation of this file.
00001 // -*- Mode: C++; tab-width: 2; -*-
00002 // vi: set ts=2:
00003 //
00004 // --------------------------------------------------------------------------
00005 //                   OpenMS Mass Spectrometry Framework
00006 // --------------------------------------------------------------------------
00007 //  Copyright (C) 2003-2008 -- Oliver Kohlbacher, Knut Reinert
00008 //
00009 //  This library is free software; you can redistribute it and/or
00010 //  modify it under the terms of the GNU Lesser General Public
00011 //  License as published by the Free Software Foundation; either
00012 //  version 2.1 of the License, or (at your option) any later version.
00013 //
00014 //  This library is distributed in the hope that it will be useful,
00015 //  but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 //  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00017 //  Lesser General Public License for more details.
00018 //
00019 //  You should have received a copy of the GNU Lesser General Public
00020 //  License along with this library; if not, write to the Free Software
00021 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00022 //
00023 // --------------------------------------------------------------------------
00024 // $Maintainer: Ole Schulz-Trieglaff $
00025 // --------------------------------------------------------------------------
00026 
00027 
00028 #ifndef OPENMS_FORMAT_HANDLERS_FEATUREXMLHANDLER_H
00029 #define OPENMS_FORMAT_HANDLERS_FEATUREXMLHANDLER_H
00030 
00031 #include <OpenMS/KERNEL/Feature.h>
00032 #include <OpenMS/KERNEL/FeatureMap.h>
00033 #include <OpenMS/FORMAT/UniqueIdGenerator.h>
00034 #include <OpenMS/FORMAT/HANDLERS/XMLHandler.h>
00035 #include <OpenMS/FORMAT/HANDLERS/MzDataExpSettHandler.h>
00036 #include <OpenMS/TRANSFORMATIONS/FEATUREFINDER/ModelDescription.h>
00037 #include <OpenMS/DATASTRUCTURES/Param.h>
00038 #include <OpenMS/FORMAT/PeakFileOptions.h>
00039 
00040 #include <xercesc/sax2/SAX2XMLReader.hpp>
00041 #include <xercesc/framework/MemBufInputSource.hpp>
00042 #include <xercesc/sax2/XMLReaderFactory.hpp>
00043 #include <xercesc/util/TransService.hpp>
00044 
00045 // STL includes
00046 #include <iostream>
00047 
00048 
00049 namespace OpenMS
00050 {
00051   namespace Internal
00052   {
00053 
00061     class FeatureXMLHandler
00062       : public XMLHandler
00063     {
00064       public:
00067 
00068         FeatureXMLHandler(FeatureMap<Feature>& map, const String& filename, const String& version) 
00069         : XMLHandler(filename,version),
00070           map_(&map), 
00071           cmap_(0), 
00072           exp_sett_(),
00073           in_description_(false)
00074         {
00075         }
00076         
00078         FeatureXMLHandler(const FeatureMap<Feature>& map, const String& filename, const String& version)
00079         : XMLHandler(filename,version),
00080           map_(0), 
00081           cmap_(&map),  
00082           exp_sett_(),
00083           in_description_(false)
00084         {
00085         }
00086   
00088         virtual ~FeatureXMLHandler() 
00089         {
00090         }
00092   
00093         // Docu in base class
00094         virtual void endElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname);
00095         
00096         // Docu in base class
00097         virtual void startElement(const XMLCh* const /*uri*/, const XMLCh* const /*local_name*/, const XMLCh* const qname, const xercesc::Attributes& attributes);
00098         
00099         // Docu in base class
00100         virtual void characters(const XMLCh* const chars, unsigned int length);
00101   
00103         void writeTo(std::ostream& os);
00104         
00106         void setOptions(const PeakFileOptions& options)
00107         { 
00108           options_ = options; 
00109         }
00110   
00111       protected:
00113         FeatureMap<Feature>* map_;
00115         const FeatureMap<Feature>* cmap_;
00117         PeakFileOptions options_;
00118         
00121         Feature feature_;
00122         ModelDescription<2>* model_desc_;
00123         Param param_;
00124         ConvexHull2D current_chull_;
00125         DPosition<2> hull_position_;  
00127         std::stringstream exp_sett_;
00129         
00131         UInt dim_;      
00132         
00133         //flag that indicates that the parser in in the description secion
00134         bool in_description_;
00135     };
00136   } // namespace Internal
00137 } // namespace OpenMS
00138 
00139 #endif // OPENMS_FORMAT_HANDLERS_FeatureXMLHandler_H

Generated Tue Apr 1 15:36:34 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1