1 #ifndef __COMMAND_OPTION_H
2 #define __COMMAND_OPTION_H
10 * Class responsible for handling commandline options.
11 * Options are non-required, named parameters of program.
14 * ./myprog OptionName OptionValue
16 template<typename OptionType>
18 : public Parameter, public Callable<OptionType> {
27 * Default constructor.
29 * @param name Name of the current Option
30 * @param description Description of current Option
31 * @param function Function used to handle current Option.
33 Option(std::string name, std::string description, void (*function)(OptionType))
34 : Parameter(description), Callable<OptionType>(function), name(name) {
38 virtual void handle() {
39 this->call(std::string("O"));
42 virtual bool understand(const std::string & argVal) {
43 if (argVal.find(name) != std::string::npos) {
52 #endif /* __COMMAND_OPTION_H */