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

MetaInfo.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_METAINFO_H
00028 #define OPENMS_METADATA_METAINFO_H
00029 
00030 #include <map>
00031 #include <string>
00032 #include <vector>
00033 
00034 #include <OpenMS/CONCEPT/Types.h>
00035 #include <OpenMS/METADATA/MetaInfoRegistry.h>
00036 #include <OpenMS/DATASTRUCTURES/DataValue.h>
00037 
00038 namespace OpenMS
00039 {
00040   class String;
00041   
00059   class MetaInfo
00060   {
00061     public:
00063     MetaInfo();
00064 
00066     MetaInfo(const MetaInfo& rhs);
00067 
00069     ~MetaInfo();
00070 
00072     MetaInfo& operator = (const MetaInfo& rhs);
00073 
00075     bool operator== (const MetaInfo& rhs) const;
00077     bool operator!= (const MetaInfo& rhs) const;
00078 
00080     const DataValue& getValue(const String& name) const;
00082     const DataValue& getValue(UInt index) const;
00083 
00085     bool exists(const String& name) const;
00087     bool exists(UInt index) const;
00088 
00090     void setValue(const String& name, const String& value);
00092     void setValue(UInt index, const String& value);
00094     void setValue(const String& name, Int value);
00096     void setValue(UInt index, Int value);
00098     void setValue(const String& name, UInt value);
00100     void setValue(UInt index, UInt value);
00102     void setValue(const String& name, DoubleReal value);
00104     void setValue(UInt index, DoubleReal value);
00106     void setValue(const String& name, Real value);
00108     void setValue(UInt index, Real value);
00110     void setValue(const String& name, const DataValue& value);
00112     void setValue(UInt index, const DataValue& value);
00113     
00115     void removeValue(const String& name);
00117     void removeValue(UInt index);   
00118     
00120     static MetaInfoRegistry& registry();
00121     
00123     void getKeys(std::vector<String>& keys) const;
00124 
00126     void getKeys(std::vector<UInt>& keys) const;
00127 
00129     bool empty() const;
00130     
00132     void clear();
00133     
00134     private:
00136     static MetaInfoRegistry registry_;
00138     std::map<UInt,DataValue> index_to_value_;
00139 
00140   };
00141 
00142 } // namespace OpenMS
00143 
00144 #endif // OPENMS_METADATA_METAINFO_H

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