[libcamera-devel] [PATCH v2 07/30] cam: options: Disable copy for parsers

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Jul 12 23:56:22 CEST 2021


Copying the OptionsParser class would result in the optionsMap_ entries
pointing to Option entries of the original instance. As there's no use
case for copying the class, disable copying.

Disable copying of KeyValueParser as well for consistency as there's no
use case either.

Signed-off-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham at ideasonboard.com>
---
 src/cam/options.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/cam/options.h b/src/cam/options.h
index 01a5d36a63fb..4418e201bf1f 100644
--- a/src/cam/options.h
+++ b/src/cam/options.h
@@ -68,6 +68,9 @@ public:
 	virtual Options parse(const char *arguments);
 
 private:
+	KeyValueParser(const KeyValueParser &) = delete;
+	KeyValueParser &operator=(const KeyValueParser &) = delete;
+
 	friend class OptionsParser;
 	void usage(int indent);
 
@@ -95,6 +98,9 @@ public:
 	void usage();
 
 private:
+	OptionsParser(const OptionsParser &) = delete;
+	OptionsParser &operator=(const OptionsParser &) = delete;
+
 	void usageOptions(const std::list<Option> &options, unsigned int indent);
 
 	std::list<Option> options_;
-- 
Regards,

Laurent Pinchart



More information about the libcamera-devel mailing list