Auxiliary class for managing AcceleratorBase. More...
#include <Grid.h>
Public Member Functions | |
AcceleratorHandler ()=default | |
Constructor without arguments result in a non-usable accelerator (dimension is unspecified) More... | |
AcceleratorHandler (const AcceleratorHandler &other) | |
Move constructor. More... | |
AcceleratorHandler (unsigned dimension) | |
Constructor with an argument creates an accelerator with a fixed dimensionality. More... | |
operator bool () const noexcept | |
Conversion to bool allows to check if the ptr has been set. More... | |
AcceleratorBase * | operator-> () |
Enable access to methods of AcceleratorBase. More... | |
const AcceleratorBase * | operator-> () const |
Enable access to methods of AcceleratorBase. More... | |
AcceleratorHandler & | operator= (const AcceleratorHandler &other) |
Move assignment. More... | |
Private Attributes | |
std::unique_ptr< AcceleratorBase > | ptr |
This is the underlying pointer. More... | |
Auxiliary class for managing AcceleratorBase.
class GridBase should contain a std::unique_ptr<AcceleratorBase>, which can be used to access the specialized versions. However, this would make a GridBase object not copyable. Instead of redefining copy constructor and copy assignment for GridBase, which has a lot of members, we use this wrapper class that just manages the lifetime of the underlying Accelerator object.
The underlying object is made accessible through the -> operator, so that one can simply call functions as accelerator->function.
|
inline |
Move constructor.
|
default |
Constructor without arguments result in a non-usable accelerator (dimension is unspecified)
|
inline |
Constructor with an argument creates an accelerator with a fixed dimensionality.
|
inlineexplicitnoexcept |
Conversion to bool allows to check if the ptr has been set.
|
inline |
Enable access to methods of AcceleratorBase.
|
inline |
Enable access to methods of AcceleratorBase.
|
inline |
Move assignment.
|
private |
This is the underlying pointer.
Hosted by GitHub | 1.8.17 |