X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=globaldata.cpp;h=69dccb5226638a3af2a2bb9936b774f6dc90169e;hb=e189982e0a9b7352ad57cc38ccee675f128be22e;hp=155aad57e1a6bcce20cbce2e0c8d92c776ead103;hpb=ac1da2a793271cb67f2a2155c5558e1fabdd6aba;p=mothur.git diff --git a/globaldata.cpp b/globaldata.cpp index 155aad5..69dccb5 100644 --- a/globaldata.cpp +++ b/globaldata.cpp @@ -27,12 +27,10 @@ string GlobalData::getNameFile() { return namefile; } string GlobalData::getGroupFile() { return groupfile; } string GlobalData::getOrderFile() { return orderfile; } string GlobalData::getTreeFile() { return treefile; } -string GlobalData::getSharedFile() { return sharedfile; } -//string GlobalData::getFastaFile() { return fastafile; } +string GlobalData::getSharedFile() { return sharedfile; } string GlobalData::getFormat() { return format; } void GlobalData::setListFile(string file) { listfile = file; inputFileName = file; } -//void GlobalData::setFastaFile(string file) { fastafile = file; inputFileName = file; } void GlobalData::setTreeFile(string file) { treefile = file; inputFileName = file; } void GlobalData::setRabundFile(string file) { rabundfile = file; inputFileName = file; } void GlobalData::setSabundFile(string file) { sabundfile = file; inputFileName = file; } @@ -49,6 +47,7 @@ void GlobalData::setFormat(string Format) { format = Format; } /******************************************************/ GlobalData::GlobalData() { + m = MothurOut::getInstance(); //option definitions should go here... clear(); gListVector = NULL; @@ -63,6 +62,7 @@ GlobalData::GlobalData() { gMatrix = NULL; gTreemap = NULL; gSequenceDB = NULL; + nameMap = NULL; } /*******************************************************/ @@ -80,6 +80,7 @@ void GlobalData::clear() { // fastafile = ""; //do we need this? treefile = ""; sharedfile = ""; + format = ""; } @@ -115,16 +116,19 @@ void GlobalData::newRead() { if (gTreemap != NULL) { delete gTreemap; gTreemap = NULL; } if (gSequenceDB != NULL) { delete gSequenceDB; gSequenceDB = NULL;} + + if (nameMap != NULL) { delete nameMap; nameMap = NULL; } gTree.clear(); Treenames.clear(); - labels.clear(); lines.clear(); Groups.clear(); + labels.clear(); Groups.clear(); allLines = 1; runParse = true; + names.clear(); } catch(exception& e) { - errorOut(e, "GlobalData", "newRead"); + m->errorOut(e, "GlobalData", "newRead"); exit(1); } } @@ -147,9 +151,10 @@ GlobalData::~GlobalData() { if (gMatrix != NULL) { delete gMatrix; gMatrix = NULL;} if (gTreemap != NULL) { delete gTreemap; gTreemap = NULL; } if (gSequenceDB != NULL) { delete gSequenceDB; gSequenceDB = NULL;} + if (nameMap != NULL) { delete nameMap; nameMap = NULL; } } catch(exception& e) { - errorOut(e, "GlobalData", "~GlobalData"); + m->errorOut(e, "GlobalData", "~GlobalData"); exit(1); } }