Gromacs
5.1.4
|
#include <gromacs/utility/classhelpers.h>
Helper class to manage a pointer to a private implementation class.
This helper provides the following benefits (all but the last could also be achieved with boost::scoped_ptr):
Intended use:
Public Member Functions | |
PrivateImplPointer (Impl *ptr) | |
Initialize with the given implementation class. | |
void | reset (Impl *ptr) |
Sets a new implementation class and destructs the previous one. More... | |
Impl * | get () |
Access the raw pointer. | |
Impl * | operator-> () |
Access the implementation class as with a raw pointer. | |
Impl & | operator* () |
Access the implementation class as with a raw pointer. | |
const Impl * | get () const |
Access the raw pointer. | |
const Impl * | operator-> () const |
Access the implementation class as with a raw pointer. | |
const Impl & | operator* () const |
Access the implementation class as with a raw pointer. | |
|
inline |
Sets a new implementation class and destructs the previous one.
Needed, e.g., to implement assignable classes.