GDAL

Public Member Functions | List of all members
CPLAutoClose< _Ty, _Dx > Class Template Reference

The class use the destructor to automatically close the resource. More...

`#include <cpl_auto_close.h>`

## Public Member Functions
| CPLAutoClose (_Ty &ptr, _Dx dt)
| Constructor. More...
| ~CPLAutoClose ()
| Destructor.

## Detailed Description

### template<typename _Ty, typename _Dx>
class CPLAutoClose< _Ty, _Dx >

The class use the destructor to automatically close the resource.

Example: GDALDatasetH hDset = GDALOpen(path,GA_ReadOnly); CPLAutoClose<GDALDatasetH,void(*)(void*)> autoclosehDset(hDset,GDALClose); Or: GDALDatasetH hDset = GDALOpen(path,GA_ReadOnly); CPL_AUTO_CLOSE_WARP(hDset,GDALClose);

## Constructor & Destructor Documentation

## ◆ CPLAutoClose()

template<typename _Ty , typename _Dx >

CPLAutoClose< _Ty, _Dx >::CPLAutoClose | ( | _Ty & | ptr,
|  | _Dx | dt
| ) |  |
| inline explicit

Constructor.

Parameters

  ptr | Pointer to the resource object.
  dt | Resource release(close) function.

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

- cpl_auto_close.h