X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;ds=sidebyside;f=listvector.cpp;h=94ca02662bc1e59f61312e7c33d2244faa30e3ae;hb=cfe70bbc94980a0177af465d3464db754673bd56;hp=205fe607eadaf8c15a9e93e3c10b8ecda62629a7;hpb=c5c7502f435e1413c19e373dab1dfebcaa67588d;p=mothur.git diff --git a/listvector.cpp b/listvector.cpp index 205fe60..94ca026 100644 --- a/listvector.cpp +++ b/listvector.cpp @@ -7,8 +7,6 @@ * */ -using namespace std; - #include "sabundvector.hpp" #include "rabundvector.hpp" @@ -18,11 +16,11 @@ using namespace std; /***********************************************************************/ -ListVector::ListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){}; +ListVector::ListVector() : DataVector(), maxRank(0), numBins(0), numSeqs(0){} /***********************************************************************/ -ListVector::ListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){}; +ListVector::ListVector(int n): DataVector(), data(n, "") , maxRank(0), numBins(0), numSeqs(0){} /***********************************************************************/ @@ -38,11 +36,7 @@ ListVector::ListVector(string id, vector lv) : DataVector(id), data(lv){ } } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "ListVector"); exit(1); } } @@ -61,13 +55,11 @@ ListVector::ListVector(ifstream& f) : DataVector(), maxRank(0), numBins(0), numS f >> inputData; set(i, inputData); } + + gobble(f); } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function ListVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "ListVector"); exit(1); } } @@ -87,11 +79,7 @@ void ListVector::set(int binNumber, string seqNames){ numSeqs += (nNames_new - nNames_old); } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function set. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function set. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "set"); exit(1); } } @@ -116,11 +104,7 @@ void ListVector::push_back(string seqNames){ numSeqs += nNames; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function push_back. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function push_back. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "push_back"); exit(1); } } @@ -160,11 +144,7 @@ void ListVector::print(ostream& output){ output << endl; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function print. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "print"); exit(1); } } @@ -195,11 +175,7 @@ RAbundVector ListVector::getRAbundVector(){ return rav; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function getRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function getRAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "getRAbundVector"); exit(1); } } @@ -220,11 +196,7 @@ SAbundVector ListVector::getSAbundVector(){ return sav; } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function getSAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function getSAbundVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "getSAbundVector"); exit(1); } } @@ -266,7 +238,7 @@ OrderVector ListVector::getOrderVector(map* orderMap = NULL){ } else{ if(orderMap->count(seqName) == 0){ - cerr << seqName << " not found, check *.names file\n"; + m->mothurOut(seqName + " not found, check *.names file\n"); exit(1); } @@ -276,7 +248,7 @@ OrderVector ListVector::getOrderVector(map* orderMap = NULL){ } if(orderMap->count(seqName) == 0){ - cerr << seqName << " not found, check *.names file\n"; + m->mothurOut(seqName + " not found, check *.names file\n"); exit(1); } ov.set((*orderMap)[seqName], i); @@ -289,11 +261,7 @@ OrderVector ListVector::getOrderVector(map* orderMap = NULL){ } } catch(exception& e) { - cout << "Standard Error: " << e.what() << " has occurred in the ListVector class Function getOrderVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; - exit(1); - } - catch(...) { - cout << "An unknown error has occurred in the ListVector class function getOrderVector. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n"; + m->errorOut(e, "ListVector", "getOrderVector"); exit(1); } }