Coverage Report

Created: 2025-06-13 06:29

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