GDAL
gdalplugindriverproxy.h
1/******************************************************************************
2 *
3 * Name: gdalplugindriverproxy.h
4 * Project: GDAL Core
5 * Purpose: GDAL Core C++/Private declarations.
6 * Author: Even Rouault <even dot rouault at spatialys.com>
7 *
8 ******************************************************************************
9 * Copyright (c) 2024, Even Rouault <even dot rouault at spatialys.com>
10 *
11 * SPDX-License-Identifier: MIT
12 ****************************************************************************/
13
14#ifndef GDALPLUGINDRIVERPROXY_H_INCLUDED
15#define GDALPLUGINDRIVERPROXY_H_INCLUDED
16
17#include "cpl_port.h"
18#include "gdal_driver.h"
19
20#include <set>
21
22/************************************************************************/
23/* GDALPluginDriverProxy */
24/************************************************************************/
25
26// clang-format off
64// clang-format on
65
66class GDALPluginDriverProxy final : public GDALDriver
67{
68 const std::string m_osPluginFileName;
69 std::string m_osPluginFullPath{};
70 std::unique_ptr<GDALDriver> m_poRealDriver{};
71 std::set<std::string> m_oSetMetadataItems{};
72
73 GDALDriver *GetRealDriver();
74
76
77 protected:
78 friend class GDALDriverManager;
79
81 void SetPluginFullPath(const std::string &osFullPath)
82 {
83 m_osPluginFullPath = osFullPath;
84 }
85
87
88 public:
89 explicit GDALPluginDriverProxy(const std::string &osPluginFileName);
90
92 const std::string &GetPluginFileName() const
93 {
94 return m_osPluginFileName;
95 }
96
98 OpenCallback GetOpenCallback() override;
99
100 CreateCallback GetCreateCallback() override;
101
102 CreateMultiDimensionalCallback GetCreateMultiDimensionalCallback() override;
103
104 CreateCopyCallback GetCreateCopyCallback() override;
105
106 DeleteCallback GetDeleteCallback() override;
107
108 RenameCallback GetRenameCallback() override;
109
110 CopyFilesCallback GetCopyFilesCallback() override;
111
112 InstantiateAlgorithmCallback GetInstantiateAlgorithmCallback() override;
114
115 CPLErr SetMetadataItem(const char *pszName, const char *pszValue,
116 const char *pszDomain = "") override;
117
118 char **GetMetadata(const char *pszDomain) override;
119
120 const char *GetMetadataItem(const char *pszName,
121 const char *pszDomain = "") override;
122};
123
124#endif
const char * GetMetadataItem(const char *pszName, const char *pszDomain="") override
Fetch single metadata item.
Definition gdaldrivermanager.cpp:1372
char ** GetMetadata(const char *pszDomain) override
Fetch metadata.
Definition gdaldrivermanager.cpp:1328
GDALPluginDriverProxy(const std::string &osPluginFileName)
Constructor for a plugin driver proxy.
Definition gdaldrivermanager.cpp:1299
const std::string & GetPluginFileName() const
Return the plugin file name (not a full path).
Definition gdalplugindriverproxy.h:92
CPLErr SetMetadataItem(const char *pszName, const char *pszValue, const char *pszDomain="") override
Set single metadata item.
Definition gdaldrivermanager.cpp:1336
CPLErr
Error category.
Definition cpl_error.h:37
Core portability definitions for CPL.
#define CPL_DISALLOW_COPY_ASSIGN(ClassName)
Helper to remove the copy and assignment constructors so that the compiler will not generate the defa...
Definition cpl_port.h:936