[libcamera-devel,v3,07/33] cam: options: Disable copy for parsers
diff mbox series

Message ID 20210715211459.19373-8-laurent.pinchart@ideasonboard.com
State Accepted
Headers show
Series
  • Multi-camera support in the cam application
Related show

Commit Message

Laurent Pinchart July 15, 2021, 9:14 p.m. UTC
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@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
---
 src/cam/options.h | 6 ++++++
 1 file changed, 6 insertions(+)

Patch
diff mbox series

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_;