pImpl
pImpl Idiom in C++
Loading...
Searching...
No Matches
PimplClass::Private

The PimplClass::Private class. More...

#include <pImpl_p.h>

Collaboration diagram for PimplClass::Private:

Public Member Functions

 Private (PimplClass *q=nullptr)
 Construct a new Private object.
 
virtual ~Private ()=default
 Destroy the Private object.
 

Public Attributes

PimplClass *const q_ptr
 q-ptr that points to the API class
 

Detailed Description

The PimplClass::Private class.

This class is the private class of the PimplClass class, it is used to hide the implementation of the PimplClass class. Only the PimplClass class and childrens can access it.

Note
This class is not copyable because it contains a const pointer which therefore cannot be assigned after calling the constructor.

Definition at line 19 of file pImpl_p.h.

Constructor & Destructor Documentation

◆ Private()

PimplClass::Private::Private ( PimplClass q = nullptr)
inline

Construct a new Private object.

Constructor that initializes the q-ptr

Parameters
qpointer to the API class, if not specified, the q-ptr will not be used

Definition at line 27 of file pImpl_p.h.

◆ ~Private()

virtual PimplClass::Private::~Private ( )
virtualdefault

Destroy the Private object.

virtual destructor to allow the destruction of the private class from the API class

Member Data Documentation

◆ q_ptr

PimplClass* const PimplClass::Private::q_ptr

q-ptr that points to the API class

Definition at line 39 of file pImpl_p.h.