Coverage Report

Created: 2026-06-09 07:13

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
56.5k
    const std::initializer_list<common::Measure> &list) {
42
56.5k
    std::vector<ParameterValueNNPtr> res;
43
145k
    for (const auto &v : list) {
44
145k
        res.emplace_back(ParameterValue::create(v));
45
145k
    }
46
56.5k
    return res;
47
56.5k
}
48
49
VectorOfValues::VectorOfValues(std::initializer_list<common::Measure> list)
50
56.5k
    : std::vector<ParameterValueNNPtr>(buildParameterValueFromMeasure(list)) {}
51
52
// This way, we disable inlining of destruction, and save a lot of space
53
247k
VectorOfValues::~VectorOfValues() = default;
54
55
VectorOfValues createParams(const common::Measure &m1,
56
                            const common::Measure &m2,
57
71.1k
                            const common::Measure &m3) {
58
71.1k
    return VectorOfValues{ParameterValue::create(m1),
59
71.1k
                          ParameterValue::create(m2),
60
71.1k
                          ParameterValue::create(m3)};
61
71.1k
}
62
63
VectorOfValues createParams(const common::Measure &m1,
64
                            const common::Measure &m2,
65
                            const common::Measure &m3,
66
30
                            const common::Measure &m4) {
67
30
    return VectorOfValues{
68
30
        ParameterValue::create(m1), ParameterValue::create(m2),
69
30
        ParameterValue::create(m3), ParameterValue::create(m4)};
70
30
}
71
72
VectorOfValues createParams(const common::Measure &m1,
73
                            const common::Measure &m2,
74
                            const common::Measure &m3,
75
                            const common::Measure &m4,
76
58
                            const common::Measure &m5) {
77
58
    return VectorOfValues{
78
58
        ParameterValue::create(m1), ParameterValue::create(m2),
79
58
        ParameterValue::create(m3), ParameterValue::create(m4),
80
58
        ParameterValue::create(m5),
81
58
    };
82
58
}
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
82
             const common::Measure &m7) {
100
82
    return VectorOfValues{
101
82
        ParameterValue::create(m1), ParameterValue::create(m2),
102
82
        ParameterValue::create(m3), ParameterValue::create(m4),
103
82
        ParameterValue::create(m5), ParameterValue::create(m6),
104
82
        ParameterValue::create(m7),
105
82
    };
106
82
}
107
108
// This way, we disable inlining of destruction, and save a lot of space
109
247k
VectorOfParameters::~VectorOfParameters() = default;
110
111
//! @endcond
112
113
// ---------------------------------------------------------------------------
114
115
} // namespace operation
116
NS_PROJ_END