#include <GlobalDefinitions.h>
Inheritance diagram for PrintFromWord:


Public Member Functions | |
| PrintFromWord (const Word word, int wordLength, int bitsPerSymbol, const char *tt) | |
| PrintFromWord (const Word word, const HashTableGeneric &hashTable, int bitsPerSymbol, const char *tt) | |
| PrintFromWord (const WordSequence &wordSeq, int wordLength, int bitsPerSymbol, const char *tt) | |
| PrintFromWord (const WordSequence &wordSeq, const HashTableGeneric &hashTable, int bitsPerSymbol, const char *tt) | |
| void | doPrint (ostream &os) |
| void | doWord (ostream &os, const Word word) |
| void | doWord (ostream &os, const Word word, int length) |
Protected Attributes | |
| const WordSequence * | pWordSeq_ |
| Word | word_ |
| int | length_ |
| int | bitsPerSymbol_ |
| const char * | tt_ |
| Word | mask_ |
Friends | |
| ostream & | operator<< (ostream &os, PrintFromWord pw) |
Definition at line 558 of file GlobalDefinitions.h.
| PrintFromWord::PrintFromWord | ( | const Word | word, | |
| int | wordLength, | |||
| int | bitsPerSymbol, | |||
| const char * | tt | |||
| ) | [inline] |
Definition at line 561 of file GlobalDefinitions.h.
00563 : pWordSeq_(0), word_( word ), length_( wordLength ), 00564 bitsPerSymbol_( bitsPerSymbol ), tt_(tt), 00565 mask_( (1 << bitsPerSymbol) - 1 ) 00566 {}
| PrintFromWord::PrintFromWord | ( | const Word | word, | |
| const HashTableGeneric & | hashTable, | |||
| int | bitsPerSymbol, | |||
| const char * | tt | |||
| ) |
Definition at line 49 of file GlobalDefinitions.cpp.
00051 : pWordSeq_(0), word_( word ), length_( hashTable.getWordLength() ), 00052 bitsPerSymbol_( bitsPerSymbol ), tt_( tt ), 00053 mask_( (1 << bitsPerSymbol) - 1 ) 00054 {}
| PrintFromWord::PrintFromWord | ( | const WordSequence & | wordSeq, | |
| int | wordLength, | |||
| int | bitsPerSymbol, | |||
| const char * | tt | |||
| ) | [inline] |
Definition at line 571 of file GlobalDefinitions.h.
00573 : pWordSeq_( &wordSeq ), length_( wordLength ), 00574 bitsPerSymbol_( bitsPerSymbol ), tt_( tt ), 00575 mask_( (1 << bitsPerSymbol) - 1 ) 00576 {}
| PrintFromWord::PrintFromWord | ( | const WordSequence & | wordSeq, | |
| const HashTableGeneric & | hashTable, | |||
| int | bitsPerSymbol, | |||
| const char * | tt | |||
| ) |
Definition at line 58 of file GlobalDefinitions.cpp.
00060 : pWordSeq_( &wordSeq ), length_( hashTable.getWordLength() ), 00061 bitsPerSymbol_( bitsPerSymbol ), tt_( tt ), 00062 mask_( (1 << bitsPerSymbol) - 1 ) 00063 {}
| void PrintFromWord::doPrint | ( | ostream & | os | ) |
Definition at line 68 of file GlobalDefinitions.cpp.
References bitsPerSymbol_, doWord(), WordSequence::getNumBasesInLast(), length_, pWordSeq_, and word_.
00069 { 00070 if ( pWordSeq_ ) 00071 { 00072 for 00073 ( 00074 WordSequence::const_iterator 00075 i (pWordSeq_->begin() ); 00076 i != static_cast<WordSequence::const_iterator>(&pWordSeq_->back()); 00077 ++i 00078 ) 00079 { 00080 doWord( os, *i ); 00081 } // ~for 00082 if (pWordSeq_->size() != 0) 00083 { 00084 if (pWordSeq_->getNumBasesInLast()==0) 00085 { 00086 doWord(os, pWordSeq_->back()); 00087 } 00088 else 00089 { 00090 doWord( os, 00091 (pWordSeq_->back() >> 00092 (bitsPerSymbol_*( length_ 00093 - pWordSeq_->getNumBasesInLast())) ), 00094 pWordSeq_->getNumBasesInLast() ); 00095 } 00096 } 00097 } // ~if 00098 else 00099 { 00100 doWord( os, word_ ); 00101 } // ~else 00102 } // ~PrintFromWord::doPrint
Here is the call graph for this function:

| void PrintFromWord::doWord | ( | ostream & | os, | |
| const Word | word | |||
| ) | [inline] |
| void PrintFromWord::doWord | ( | ostream & | os, | |
| const Word | word, | |||
| int | length | |||
| ) |
Definition at line 104 of file GlobalDefinitions.cpp.
References bitsPerSymbol_, mask_, and tt_.
00105 { 00106 for ( int i( length - 1 ) ; i >= 0 ; i-- ) 00107 { 00108 00109 // os << &tt_ << " " << 00110 // ( ( word & ( mask_ << (bitsPerSymbol_*i) ) ) 00111 // >> (bitsPerSymbol_*i) ) << endl; 00112 00113 os << tt_ 00114 [ ( word & ( mask_ << (bitsPerSymbol_*i) ) ) 00115 >> (bitsPerSymbol_*i) ]; 00116 } 00117 } // ~doWord
| ostream& operator<< | ( | ostream & | os, | |
| PrintFromWord | pw | |||
| ) | [friend] |
Definition at line 588 of file GlobalDefinitions.h.
00589 { 00590 pw.doPrint(os); 00591 return os; 00592 } // ~operator<<
const WordSequence* PrintFromWord::pWordSeq_ [protected] |
Word PrintFromWord::word_ [protected] |
int PrintFromWord::length_ [protected] |
int PrintFromWord::bitsPerSymbol_ [protected] |
const char* PrintFromWord::tt_ [protected] |
Word PrintFromWord::mask_ [protected] |
1.5.2