30 using namespace pwiz::util;
 
   31 using namespace pwiz::analysis;
 
   44     SimpleAnalyzer(
size_t _index) : index(_index), opened(false), updateCount(0), closed(false) {}
 
   57     virtual UpdateRequest updateRequested(
const DataInfo& dataInfo, 
 
   58                                           const SpectrumIdentity& entry)
 const  
   65                         const Spectrum& spectrum) 
 
   67         if (
os_) *
os_ << 
"[" << index << 
"]" << 
" update: " << spectrum.index << endl;
 
   83     virtual MSDataAnalyzerDriver::Status progress(
size_t index, 
size_t size)
 
   85         if (
os_) *
os_ << 
"progress: " << index << 
"/" << size << endl;
 
  100     virtual MSDataAnalyzerDriver::Status progress(
size_t index, 
size_t size)
 
  102         if (
os_) *
os_ << 
"progress: " << index << 
"/" << size << endl;
 
  111     if (
os_) *
os_ << 
"test()\n"; 
 
  120     for (MSDataAnalyzerContainer::const_iterator it=analyzers.begin(); it!=analyzers.end(); ++it)
 
  132     const int spectrumCount = 30;
 
  133     for (
int i=0; i<spectrumCount; i++) 
 
  136         sl->spectra.back()->index = i;
 
  144     MSDataAnalyzerDriver::Status status = driver.
analyze(dummy, &callback);
 
  148     for (MSDataAnalyzerContainer::const_iterator it=analyzers.begin(); it!=analyzers.end(); ++it)
 
  160     if (
os_) *
os_ << 
"testing cancel callback:\n";
 
  163     status = driver.
analyze(dummy, &cancelCallback);
 
  165     unit_assert(status == MSDataAnalyzerDriver::Status_Cancel);
 
  167     if (
os_) *
os_ << 
"cancelled!\n";
 
  169     for (MSDataAnalyzerContainer::const_iterator it=analyzers.begin(); it!=analyzers.end(); ++it)
 
  181 int main(
int argc, 
char* argv[])
 
  187         if (argc>1 && !strcmp(argv[1],
"-v")) 
os_ = &cout;