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

RemoveAlgo Class Reference

#include <removealgo.h>

Inheritance diagram for RemoveAlgo:

Inheritance graph
[legend]
Collaboration diagram for RemoveAlgo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RemoveAlgo (TrapperDoc *pDoc_, std::set< db_recno_t > &recnoList, AlgoParam *param)
void start ()

Detailed Description

Definition at line 6 of file removealgo.h.


Constructor & Destructor Documentation

RemoveAlgo::RemoveAlgo TrapperDoc pDoc_,
std::set< db_recno_t > &  recnoList,
AlgoParam param
[inline]
 

Definition at line 9 of file removealgo.h.

00009                                                                                     : 
00010     RWAlgo(pDoc_, recnoList, param) {}


Member Function Documentation

void RemoveAlgo::start  )  [virtual]
 

Implements RWAlgo.

Definition at line 3 of file removealgo.cc.

References MAl_Readonly::get_len(), MAl_Readonly::get_num_seq(), RWAlgo::getMAl(), and MAl::set_DNP().

00004 {
00005   if ( getMAl()->get_num_seq() == 0 ) {
00006     cerr<<"Nothing to be done here! "<<endl;
00007     return;
00008   }
00009 
00010   //This can be done much more efficiently, removing stuff 
00011   //directly in the db instead. Oh, well...
00012 
00013   int num(0);
00014   for( size_t i = 0; i < getMAl()->get_num_seq(); i++ ) {
00015     for( size_t j = 0; j < getMAl()->get_len(i); j++ ) {
00016       if ( getMAl()->is_DNP(i, j) ) {
00017         num++;
00018         getMAl()->set_DNP(i, j, false);
00019       }
00020     }
00021   }
00022   cerr<<num<<" DNPs removed"<<endl;
00023 }


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