GDAL
GDALArgDatasetValue Class Reference

Value for an argument that points to a GDALDataset. More...

#include <gdalalgorithm_cpp.h>

Public Member Functions

 GDALArgDatasetValue ()=default
 Default (empty) constructor.
 GDALArgDatasetValue (const std::string &name)
 Constructor by dataset name.
 GDALArgDatasetValue (GDALDataset *poDS)
 Constructor by dataset instance, increasing its reference counter.
 GDALArgDatasetValue (GDALArgDatasetValue &&other)
 Move constructor.
 ~GDALArgDatasetValue ()
 Destructor.
bool Close ()
 Dereference the dataset object and close it if no longer referenced.
GDALArgDatasetValueoperator= (GDALArgDatasetValue &&other)
 Move-assignment operator.
GDALDatasetGetDatasetIncreaseRefCount ()
 Get the GDALDataset* instance (may be null), and increase its reference count if not null.
GDALDatasetGetDatasetRef ()
 Get a GDALDataset* instance (may be null).
const GDALDatasetGetDatasetRef () const
 Get a GDALDataset* instance (may be null).
GDALDatasetBorrowDataset ()
 Borrow the GDALDataset* instance (may be null), leaving its reference counter unchanged.
void BorrowDatasetFrom (GDALArgDatasetValue &other)
 Borrow the GDALDataset* instance from another GDALArgDatasetValue, leaving its reference counter unchanged.
const std::string & GetName () const
 Get dataset name.
bool IsNameSet () const
 Return whether a dataset name has been set.
void Set (const std::string &name)
 Set dataset name.
void Set (std::unique_ptr< GDALDataset > poDS)
 Transfer dataset to this instance (does not affect its reference counter).
void Set (GDALDataset *poDS)
 Set dataset object, increasing its reference counter.
void SetFrom (const GDALArgDatasetValue &other)
 Set from other value, increasing the reference counter of the GDALDataset object.
void SetDatasetOpenedByAlgorithm ()
 Set that the dataset has been opened by the algorithm.
bool HasDatasetBeenOpenedByAlgorithm () const
 Whether the dataset has been opened by the algorithm.

Protected Member Functions

void SetOwnerArgument (GDALAlgorithmArg *arg)
 Set the argument that owns us.

Friends

class GDALAlgorithm

Detailed Description

Value for an argument that points to a GDALDataset.

This is the value of arguments of type GAAT_DATASET or GAAT_DATASET_LIST.

Constructor & Destructor Documentation

◆ ~GDALArgDatasetValue()

GDALArgDatasetValue::~GDALArgDatasetValue ( )

Destructor.

Decrease m_poDS reference count, and destroy it if no longer referenced.

Member Function Documentation

◆ Close()

bool GDALArgDatasetValue::Close ( )

Dereference the dataset object and close it if no longer referenced.

Return an error if an error occurred during dataset closing.

◆ GetDatasetIncreaseRefCount()

GDALDataset * GDALArgDatasetValue::GetDatasetIncreaseRefCount ( )

Get the GDALDataset* instance (may be null), and increase its reference count if not null.

Once done with the dataset, the caller should call GDALDataset::Release().

◆ GetDatasetRef() [1/2]

GDALDataset * GDALArgDatasetValue::GetDatasetRef ( )
inline

Get a GDALDataset* instance (may be null).

This does not modify the reference counter, hence the lifetime of the returned object is not guaranteed to exceed the one of this instance.

◆ GetDatasetRef() [2/2]

const GDALDataset * GDALArgDatasetValue::GetDatasetRef ( ) const
inline

Get a GDALDataset* instance (may be null).

This does not modify the reference counter, hence the lifetime of the returned object is not guaranteed to exceed the one of this instance.


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