Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Data Structures | File List | Namespace Members | Data Fields | Related Pages

SctArchiving::IOManagerDB Class Reference

This IOManager reads from and writes to a database. More...

#include <IOManagerDB.h>

Inheritance diagram for SctArchiving::IOManagerDB:

Inheritance graph
[legend]
Collaboration diagram for SctArchiving::IOManagerDB:

Collaboration graph
[legend]

Public Member Functions

virtual void write (const Sct::Serializable &ob, const Sct::IOParams *params=0) const
 write using default streamers

virtual shared_ptr< Sct::Serializableread (const string &name, const Sct::IOParams *params=0) const
 read using appropriate streamers

virtual std::string status () const
 get some status information


Static Public Member Functions

IOManagerDBinstance ()
 retrieve access to singleton


Private Member Functions

 IOManagerDB ()
 constructor.

MysqlQuery getQuery () const
 get a null query.

void prepareInsertion (const Sct::Serializable &ob, MysqlQuery &q) const
 change query to prepare to insert ob.


Static Private Member Functions

const SctData::ResultHeadergetHeader (const Sct::Serializable &ob)
 get the header from a TestResult or ScanResult

std::string getQueryMatching (const string &name)
 make the "`WHERE'" part of the query matching the name by building a IOName from it.

std::string getTable (const Sct::Serializable &ob)
 find the name of the table which the ob should to into.


Private Attributes

boost::shared_ptr< ZlibStringCompressorm_compressor
 keep a string compressor handy to zip and unzip BLOB data.

boost::shared_ptr< MysqlConnection > m_connection
 pointer to the database connection


Static Private Attributes

IOManagerDBs_man
 pointer to singleton


Detailed Description

This IOManager reads from and writes to a database.

It is expected to be used in archival, and so also makes use of streamer versioning by inheriting from IOManagerStreamerVersioned. Uses a mysql back-end.

Definition at line 21 of file IOManagerDB.h.


Constructor & Destructor Documentation

SctArchiving::IOManagerDB::IOManagerDB  )  [private]
 

constructor.

Definition at line 36 of file IOManagerDB.cpp.

References m_compressor, and m_connection.

Referenced by instance().


Member Function Documentation

const SctData::ResultHeader & SctArchiving::IOManagerDB::getHeader const Sct::Serializable ob  )  [static, private]
 

get the header from a TestResult or ScanResult

Definition at line 68 of file IOManagerDB.cpp.

References Sct::Streamable::getClassName(), and Sct::Serializable::getUniqueID().

Referenced by prepareInsertion().

Here is the call graph for this function:

Query SctArchiving::IOManagerDB::getQuery  )  const [private]
 

get a null query.

Definition at line 63 of file IOManagerDB.cpp.

References m_connection.

Referenced by read(), and write().

std::string SctArchiving::IOManagerDB::getQueryMatching const string &  name  )  [static, private]
 

make the "`WHERE'" part of the query matching the name by building a IOName from it.

Referenced by read().

string SctArchiving::IOManagerDB::getTable const Sct::Serializable ob  )  [static, private]
 

find the name of the table which the ob should to into.

Definition at line 104 of file IOManagerDB.cpp.

Referenced by prepareInsertion().

IOManagerDB & SctArchiving::IOManagerDB::instance  )  [static]
 

retrieve access to singleton

Definition at line 46 of file IOManagerDB.cpp.

References IOManagerDB(), and s_man.

Here is the call graph for this function:

void SctArchiving::IOManagerDB::prepareInsertion const Sct::Serializable ob,
MysqlQuery &  q
const [private]
 

change query to prepare to insert ob.

Definition at line 86 of file IOManagerDB.cpp.

References Sct::Streamable::getClassName(), Sct::Archive::IOManagerArchive::getCompressionLevel(), SctData::ResultHeader::getEndTime(), getHeader(), SctData::UniqueID::getModule(), SctData::UniqueID::getRunNumber(), SctData::UniqueID::getScanNumber(), SctData::ResultHeader::getStartTime(), getTable(), SctData::ResultHeader::getUniqueID(), m_compressor, and Sct::Archive::IOManagerStreamerVersioned::writeImpl().

Referenced by write().

Here is the call graph for this function:

boost::shared_ptr< Serializable > SctArchiving::IOManagerDB::read const string &  name,
const Sct::IOParams params = 0
const [virtual]
 

read using appropriate streamers

Definition at line 146 of file IOManagerDB.cpp.

References Sct::Archive::IOManagerStreamerVersioned::getMutex(), getQuery(), getQueryMatching(), Sct::Archive::IOManagerStreamerVersioned::getReadVersionMap(), m_compressor, Sct::Archive::IOManagerStreamerVersioned::readImpl(), and Sct::Archive::IOManagerStreamerVersioned::setReadMode().

Here is the call graph for this function:

std::string SctArchiving::IOManagerDB::status  )  const [virtual]
 

get some status information

Implements Sct::Archive::IOManagerArchive.

Definition at line 51 of file IOManagerDB.cpp.

References m_compressor.

void SctArchiving::IOManagerDB::write const Sct::Serializable ob,
const Sct::IOParams params = 0
const [virtual]
 

write using default streamers

Definition at line 108 of file IOManagerDB.cpp.

References Sct::Archive::IOManagerStreamerVersioned::getMutex(), getQuery(), prepareInsertion(), and Sct::Archive::IOManagerStreamerVersioned::setReadMode().

Here is the call graph for this function:


Field Documentation

boost::shared_ptr<ZlibStringCompressor> SctArchiving::IOManagerDB::m_compressor [private]
 

keep a string compressor handy to zip and unzip BLOB data.

Definition at line 39 of file IOManagerDB.h.

Referenced by IOManagerDB(), prepareInsertion(), read(), and status().

boost::shared_ptr<MysqlConnection> SctArchiving::IOManagerDB::m_connection [private]
 

pointer to the database connection

Definition at line 40 of file IOManagerDB.h.

Referenced by getQuery(), and IOManagerDB().

IOManagerDB * SctArchiving::IOManagerDB::s_man [static, private]
 

pointer to singleton

Definition at line 44 of file IOManagerDB.cpp.

Referenced by instance().


The documentation for this class was generated from the following files:
Generated on Thu Jul 8 11:42:01 2004 for SCT DAQ/DCS Software - C++ by doxygen 1.3.5