version GIT relicensing-7278-g091132d5eb 2026-12-02 03:10:01+00:00
\(\newcommand{\dealvcentcolon}{\mathrel{\mathop{:}}}\) \(\newcommand{\dealcoloneq}{\dealvcentcolon\mathrel{\mkern-1.2mu}=}\) \(\newcommand{\jump}[1]{\left[\!\left[ #1 \right]\!\right]}\) \(\newcommand{\average}[1]{\left\{\!\left\{ #1 \right\}\!\right\}}\)
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
SUNDIALS::internal::SundialsHandle< Traits > Class Template Reference

#include <deal.II/sundials/sundials_handle.h>

Detailed Description

template<typename Traits>
class SUNDIALS::internal::SundialsHandle< Traits >

An owning handle for a C object created by SUNDIALS, for example a SUNLinearSolver or a SUNNonlinearSolver. The object is freed in the destructor by the function provided by the Traits class, which has to satisfy the SundialsTraits concept (when compiling with C++20).

The handle takes ownership of the object passed to the constructor, so any SUNDIALS creation function can be used:

SundialsLinearSolver solver(SUNLinSol_PCG(y, SUN_PREC_NONE, 0, ctx));

The handle can be moved but not copied.

Template Parameters
TraitsA class that defines the type Handle (the SUNDIALS pointer type) and the static function free(Handle) that releases the object. See SundialsTraits.

Definition at line 71 of file sundials_handle.h.

Public Types

using Handle = typename Traits::Handle
 

Public Member Functions

 SundialsHandle (Handle handle)
 
 ~SundialsHandle ()
 
 SundialsHandle (const SundialsHandle &)=delete
 
SundialsHandle & operator= (const SundialsHandle &)=delete
 
 SundialsHandle (SundialsHandle &&other) noexcept
 
SundialsHandle & operator= (SundialsHandle &&other) noexcept
 
 operator Handle () const
 

Private Member Functions

void reset () noexcept
 

Private Attributes

Handle handle
 

Member Typedef Documentation

◆ Handle

template<typename Traits >
using SUNDIALS::internal::SundialsHandle< Traits >::Handle = typename Traits::Handle

Definition at line 74 of file sundials_handle.h.

Constructor & Destructor Documentation

◆ SundialsHandle() [1/3]

template<typename Traits >
SUNDIALS::internal::SundialsHandle< Traits >::SundialsHandle ( Handle  handle)
inlineexplicit

Constructor. Takes ownership of handle, which must not be null (SUNDIALS returns null if the creation of an object fails).

Definition at line 80 of file sundials_handle.h.

◆ ~SundialsHandle()

template<typename Traits >
SUNDIALS::internal::SundialsHandle< Traits >::~SundialsHandle ( )
inline

Definition at line 87 of file sundials_handle.h.

◆ SundialsHandle() [2/3]

template<typename Traits >
SUNDIALS::internal::SundialsHandle< Traits >::SundialsHandle ( const SundialsHandle< Traits > &  )
delete

◆ SundialsHandle() [3/3]

template<typename Traits >
SUNDIALS::internal::SundialsHandle< Traits >::SundialsHandle ( SundialsHandle< Traits > &&  other)
inlinenoexcept

Definition at line 96 of file sundials_handle.h.

Member Function Documentation

◆ operator=() [1/2]

template<typename Traits >
SundialsHandle & SUNDIALS::internal::SundialsHandle< Traits >::operator= ( const SundialsHandle< Traits > &  )
delete

◆ operator=() [2/2]

template<typename Traits >
SundialsHandle & SUNDIALS::internal::SundialsHandle< Traits >::operator= ( SundialsHandle< Traits > &&  other)
inlinenoexcept

Definition at line 101 of file sundials_handle.h.

◆ operator Handle()

template<typename Traits >
SUNDIALS::internal::SundialsHandle< Traits >::operator Handle ( ) const
inline

Implicit conversion to the SUNDIALS pointer. The handle keeps the ownership.

Definition at line 115 of file sundials_handle.h.

◆ reset()

template<typename Traits >
void SUNDIALS::internal::SundialsHandle< Traits >::reset ( )
inlineprivatenoexcept

Definition at line 122 of file sundials_handle.h.

Member Data Documentation

◆ handle

template<typename Traits >
Handle SUNDIALS::internal::SundialsHandle< Traits >::handle
private

Definition at line 131 of file sundials_handle.h.


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