X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=command.hpp;fp=command.hpp;h=22f118164eb04e7d22c0438e3e42c56b79ed0f3d;hb=0caf3fbabaa3ece404f8ce77f4c883dc5b1bf1dc;hp=0000000000000000000000000000000000000000;hpb=1b73ff67c83892a025e597dabd9df6fe7b58206a;p=mothur.git diff --git a/command.hpp b/command.hpp new file mode 100644 index 0000000..22f1181 --- /dev/null +++ b/command.hpp @@ -0,0 +1,54 @@ +#ifndef COMMAND_HPP +#define COMMAND_HPP +//test2 +/* + * command.h + * + * + * Created by Pat Schloss on 10/23/08. + * Copyright 2008 Patrick D. Schloss. All rights reserved. + * + */ + +/*This class is a parent to all the command classes. */ + + +#include "mothur.h" +#include "optionparser.h" +#include "validparameter.h" +#include "mothurout.h" +#include "commandparameter.h" + + +class Command { + + public: + Command() { m = MothurOut::getInstance(); } + + //needed by gui + virtual string getCommandName() = 0; + virtual string getCommandCategory() = 0; + virtual string getHelpString() = 0; + virtual string getCitation() = 0; + virtual string getDescription() = 0; + + virtual map > getOutputFiles() { return outputTypes; } + virtual vector setParameters() = 0; //to fill parameters + virtual vector getParameters() { return parameters; } + + virtual int execute() = 0; + virtual void help() = 0; + void citation() { m->mothurOutEndLine(); m->mothurOut(getCitation()); m->mothurOutEndLine(); } + virtual ~Command() { } + + protected: + MothurOut* m; + bool calledHelp; + + map > outputTypes; + vector parameters; + + map >::iterator itTypes; +}; + +#endif