MatchStoreImp Class Reference

#include <MatchStore.h>

Inheritance diagram for MatchStoreImp:

Inheritance graph
[legend]
Collaboration diagram for MatchStoreImp:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MatchStoreImp (string queryName, int queryNum, int queryBases, const NameReader &reader)
 ~MatchStoreImp ()
virtual void addMatch (SequenceNumber subjectNum, SequenceOffset numBases, SequenceOffset queryStart, SequenceOffset queryEnd, SequenceOffset subjectStart, SequenceOffset subjectEnd, bool isQueryForward, bool isSubjectForward)
void printResult (ostream &outputStream=cout) const
virtual void clear (void)
void setup (void)

Protected Attributes

vector< MatchImp * > imps_
string queryName_
int queryNum_
int queryBases_
const NameReaderreader_

Friends

class MatchImp

Detailed Description

Definition at line 181 of file MatchStore.h.


Constructor & Destructor Documentation

MatchStoreImp::MatchStoreImp ( string  queryName,
int  queryNum,
int  queryBases,
const NameReader reader 
) [inline]

Definition at line 185 of file MatchStore.h.

00188                                            :
00189   queryName_ ( queryName ),
00190   queryNum_( queryNum ),
00191   queryBases_( queryBases ), 
00192   reader_( reader )
00193     {
00194       //      reserve(1000);
00195       //     imps_.reserve(1000);
00196     }

MatchStoreImp::~MatchStoreImp (  ) 

Definition at line 110 of file MatchStore.cpp.

References imps_.

00111 {
00112   for (vector<MatchImp*>::iterator i(imps_.begin()) ; i!= imps_.end() ; ++i )
00113     delete (*i);
00114 
00115 }


Member Function Documentation

void MatchStoreImp::addMatch ( SequenceNumber  subjectNum,
SequenceOffset  numBases,
SequenceOffset  queryStart,
SequenceOffset  queryEnd,
SequenceOffset  subjectStart,
SequenceOffset  subjectEnd,
bool  isQueryForward,
bool  isSubjectForward 
) [virtual]

Reimplemented from MatchStore.

Definition at line 131 of file MatchStore.cpp.

References DEBUG_L2, and imps_.

00140 {
00141   DEBUG_L2(             subjectNum << " " << 
00142                         numBases << " " << 
00143                         queryStart << " " << 
00144                         queryEnd << " " << 
00145                         subjectStart << " " << 
00146                         subjectEnd << " " << 
00147                         isQueryForward );
00148 
00149   imps_.push_back( new MatchImp ( this,
00150                                   subjectNum, 
00151                                   numBases, 
00152                                   queryStart, 
00153                                   queryEnd, 
00154                                   subjectStart, 
00155                                   subjectEnd, 
00156                                   isQueryForward,
00157                                   isSubjectForward) );
00158   //  push_back(static_cast<Match*>(imps_.back()));
00159   //  names_.insert(pair<SequenceNumber, string>(subjectNum, subjectName));
00160   //  cout << "inserting subject num" << subjectNum << " " << subjectName
00161   //     << endl;
00162   //  push_back(&matchImps_.back());
00163   //  MatchStore::iterator i(&back());
00164   //  DEBUG_L1( matchImps_.size() << " " << size() << " " 
00165   //    << i << " " << *i << " "  );
00166   //  DEBUG_L1( (*i)->getQueryNum() << " " << (*i)->getQueryName() << " " 
00167   //    << (*i)->getQueryStart() << " " << (*i)->getQueryEnd() << " " 
00168   //    << (*i)->getSubjectNum() << " " << (*i)->getSubjectName() << " " 
00169   //    << (*i)->getSubjectStart() << " " << (*i)->getSubjectEnd() ); 
00170   
00171 
00172 }

void MatchStoreImp::printResult ( ostream &  outputStream = cout  )  const [virtual]

Reimplemented from MatchStore.

Definition at line 79 of file MatchStore.cpp.

00080 { 
00081   
00082   if (empty()) return;
00083 
00084   outputStream << endl << "Matches For Query " 
00085                << queryNum_
00086                << " (" << queryBases_
00087                << " bases): " << queryName_
00088                << "\n\n";    
00089  
00090   for( vector<MatchImp*>::const_iterator i(imps_.begin());i!=imps_.end();++i)
00091   {
00092     //    MatchImp* i(*j);
00093 
00094     outputStream << (((*i)->isQueryForward_)?"F":"R")
00095                  <<" " << (*i)->subjectNum_
00096                  << "\t: " << (*i)->getSubjectName()// names_[(*i)->subjectNum_]
00097                  << "\tBases: " << (*i)->numBases_
00098                  << "\tQ: " << (*i)->queryStart_ 
00099                  << " to " << (*i)->queryEnd_
00100                  << "\tS: " << (*i)->subjectStart_ 
00101                  << " to " << (*i)->subjectEnd_ 
00102                  << "\n"; 
00103 
00104   }  // ~for i
00105    
00106   outputStream << endl;
00107 
00108 } // ~QueryManager::printResult

void MatchStoreImp::clear ( void   )  [virtual]

Reimplemented from MatchStore.

Definition at line 117 of file MatchStore.cpp.

References imps_, and queryBases_.

00118 { 
00119     
00120   for (vector<MatchImp*>::iterator i(imps_.begin()) ; i!= imps_.end() ; ++i )
00121     delete (*i);
00122   vector<Match*>::clear();
00123   imps_.clear();
00124   //    matchImps_.clear();
00125   queryBases_ = 0;
00126 }

void MatchStoreImp::setup ( void   ) 

Definition at line 174 of file MatchStore.cpp.

References imps_.

00175 {
00176   vector<Match*>::clear();
00177   for ( vector<MatchImp*>::iterator i(imps_.begin());i!=imps_.end();++i)
00178     push_back( static_cast<Match*>(*i));
00179 }


Friends And Related Function Documentation

friend class MatchImp [friend]

Definition at line 183 of file MatchStore.h.


Member Data Documentation

vector<MatchImp*> MatchStoreImp::imps_ [protected]

Definition at line 221 of file MatchStore.h.

Referenced by addMatch(), clear(), setup(), and ~MatchStoreImp().

string MatchStoreImp::queryName_ [protected]

Definition at line 223 of file MatchStore.h.

Referenced by MatchImp::getQueryName().

int MatchStoreImp::queryNum_ [protected]

Definition at line 224 of file MatchStore.h.

Referenced by MatchImp::getQueryNum().

int MatchStoreImp::queryBases_ [protected]

Definition at line 225 of file MatchStore.h.

Referenced by clear(), and MatchImp::getQuerySize().

const NameReader& MatchStoreImp::reader_ [protected]

Definition at line 228 of file MatchStore.h.

Referenced by MatchImp::getSubjectName().


The documentation for this class was generated from the following files:
Generated on Fri Dec 21 13:18:52 2007 for ssaha by  doxygen 1.5.2