From patchwork Mon Apr 27 22:05:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 3579 Return-Path: Received: from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net [195.74.38.227]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 691B060AFA for ; Tue, 28 Apr 2020 00:06:17 +0200 (CEST) X-Halon-ID: 40a2af04-88d3-11ea-b7d8-005056917a89 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (p4fca2392.dip0.t-ipconnect.de [79.202.35.146]) by bin-vsp-out-01.atm.binero.net (Halon) with ESMTPA id 40a2af04-88d3-11ea-b7d8-005056917a89; Tue, 28 Apr 2020 00:05:49 +0200 (CEST) From: =?utf-8?q?Niklas_S=C3=B6derlund?= To: libcamera-devel@lists.libcamera.org Date: Tue, 28 Apr 2020 00:05:26 +0200 Message-Id: <20200427220529.1085074-3-niklas.soderlund@ragnatech.se> X-Mailer: git-send-email 2.26.0 In-Reply-To: <20200427220529.1085074-1-niklas.soderlund@ragnatech.se> References: <20200427220529.1085074-1-niklas.soderlund@ragnatech.se> MIME-Version: 1.0 Subject: [libcamera-devel] [PATCH v2 2/5] cam: options: Add public method to invalided options X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Apr 2020 22:06:17 -0000 Extend OptionsBase with a public invalidate() method. This allows sub-classes to continue the interpreting of parsed options and invalidate them if they find problems with the result. Signed-off-by: Niklas Söderlund Reviewed-by: Laurent Pinchart --- src/cam/options.cpp | 6 ++++++ src/cam/options.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/cam/options.cpp b/src/cam/options.cpp index 2c56eacf006e9857..77b3cc1f8c5a59e9 100644 --- a/src/cam/options.cpp +++ b/src/cam/options.cpp @@ -64,6 +64,12 @@ const OptionValue &OptionsBase::operator[](const T &opt) const return values_.find(opt)->second; } +template +void OptionsBase::invalidate() +{ + valid_ = false; +} + template bool OptionsBase::parseValue(const T &opt, const Option &option, const char *optarg) diff --git a/src/cam/options.h b/src/cam/options.h index 5060fee0c26b896f..8ccbfee48f7ca0b5 100644 --- a/src/cam/options.h +++ b/src/cam/options.h @@ -54,6 +54,8 @@ public: bool isSet(const T &opt) const; const OptionValue &operator[](const T &opt) const; + void invalidate(); + private: friend class KeyValueParser; friend class OptionsParser;