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

MetaInfoInterface.h (Maintainer: Marc Sturm)

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: Marc Sturm $
00025 // --------------------------------------------------------------------------
00026 
00027 #ifndef OPENMS_METADATA_METAINFOINTERFACE_H
00028 #define OPENMS_METADATA_METAINFOINTERFACE_H
00029 
00030 #include <map>
00031 #include <string>
00032 
00033 #include <iostream>
00034 
00035 #include <OpenMS/METADATA/MetaInfo.h>
00036 
00037 namespace OpenMS
00038 {
00039   class String;
00040   
00051   class MetaInfoInterface
00052   {
00053     public:
00054 
00056       MetaInfoInterface();
00058       MetaInfoInterface(const MetaInfoInterface& rhs);
00060       ~MetaInfoInterface();
00061   
00063       MetaInfoInterface& operator = (const MetaInfoInterface& rhs);
00064 
00066       bool operator== (const MetaInfoInterface& rhs) const;
00068       bool operator!= (const MetaInfoInterface& rhs) const;
00069   
00071       const DataValue& getMetaValue(const String& name) const;
00073       const DataValue& getMetaValue(UInt index) const;
00074   
00076       bool metaValueExists(const String& name) const;
00078       bool metaValueExists(UInt index) const;
00079   
00081       void setMetaValue(const String& name, const String& value);
00083       void setMetaValue(UInt index, const String& value);
00085       void setMetaValue(const String& name, Int value);
00087       void setMetaValue(UInt index, Int value);
00089       void setMetaValue(const String& name, UInt value);
00091       void setMetaValue(UInt index, UInt value);
00093       void setMetaValue(const String& name, Real value);
00095       void setMetaValue(UInt index, Real value);
00097       void setMetaValue(const String& name, DoubleReal value);
00099       void setMetaValue(UInt index, DoubleReal value);
00101       void setMetaValue(const String& name, const DataValue& value);
00103       void setMetaValue(UInt index, const DataValue& value);
00104       
00106       void removeMetaValue(const String& name);
00108       void removeMetaValue(UInt index);   
00109       
00111       MetaInfoRegistry& metaRegistry() const;
00112   
00114       void getKeys(std::vector<String>& keys) const;
00115 
00117       void getKeys(std::vector<UInt>& keys) const;
00118       
00120       bool isMetaEmpty() const;
00121 
00123       void clearMetaInfo();
00124 
00125     protected:
00127       inline void createIfNotExists_();
00129       MetaInfo* meta_;
00130   };
00131 
00132 } // namespace OpenMS
00133 
00134 #endif // OPENMS_METADATA_METAINFOINTERFACE_H

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