Documentation improvements.
[command.git] / include / parameter.h
index ed792184d1047a264921bb5ce94d1af87b58e490..443111dbd4d0de120589ac9311a1d8d9008b57ff 100644 (file)
@@ -14,6 +14,10 @@ namespace command {
      *  ./myprog ARGUMENT
      */
     class Parameter : public Descriptive {
+    protected:
+        /** Variable indicating if current Parameter was already used or not */
+        bool used = false;
+
     public:
         typedef class Parameter Type;
         /**
@@ -21,21 +25,44 @@ namespace command {
          *
          * @param description Description of current Argument
          */
-        Parameter(std::string description)
+        Parameter(const std::string & description)
             : Descriptive(description) {
         }
-        virtual ~Parameter() {}
+
+        virtual ~Parameter() { }
 
         /**
-         * Method used for handling method calls linked with Argument or Option
+         * Method used for handling method calls linked with this Parameter
          */
         virtual void handle() = 0;
 
         /**
          * Method used for checking if the given user value understandable for
          * parameter.
+         *
+         * @return true if passed value is understandable by current Parameter.
+         *      False otherwise.
          */
         virtual bool understand(const std::string & ) = 0;
+
+        /**
+         * Indicates if current Parameter is required
+         *
+         * @return false, as all Parameters are non-required by default. If you
+         *      want to make Parameter as required, wrap it using Required class
+         */
+        virtual bool isRequired() {
+            return false;
+        };
+
+        /**
+         * Indicates if current Parameter has been already used
+         *
+         * @return true if current Parameter has been already used. False otherwise.
+         */
+        virtual bool isUsed() {
+            return used;
+        }
     };
 }