diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-06-28 01:02:27 +0300 |
---|---|---|
committer | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-07-12 19:59:19 +0300 |
commit | a81ccba6a20f57dc05e85de3713a413aa331656e (patch) | |
tree | 9c902c493ca2c7f38e10193f29480c98e6368dee /LICENSES/GPL-2.0.txt | |
parent | 37e31b2c6b241dff5153025af566ab671b10ff68 (diff) |
libcamera: base: class: Expose Extensible private data to other classes
Despite sharing the same name, the private data class created by the
Extensible design pattern and the C++ private access specifier have
different goals. The latter specifies class members private to the
class, while the former stores data not visible to the application.
There are use cases for accessing the private data class from other
classes inside libcamera. Make this possible by exposing public _d()
functions in the class deriving from Extensible. This won't allow access
to the private data by applications as the definition of the Private
class isn't visible outside of libcamera.
The _d() functions need to be defined as template functions to delay
their evaluation, as the static_cast() operator in the Extensible::_d()
functions needs the Private class to be fully defined. The template
argument is defaulted and ignored, as only its presence is required to
delay evaluation.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Jacopo Mondi <jacopo@jmondi.org>
Reviewed-by: Umang Jain <umang.jain@ideasonboard.com>
Reviewed-by: Hirokazu Honda <hiroh@chromium.org>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'LICENSES/GPL-2.0.txt')
0 files changed, 0 insertions, 0 deletions