Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

DnpData Class Reference

A "dnp", i.e. a defined nucleotype position. More...

#include <featuredata.h>

Inheritance diagram for DnpData:

Inheritance graph
[legend]
Collaboration diagram for DnpData:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DnpData ()
 DnpData (db_recno_t readRecno, TR_DNA startPos, TR_DNA endPos)
void readDom (QDomElement &elem)
std::string uniqueName ()
TrDb::IndexMap getIndexMap ()
virtual ~DnpData ()
void readStream (QDataStream &str)
void writeStream (QDataStream &str)
void writeDom (QDomElement &elem)
void readAttributes (const QXmlAttributes &attr)
void writeXml (ostream &stream)
void set_dnpID (int id)
int get_dnpID ()
void set_dnp_type (int t)
int get_dnp_type ()

Protected Member Functions

FeatureGuimakeGui ()
FeatureInfomakeInfo ()

Protected Attributes

int dnpID
int type

Detailed Description

A "dnp", i.e. a defined nucleotype position.

Definition at line 94 of file featuredata.h.


Constructor & Destructor Documentation

DnpData::DnpData  )  [inline]
 

Definition at line 97 of file featuredata.h.

00097              : FeatureData(), dnpID(-1)
00098   {}

DnpData::DnpData db_recno_t  readRecno,
TR_DNA  startPos,
TR_DNA  endPos
 

Definition at line 152 of file featuredata.cpp.

00153   : FeatureData( readRecno, startPos, endPos ), dnpID(-1), type(-1)
00154 {}

virtual DnpData::~DnpData  )  [inline, virtual]
 

Definition at line 103 of file featuredata.h.

00104   {}


Member Function Documentation

int DnpData::get_dnp_type  ) 
 

Definition at line 214 of file featuredata.cpp.

References type.

00215 {
00216   return type;
00217 }

int DnpData::get_dnpID  ) 
 

Definition at line 204 of file featuredata.cpp.

References dnpID.

Referenced by DnpInfo::myInfoPos(), and DnpInfo::myInfoRange().

00205 {
00206   return dnpID;
00207 }

TrDb::IndexMap DnpData::getIndexMap  )  [inline, virtual]
 

Returns a TrDb::IndexMap that specifies which secondary indexes should be generated for stored data objects of this class in the Berkeley Db backend. Each record in the TrDb::IndexMap generates a secondary index built as a btree ( a DB_BTREE in Berkeley Db wording ). The secondary index is sorted which makes it possible to do queries like "Give me the object that has the smallest value, bigger or equal than x".

And about speed performance, a quote from Berkeley Db documentation says: "Searches take O(log base_b N) time, where base_b is the average number of keys per page, and N is the total number of keys stored"

Reimplemented from FeatureData.

Definition at line 102 of file featuredata.h.

References FeatureData::getIndexMap().

00102 { return FeatureData::getIndexMap(); }

FeatureGui* DnpData::makeGui  )  [inline, protected, virtual]
 

Implements FeatureData.

Definition at line 116 of file featuredata.h.

00116 { return new DnpGui( this ); }

FeatureInfo* DnpData::makeInfo  )  [inline, protected, virtual]
 

Reimplemented from FeatureData.

Definition at line 117 of file featuredata.h.

00117 { return new DnpInfo( this ); }

void DnpData::readAttributes const QXmlAttributes &  attr  )  [virtual]
 

Loads the state of this object from QXmlAttributes.This method is used for importing.

Reimplemented from FeatureData.

Definition at line 179 of file featuredata.cpp.

References dnpID, FeatureData::readAttributes(), and type.

00180 {
00181     FeatureData::readAttributes( attr );
00182     if ( attr.value("dnpID") != "" ) {
00183       dnpID = attr.value("dnpID").toInt();
00184     }
00185     if ( attr.value("type") != "" ) {
00186       type = attr.value("type").toInt();
00187     }
00188     
00189 }

void DnpData::readDom QDomElement &  elem  )  [virtual]
 

Loads the state of this object from a dom tree. Or in other words reads in the values of the data members of this class from a dom tree underneath the QDomElement elem. This method is used for importing.

Reimplemented from FeatureData.

Definition at line 174 of file featuredata.cpp.

References FeatureData::readDom().

00175 {
00176     FeatureData::readDom( elem );
00177 }

void DnpData::readStream QDataStream &  str  )  [virtual]
 

Loads the state of this object from a byte stream. Or in other words reads and unserializes a byte stream to set the values of this class object. This method is used for loading a GeneralData object from Berkeley Db.

Reimplemented from FeatureData.

Definition at line 156 of file featuredata.cpp.

References dnpID, FeatureData::readStream(), and type.

00157 {
00158   FeatureData::readStream( stream );
00159   stream>>dnpID>>type;
00160 }

void DnpData::set_dnp_type int  t  ) 
 

Definition at line 209 of file featuredata.cpp.

References type.

00210 {
00211   type = t;
00212 }

void DnpData::set_dnpID int  id  ) 
 

Definition at line 199 of file featuredata.cpp.

References dnpID.

00200 {
00201   dnpID = id;
00202 }

std::string DnpData::uniqueName  )  [inline, virtual]
 

Specifies a name that uniquely should identify this class. It will be used for lookups in the GeneralMaker class.

Implements GeneralData.

Definition at line 101 of file featuredata.h.

00101 { return std::string("DnpData"); }

void DnpData::writeDom QDomElement &  elem  )  [virtual]
 

Saves the state of this object to a dom tree. Or in other words writes out the internal data held in this class to a dom tree underneath the QDomElement elem. This method is used for exporting.

Reimplemented from FeatureData.

Definition at line 168 of file featuredata.cpp.

References FeatureData::writeDom().

00169 {
00170     FeatureData::writeDom( elem );
00171     elem.setAttribute("dnp", "11" );
00172 }

void DnpData::writeStream QDataStream &  str  )  [virtual]
 

Saves the state of this object to a byte stream. Or in other words serializes and writes the internal data held in this class object to a byte stream. This method is used for storing a GeneralData object into Berkeley Db.

Reimplemented from FeatureData.

Definition at line 162 of file featuredata.cpp.

References dnpID, type, and FeatureData::writeStream().

00163 {
00164     FeatureData::writeStream( str );
00165     str<<dnpID<<type;
00166 }

void DnpData::writeXml ostream &  stream  )  [virtual]
 

Reimplemented from FeatureData.

Definition at line 190 of file featuredata.cpp.

References dnpID, type, and FeatureData::writeXml().

00191 {
00192   FeatureData::writeXml(stream);
00193   stream<<" dnpID=\""<<dnpID<<"\""
00194         <<" type=\""<<type<<"\"";
00195   stream<<"/>\n";
00196 }


Member Data Documentation

int DnpData::dnpID [protected]
 

Definition at line 118 of file featuredata.h.

Referenced by get_dnpID(), readAttributes(), readStream(), set_dnpID(), writeStream(), and writeXml().

int DnpData::type [protected]
 

Definition at line 119 of file featuredata.h.

Referenced by get_dnp_type(), readAttributes(), readStream(), set_dnp_type(), writeStream(), and writeXml().


The documentation for this class was generated from the following files:
Generated on Fri Mar 17 17:44:58 2006 for trapper by  doxygen 1.4.4