- Main Page
- Classes
- Files

- File List

# OptFrame/Modules/UsageModule.hpp

    00001 #ifndef USAGEMODULE_HPP_
    00002 #define USAGEMODULE_HPP_
    00003
    00004 #include "../OptFrameModule.hpp"
    00005
    00006 template<class R, class M>
    00007 class UsageModule : public OptFrameModule<R,M>
    00008 {
    00009 public:
    00010         string id()
    00011         {
    00012                 return "usage";
    00013         }
    00014         string usage()
    00015         {
    00016                 return "usage module_name";
    00017         }
    00018
    00019         void run(vector<OptFrameModule<R,M>*> all_modules, HeuristicFactory<R,M>*, map<string,string>* dictionary, string rest)
    00020         {
    00021                 Scanner scanner(rest);
    00022
    00023                 string command = scanner.next();
    00024
    00025                 bool notfound = true;
    00026
    00027                 for(int i=0;i<all_modules.size();i++)
    00028                         if(command == all_modules[i]->id())
    00029                         {
    00030                                 cout << "Usage: " << all_modules[i]->usage() << endl;
    00031                                 notfound = false;
    00032                                 break;
    00033                         }
    00034
    00035                 if(notfound)
    00036                         cout << "Module '"<<command<<"' not found!"<<endl;
    00037         }
    00038
    00039 };
    00040
    00041 #endif /* USAGEMODULE_HPP_ */

All Classes Functions