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

DBAdapter Class Reference
[Database IO]

#include <OpenMS/FORMAT/DB/DBAdapter.h>

List of all members.


Detailed Description

A class for accessing and storing data in a SQL database.

It can be used to create objects from the DB or store them in the DB.

Public Member Functions

 DBAdapter (DBConnection &db_con)
 Constructor.
 ~DBAdapter ()
 Destructor.
template<class ExperimentType>
void storeExperiment (ExperimentType &exp)
 Stores a MSExperiment.
template<class ExperimentType>
void loadExperiment (UID id, ExperimentType &exp)
 Reads a MSExperiment.
template<class SpectrumType>
void loadSpectrum (UID id, SpectrumType &spec)
 Reads a MSSpectrum.
PeakFileOptionsgetOptions ()
 Mutable access to the options for loading/storing.
const PeakFileOptionsgetOptions () const
 Non-mutable access to the options for loading/storing.
bool checkDBVersion (bool warning)
 Returns true if the DB is up-to-date (Checks the version in ADMIN_Version table).
void createDB ()
 Deletes all tables in the database and creates a new OpenMS database.

Private Member Functions

 DBAdapter ()
 Not implemented.
UID storeMetaInfo_ (const String &parent_table, UID parent_id, const MetaInfoInterface &info)
 Stores, updates or deletes MetaInfo data.
void loadMetaInfo_ (UID id, MetaInfoInterface &info)
 Loads MetaInfo data from database.
void deleteMetaInfo_ (const String &parent_table, const String &condition)
 Conditionally deletes MetaInfo data from database.
UID storeFile_ (const String &parent_table, UID parent_id, const SourceFile &file)
 Stores, updates or deletes file information.
void loadFile_ (UID id, SourceFile &file)
 Loads file information.
UID storeSample_ (const Sample &sample, UID exp_id, UID parent_id)
 Stores, updates or deletes sample information.
void loadSample_ (UID id, Sample &sample)
 Loads sample information.

Private Attributes

DBConnectiondb_con_
 Reference to the DB connection handed over in the constructor.
PeakFileOptions options_


Constructor & Destructor Documentation

DBAdapter ( DBConnection db_con  ) 

Constructor.

~DBAdapter (  ) 

Destructor.

DBAdapter (  )  [private]

Not implemented.


Member Function Documentation

void storeExperiment ( ExperimentType &  exp  )  [inline]

Stores a MSExperiment.

void loadExperiment ( UID  id,
ExperimentType &  exp 
) [inline]

Reads a MSExperiment.

void loadSpectrum ( UID  id,
SpectrumType &  spec 
) [inline]

Reads a MSSpectrum.

PeakFileOptions& getOptions (  ) 

Mutable access to the options for loading/storing.

const PeakFileOptions& getOptions (  )  const

Non-mutable access to the options for loading/storing.

bool checkDBVersion ( bool  warning  ) 

Returns true if the DB is up-to-date (Checks the version in ADMIN_Version table).

Parameters:
warning if this is set, a warning is issued to stderr if the db is not up-to-date.

void createDB (  ) 

Deletes all tables in the database and creates a new OpenMS database.

UID storeMetaInfo_ ( const String parent_table,
UID  parent_id,
const MetaInfoInterface info 
) [private]

Stores, updates or deletes MetaInfo data.

Returns:
the id of the new META_MetaInfo table row

void loadMetaInfo_ ( UID  id,
MetaInfoInterface info 
) [private]

Loads MetaInfo data from database.

void deleteMetaInfo_ ( const String parent_table,
const String condition 
) [private]

Conditionally deletes MetaInfo data from database.

UID storeFile_ ( const String parent_table,
UID  parent_id,
const SourceFile file 
) [private]

Stores, updates or deletes file information.

Returns:
the id of the new META_File table row

void loadFile_ ( UID  id,
SourceFile file 
) [private]

Loads file information.

UID storeSample_ ( const Sample sample,
UID  exp_id,
UID  parent_id 
) [private]

Stores, updates or deletes sample information.

Returns:
the id of the new META_Sample table row

void loadSample_ ( UID  id,
Sample sample 
) [private]

Loads sample information.


Member Data Documentation

DBConnection& db_con_ [private]

Reference to the DB connection handed over in the constructor.

PeakFileOptions options_ [private]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:44 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1