Coverage Report

Created: 2026-07-25 06:50

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/gdal/apps/gdalalg_mdim_compare.h
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  GDAL
4
 * Purpose:  gdal "mdim compare" subcommand
5
 * Author:   Even Rouault <even dot rouault at spatialys.com>
6
 *
7
 ******************************************************************************
8
 * Copyright (c) 2026, Even Rouault <even dot rouault at spatialys.com>
9
 *
10
 * SPDX-License-Identifier: MIT
11
 ****************************************************************************/
12
13
#ifndef GDALALG_MDIM_COMPARE_INCLUDED
14
#define GDALALG_MDIM_COMPARE_INCLUDED
15
16
#include "gdalmdimpipelinestepalgorithm.h"
17
#include "gdalalg_compare_common.h"
18
19
//! @cond Doxygen_Suppress
20
21
class GDALMDArray;
22
23
/************************************************************************/
24
/*                       GDALMdimCompareAlgorithm                       */
25
/************************************************************************/
26
27
class GDALMdimCompareAlgorithm /* non final */
28
    : public GDALMdimPipelineStepAlgorithm,
29
      public GDALCompareCommon
30
{
31
  public:
32
    static constexpr const char *NAME = "compare";
33
    static constexpr const char *DESCRIPTION =
34
        "Compare two multidimensional datasets.";
35
    static constexpr const char *HELP_URL = "/programs/gdal_mdim_compare.html";
36
37
    explicit GDALMdimCompareAlgorithm(bool standaloneStep = false);
38
39
    bool IsNativelyStreamingCompatible() const override
40
0
    {
41
0
        return false;
42
0
    }
43
44
    bool CanBeLastStep() const override
45
0
    {
46
0
        return true;
47
0
    }
48
49
    int GetOutputType() const override
50
0
    {
51
0
        return 0;
52
0
    }
53
54
  private:
55
    bool RunStep(GDALPipelineStepRunContext &ctxt) override;
56
57
    void CompareArray(std::vector<std::string> &aosReport,
58
                      const std::shared_ptr<GDALMDArray> &poRefArray,
59
                      const std::shared_ptr<GDALMDArray> &poInputArray,
60
                      GDALProgressFunc pfnProgress, void *pProgressData);
61
};
62
63
/************************************************************************/
64
/*                  GDALMdimCompareAlgorithmStandalone                  */
65
/************************************************************************/
66
67
class GDALMdimCompareAlgorithmStandalone final : public GDALMdimCompareAlgorithm
68
{
69
  public:
70
    GDALMdimCompareAlgorithmStandalone()
71
0
        : GDALMdimCompareAlgorithm(/* standaloneStep = */ true)
72
0
    {
73
0
    }
74
75
    ~GDALMdimCompareAlgorithmStandalone() override;
76
};
77
78
//! @endcond
79
80
#endif