+ * Current Option name
+ */
+ const OptionName name;
+
+ /**
+ * Current Option value
+ */
+ ParameterType value;
+
+ public:
+ /**
+ * Default constructor.
+ *
+ * @param name Name of the current Option
+ * @param description Description of current Option
+ * @param function Function used to handle current Option.
+ */
+ Option(const std::string & name, const std::string & description, void (*function)(ParameterType))
+ : Parameter(description), Callable<ParameterType>(function), name(name) {
+ }
+
+ /**
+ *
+ */
+ virtual ~Option() { }
+
+ /**
+ * \inheritdoc
+ */
+ virtual void handle() {
+ this->call(value);
+ used = true;
+ }
+
+ /**
+ * Method used for checking if Option understands given user value.
+ * If so current Option is flagged as used and no more checks against
+ * it will be done in future.
+ *
+ * Passed value should be in form of:
+ * OptionName=OptionValue
+ *
+ * If no equal sign is after OptionName part,
+ * std::invalid_argument exception with appropriate message is thrown
+ *
+ * If conversion of OptionValue part to ParameterType failed,
+ * std::invalid_argument exception with appropriate message is thrown
+ *
+ * @param argv command line value against which test will be made.
+ * User value should be in format: OptionName=OptionValue.
+ *
+ * @return If passed argv succesfully detected OptionName part as a
+ * current option and its OptionValue part has been succesfully
+ * converted to ParameterType, returns true and Option is set as used one.
+ * Otherwise returns false and can be used to check against next value.
+ *
+ * @throw MissingOptionValue when OptionValue part is missing after
+ * equal sign
+ * @throw OptionFailedConversion when OptionValue part failed conversion
+ * to ParameterType
+ */
+ virtual bool understand(const std::string & argv) {
+ if (this->hasName(argv)) {
+ std::size_t pos = this->valuePosition(argv);
+
+ if (pos != name.size()) {
+ throw MissingOptionValue("Option: " + name + " requires value but no one has been provided");
+ }
+
+ std::stringstream ss;
+ ss << std::fixed << argv.substr(pos + 1);
+ ss >> value;
+
+ if (ss.fail()) {
+ throw OptionFailedConversion("Option: " + name + " failed value conversion to the required type");
+ }
+
+ return true;
+ }
+ return false;
+ }
+
+ /**
+ * \inheritdoc