Public Member Functions | Private Attributes | List of all members
PLMD::GridBase::AcceleratorHandler Class Reference

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...
 
AcceleratorBaseoperator-> ()
 Enable access to methods of AcceleratorBase. More...
 
const AcceleratorBaseoperator-> () const
 Enable access to methods of AcceleratorBase. More...
 
AcceleratorHandleroperator= (const AcceleratorHandler &other)
 Move assignment. More...
 

Private Attributes

std::unique_ptr< AcceleratorBaseptr
 This is the underlying pointer. More...
 

Detailed Description

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.

Warning
Interface might change at any time. Do not use this outside of class GridBase and children.

Constructor & Destructor Documentation

◆ AcceleratorHandler() [1/3]

PLMD::GridBase::AcceleratorHandler::AcceleratorHandler ( const AcceleratorHandler other)
inline

Move constructor.

◆ AcceleratorHandler() [2/3]

PLMD::GridBase::AcceleratorHandler::AcceleratorHandler ( )
default

Constructor without arguments result in a non-usable accelerator (dimension is unspecified)

◆ AcceleratorHandler() [3/3]

PLMD::GridBase::AcceleratorHandler::AcceleratorHandler ( unsigned  dimension)
inline

Constructor with an argument creates an accelerator with a fixed dimensionality.

Member Function Documentation

◆ operator bool()

PLMD::GridBase::AcceleratorHandler::operator bool ( ) const
inlineexplicitnoexcept

Conversion to bool allows to check if the ptr has been set.

◆ operator->() [1/2]

AcceleratorBase* PLMD::GridBase::AcceleratorHandler::operator-> ( )
inline

Enable access to methods of AcceleratorBase.

◆ operator->() [2/2]

const AcceleratorBase* PLMD::GridBase::AcceleratorHandler::operator-> ( ) const
inline

Enable access to methods of AcceleratorBase.

◆ operator=()

AcceleratorHandler& PLMD::GridBase::AcceleratorHandler::operator= ( const AcceleratorHandler other)
inline

Move assignment.

Member Data Documentation

◆ ptr

std::unique_ptr<AcceleratorBase> PLMD::GridBase::AcceleratorHandler::ptr
private

This is the underlying pointer.


The documentation for this class was generated from the following file: