X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=commandfactory.cpp;h=a3858639a1f78d633e9c1537054978bac4e4d499;hb=4ba6188707e67c638ea5ee3c787d5d07ccd07e3e;hp=9adf6791505060d7379fbfc387e1ce6f5d9f5afd;hpb=c4fb347858dd8cfea4d2933f429fff4130dca65b;p=mothur.git diff --git a/commandfactory.cpp b/commandfactory.cpp index 9adf679..a385863 100644 --- a/commandfactory.cpp +++ b/commandfactory.cpp @@ -57,6 +57,9 @@ #include "secondarystructurecommand.h" #include "getsharedotucommand.h" #include "getlistcountcommand.h" +#include "hclustercommand.h" +#include "classifyseqscommand.h" +#include "phylotypecommand.h" /***********************************************************/ @@ -110,9 +113,12 @@ CommandFactory::CommandFactory(){ commands["remove.seqs"] = "get.seqs"; commands["system"] = "system"; commands["align.check"] = "align.check"; - commands["get.sharedotu"] = "get.sharedotu"; - commands["get.listcount"] = "get.listcount"; + commands["get.sharedseqs"] = "get.sharedseqs"; + commands["get.otulist"] = "get.otulist"; commands["quit"] = "quit"; + commands["hcluster"] = "hcluster"; + commands["classify.seqs"] = "classify.seqs"; + commands["phylotype"] = "phylotype"; } /***********************************************************/ @@ -175,8 +181,11 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ else if(commandName == "merge.files") { command = new MergeFileCommand(optionString); } else if(commandName == "system") { command = new SystemCommand(optionString); } else if(commandName == "align.check") { command = new AlignCheckCommand(optionString); } - else if(commandName == "get.sharedotu") { command = new GetSharedOTUCommand(optionString); } - else if(commandName == "get.listcount") { command = new GetListCountCommand(optionString); } + else if(commandName == "get.sharedseqs") { command = new GetSharedOTUCommand(optionString); } + else if(commandName == "get.otulist") { command = new GetListCountCommand(optionString); } + else if(commandName == "hcluster") { command = new HClusterCommand(optionString); } + else if(commandName == "classify.seqs") { command = new ClassifySeqsCommand(optionString); } + else if(commandName == "phylotype") { command = new PhylotypeCommand(optionString); } else { command = new NoCommand(optionString); } return command; @@ -186,7 +195,22 @@ Command* CommandFactory::getCommand(string commandName, string optionString){ exit(1); } } +/***********************************************************/ +//This function is used to interrupt a command +Command* CommandFactory::getCommand(){ + try { + delete command; //delete the old command + string s = ""; + command = new NoCommand(s); + + return command; + } + catch(exception& e) { + errorOut(e, "CommandFactory", "getCommand"); + exit(1); + } +} /***********************************************************************/ bool CommandFactory::isValidCommand(string command) { try {