mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-21 03:15:06 +03:00
libcamera: Drop argument from LIBCAMERA_DECLARE_PRIVATE
The LIBCAMERA_DECLARE_PRIVATE() macro, used by the library classes that inherit from libcamera::Extensible in order to implement the PIMPL pattern, expands to: public: \ class Private; \ friend class Private; The 'klass' argument is not used and it might confuse developers as it might hint that the class that defines the pattern's implementation can be freely named, while it is actually hardcoded to 'Private'. Drop the argument from the macro definition. Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Hanlin Chen <hanlinchen@google.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org>
This commit is contained in:
parent
d40430116b
commit
1fca6228fe
5 changed files with 6 additions and 8 deletions
|
@ -74,7 +74,7 @@ protected:
|
|||
class Camera final : public Object, public std::enable_shared_from_this<Camera>,
|
||||
public Extensible
|
||||
{
|
||||
LIBCAMERA_DECLARE_PRIVATE(Camera)
|
||||
LIBCAMERA_DECLARE_PRIVATE()
|
||||
|
||||
public:
|
||||
static std::shared_ptr<Camera> create(PipelineHandler *pipe,
|
||||
|
|
|
@ -22,7 +22,7 @@ class Camera;
|
|||
|
||||
class CameraManager : public Object, public Extensible
|
||||
{
|
||||
LIBCAMERA_DECLARE_PRIVATE(CameraManager)
|
||||
LIBCAMERA_DECLARE_PRIVATE()
|
||||
public:
|
||||
CameraManager();
|
||||
~CameraManager();
|
||||
|
|
|
@ -30,7 +30,7 @@ namespace libcamera {
|
|||
#endif
|
||||
|
||||
#ifndef __DOXYGEN__
|
||||
#define LIBCAMERA_DECLARE_PRIVATE(klass) \
|
||||
#define LIBCAMERA_DECLARE_PRIVATE() \
|
||||
public: \
|
||||
class Private; \
|
||||
friend class Private;
|
||||
|
@ -46,7 +46,7 @@ public: \
|
|||
_o<Public>();
|
||||
|
||||
#else
|
||||
#define LIBCAMERA_DECLARE_PRIVATE(klass)
|
||||
#define LIBCAMERA_DECLARE_PRIVATE()
|
||||
#define LIBCAMERA_DECLARE_PUBLIC(klass)
|
||||
#define LIBCAMERA_D_PTR(klass)
|
||||
#define LIBCAMERA_O_PTR(klass)
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
|
||||
class CameraBuffer final : public libcamera::Extensible
|
||||
{
|
||||
LIBCAMERA_DECLARE_PRIVATE(CameraBuffer)
|
||||
LIBCAMERA_DECLARE_PRIVATE()
|
||||
|
||||
public:
|
||||
CameraBuffer(buffer_handle_t camera3Buffer, int flags);
|
||||
|
|
|
@ -77,12 +77,10 @@ namespace libcamera {
|
|||
/**
|
||||
* \def LIBCAMERA_DECLARE_PRIVATE
|
||||
* \brief Declare private data for a public class
|
||||
* \param klass The public class name
|
||||
*
|
||||
* The LIBCAMERA_DECLARE_PRIVATE() macro plumbs the infrastructure necessary to
|
||||
* make a class manage its private data through a d-pointer. It shall be used at
|
||||
* the very top of the class definition, with the public class name passed as
|
||||
* the \a klass parameter.
|
||||
* the very top of the class definition.
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue