00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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 }
00143
00144 #endif // OPENMS_METADATA_METAINFO_H