Coverage Report

Created: 2026-10-13 07:22

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/PROJ/src/iso19111/operation/vectorofvaluesparams.cpp
Line
Count
Source
1
/******************************************************************************
2
 *
3
 * Project:  PROJ
4
 * Purpose:  ISO19111:2019 implementation
5
 * Author:   Even Rouault <even dot rouault at spatialys dot com>
6
 *
7
 ******************************************************************************
8
 * Copyright (c) 2018, Even Rouault <even dot rouault at spatialys dot com>
9
 *
10
 * Permission is hereby granted, free of charge, to any person obtaining a
11
 * copy of this software and associated documentation files (the "Software"),
12
 * to deal in the Software without restriction, including without limitation
13
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14
 * and/or sell copies of the Software, and to permit persons to whom the
15
 * Software is furnished to do so, subject to the following conditions:
16
 *
17
 * The above copyright notice and this permission notice shall be included
18
 * in all copies or substantial portions of the Software.
19
 *
20
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23
 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
24
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
25
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
26
 * DEALINGS IN THE SOFTWARE.
27
 ****************************************************************************/
28
29
#include "vectorofvaluesparams.hpp"
30
31
// ---------------------------------------------------------------------------
32
33
NS_PROJ_START
34
namespace operation {
35
36
// ---------------------------------------------------------------------------
37
38
//! @cond Doxygen_Suppress
39
40
static std::vector<ParameterValueNNPtr> buildParameterValueFromMeasure(
41
78.4k
    const std::initializer_list<common::Measure> &list) {
42
78.4k
    std::vector<ParameterValueNNPtr> res;
43
203k
    for (const auto &v : list) {
44
203k
        res.emplace_back(ParameterValue::create(v));
45
203k
    }
46
78.4k
    return res;
47
78.4k
}
48
49
VectorOfValues::VectorOfValues(std::initializer_list<common::Measure> list)
50
78.4k
    : std::vector<ParameterValueNNPtr>(buildParameterValueFromMeasure(list)) {}
51
52
// This way, we disable inlining of destruction, and save a lot of space
53
289k
VectorOfValues::~VectorOfValues() = default;
54
55
VectorOfValues createParams(const common::Measure &m1,
56
                            const common::Measure &m2,
57
89.7k
                            const common::Measure &m3) {
58
89.7k
    return VectorOfValues{ParameterValue::create(m1),
59
89.7k
                          ParameterValue::create(m2),
60
89.7k
                          ParameterValue::create(m3)};
61
89.7k
}
62
63
VectorOfValues createParams(const common::Measure &m1,
64
                            const common::Measure &m2,
65
                            const common::Measure &m3,
66
33
                            const common::Measure &m4) {
67
33
    return VectorOfValues{
68
33
        ParameterValue::create(m1), ParameterValue::create(m2),
69
33
        ParameterValue::create(m3), ParameterValue::create(m4)};
70
33
}
71
72
VectorOfValues createParams(const common::Measure &m1,
73
                            const common::Measure &m2,
74
                            const common::Measure &m3,
75
                            const common::Measure &m4,
76
52
                            const common::Measure &m5) {
77
52
    return VectorOfValues{
78
52
        ParameterValue::create(m1), ParameterValue::create(m2),
79
52
        ParameterValue::create(m3), ParameterValue::create(m4),
80
52
        ParameterValue::create(m5),
81
52
    };
82
52
}
83
84
VectorOfValues
85
createParams(const common::Measure &m1, const common::Measure &m2,
86
             const common::Measure &m3, const common::Measure &m4,
87
0
             const common::Measure &m5, const common::Measure &m6) {
88
0
    return VectorOfValues{
89
0
        ParameterValue::create(m1), ParameterValue::create(m2),
90
0
        ParameterValue::create(m3), ParameterValue::create(m4),
91
0
        ParameterValue::create(m5), ParameterValue::create(m6),
92
0
    };
93
0
}
94
95
VectorOfValues
96
createParams(const common::Measure &m1, const common::Measure &m2,
97
             const common::Measure &m3, const common::Measure &m4,
98
             const common::Measure &m5, const common::Measure &m6,
99
93
             const common::Measure &m7) {
100
93
    return VectorOfValues{
101
93
        ParameterValue::create(m1), ParameterValue::create(m2),
102
93
        ParameterValue::create(m3), ParameterValue::create(m4),
103
93
        ParameterValue::create(m5), ParameterValue::create(m6),
104
93
        ParameterValue::create(m7),
105
93
    };
106
93
}
107
108
// This way, we disable inlining of destruction, and save a lot of space
109
289k
VectorOfParameters::~VectorOfParameters() = default;
110
111
//! @endcond
112
113
// ---------------------------------------------------------------------------
114
115
} // namespace operation
116
NS_PROJ_END