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

How meta data is stored

The meta informations about an HPLC-MS experiment are stored in ExperimentalSettings and SpectrumSettings. All information that is not covered by these classes can be stored in the type-name-value datastructure MetaInfo. All classes described in this section can be found in the METADATA folder.

MetaInfo

DataValue is a data structure that can store any numerical or string information. It also supports casting of the stored value back to its original type.

MetaInfo is used to easily store information of any type, that does not fit into the the other classes. It implements type-name-value triplets. The main datastructure is an associative container that stores DataValue instances as values associated to string keys. Internally, the string keys are converted to integer keys for performance resaons i.e. a map<UInt,DataValue> is used.

The MetaInfoRegistry associates the string keys used in MetaValue with the integer values that are used for internal storage. The MetaInfoRegistry is a singleton.

If you want a class to have a MetaInfo member, simply derive it from MetaInfoInterface. This class provides a MetaInfo member and the interface to access it.

MetaInfo.png

The classes involved in meta information storage

The following example (Tutorial_MetaInfo.C) shows how to use Metadata. We can simply set values for the string keys, and setMetaValue registers these names automatically. In order to access the values, we can either use the registered name or the index of the name. The getMetaValue method returns a DataValue, which has to be casted to the right type. If you do not know the type, you can use the DataValue::valueType() method.

Int main()
{
  MetaInfoInterface info;
  
  //insert meta data
  info.setMetaValue("color",String("#ff0000"));
  info.setMetaValue("id",112131415);
  
  //access id by index
  UInt id_index = info.metaRegistry().getIndex("id");
  cout << "id   : " << (UInt)(info.getMetaValue(id_index)) << endl;
  //access color by name
  cout << "color: " << (String)(info.getMetaValue("color")) << endl;
  
  return 0;
} //end of main

Meta data of a map

This class holds meta information about the experiment that is valid for the whole experiment:

ExperimentalSettings.png

Map meta information

Meta data of a spectrum

This class contains meta information about settings specific to one spectrum:

SpectrumSettings.png

Spectrum meta information


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