5 * Created by Pat Schloss on 10/25/08.
6 * Copyright 2008 Patrick D. Schloss. All rights reserved.
10 #include "command.hpp"
11 #include "readdistcommand.h"
12 #include "readtreecommand.h"
13 #include "readotucommand.h"
14 #include "clustercommand.h"
15 #include "parselistcommand.h"
16 #include "collectcommand.h"
17 #include "collectsharedcommand.h"
18 #include "getgroupcommand.h"
19 #include "getlabelcommand.h"
20 #include "getlinecommand.h"
21 #include "rarefactcommand.h"
22 #include "summarycommand.h"
23 #include "summarysharedcommand.h"
24 #include "rarefactsharedcommand.h"
25 #include "quitcommand.h"
26 #include "helpcommand.h"
27 #include "commandfactory.hpp"
28 #include "deconvolutecommand.h"
29 #include "parsimonycommand.h"
30 #include "unifracunweightedcommand.h"
31 #include "unifracweightedcommand.h"
32 #include "libshuffcommand.h"
33 #include "heatmapcommand.h"
34 #include "venncommand.h"
36 #include "nocommands.h"
39 /***********************************************************/
41 /***********************************************************/
42 CommandFactory::CommandFactory(){
43 command = new NoCommand();
45 /***********************************************************/
47 /***********************************************************/
48 CommandFactory::~CommandFactory(){
52 /***********************************************************/
54 /***********************************************************/
55 //This function calls the appropriate command fucntions based on user input.
56 Command* CommandFactory::getCommand(string commandName){
58 delete command; //delete the old command
60 if(commandName == "read.dist") { command = new ReadDistCommand(); }
61 else if(commandName == "read.otu") { command = new ReadOtuCommand(); }
62 else if(commandName == "read.tree") { command = new ReadTreeCommand(); }
63 else if(commandName == "cluster") { command = new ClusterCommand(); }
64 else if(commandName == "deconvolute") { command = new DeconvoluteCommand(); }
65 else if(commandName == "parsimony") { command = new ParsimonyCommand(); }
66 else if(commandName == "help") { command = new HelpCommand(); }
67 else if(commandName == "quit") { command = new QuitCommand(); }
68 else if(commandName == "collect.single") { command = new CollectCommand(); }
69 else if(commandName == "collect.shared") { command = new CollectSharedCommand(); }
70 else if(commandName == "rarefaction.single") { command = new RareFactCommand(); }
71 else if(commandName == "rarefaction.shared") { command = new RareFactSharedCommand(); }
72 else if(commandName == "summary.single") { command = new SummaryCommand(); }
73 else if(commandName == "summary.shared") { command = new SummarySharedCommand(); }
74 else if(commandName == "unifrac.weighted") { command = new UnifracWeightedCommand(); }
75 else if(commandName == "unifrac.unweighted") { command = new UnifracUnweightedCommand(); }
76 else if(commandName == "get.group") { command = new GetgroupCommand(); }
77 else if(commandName == "get.label") { command = new GetlabelCommand(); }
78 else if(commandName == "get.line") { command = new GetlineCommand(); }
79 else if(commandName == "libshuff") { command = new LibShuffCommand(); }
80 else if(commandName == "heatmap") { command = new HeatMapCommand(); }
81 else if(commandName == "venn") { command = new VennCommand(); }
82 else { command = new NoCommand(); }
87 cout << "Standard Error: " << e.what() << " has occurred in the CommandFactory class Function getCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
91 cout << "An unknown error has occurred in the CommandFactory class function getCommand. Please contact Pat Schloss at pschloss@microbio.umass.edu." << "\n";
96 /***********************************************************/