• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenLightingProject / ola / 20179848713

12 Dec 2025 09:04PM UTC coverage: 45.048% (-0.7%) from 45.72%
20179848713

Pull #2026

github

web-flow
Bump actions/download-artifact from 4 to 7

Bumps [actions/download-artifact](https://github.com/actions/download-artifact) from 4 to 7.
- [Release notes](https://github.com/actions/download-artifact/releases)
- [Commits](https://github.com/actions/download-artifact/compare/v4...v7)

---
updated-dependencies:
- dependency-name: actions/download-artifact
  dependency-version: '7'
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Pull Request #2026: Bump actions/download-artifact from 4 to 7

8554 of 19812 branches covered (43.18%)

22094 of 49046 relevant lines covered (45.05%)

49.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

92.16
/common/export_map/ExportMap.cpp
1
/*
2
 * This library is free software; you can redistribute it and/or
3
 * modify it under the terms of the GNU Lesser General Public
4
 * License as published by the Free Software Foundation; either
5
 * version 2.1 of the License, or (at your option) any later version.
6
 *
7
 * This library is distributed in the hope that it will be useful,
8
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
10
 * Lesser General Public License for more details.
11
 *
12
 * You should have received a copy of the GNU Lesser General Public
13
 * License along with this library; if not, write to the Free Software
14
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
15
 *
16
 * ExportMap.cpp
17
 * Exported Variables
18
 * Copyright (C) 2005 Simon Newton
19
 */
20

21
#include <algorithm>
22
#include <string>
23
#include <map>
24
#include <vector>
25
#include <iostream>
26
#include "ola/ExportMap.h"
27
#include "ola/StringUtils.h"
28
#include "ola/stl/STLUtils.h"
29

30
namespace ola {
31

32
using std::map;
33
using std::ostringstream;
34
using std::string;
35
using std::vector;
36

37
ExportMap::~ExportMap() {
26✔
38
  STLDeleteValues(&m_bool_variables);
26✔
39
  STLDeleteValues(&m_counter_variables);
26✔
40
  STLDeleteValues(&m_int_map_variables);
26✔
41
  STLDeleteValues(&m_int_variables);
26✔
42
  STLDeleteValues(&m_str_map_variables);
26✔
43
  STLDeleteValues(&m_string_variables);
26✔
44
  STLDeleteValues(&m_uint_map_variables);
26✔
45
}
26✔
46

47
BoolVariable *ExportMap::GetBoolVar(const string &name) {
16✔
48
  return GetVar(&m_bool_variables, name);
16✔
49
}
50

51
IntegerVariable *ExportMap::GetIntegerVar(const string &name) {
205✔
52
  return GetVar(&m_int_variables, name);
205✔
53
}
54

55
CounterVariable *ExportMap::GetCounterVar(const string &name) {
42✔
56
  return GetVar(&m_counter_variables, name);
42✔
57
}
58

59
StringVariable *ExportMap::GetStringVar(const string &name) {
3✔
60
  return GetVar(&m_string_variables, name);
3✔
61
}
62

63

64
/*
65
 * Lookup or create a string map variable
66
 * @param name the name of the variable
67
 * @param label the label to use for the map (optional)
68
 * @return a MapVariable
69
 */
70
StringMap *ExportMap::GetStringMapVar(const string &name, const string &label) {
4✔
71
  return GetMapVar(&m_str_map_variables, name, label);
4✔
72
}
73

74

75
/*
76
 * Lookup or create an int map variable
77
 * @param name the name of the variable
78
 * @param label the label to use for the map (optional)
79
 * @return a MapVariable
80
 */
81
IntMap *ExportMap::GetIntMapVar(const string &name, const string &label) {
×
82
  return GetMapVar(&m_int_map_variables, name, label);
×
83
}
84

85

86
/*
87
 * Lookup or create an unsigned int map variable
88
 * @param name the name of the variable
89
 * @param label the label to use for the map (optional)
90
 * @return a MapVariable
91
 */
92
UIntMap *ExportMap::GetUIntMapVar(const string &name, const string &label) {
19✔
93
  return GetMapVar(&m_uint_map_variables, name, label);
19✔
94
}
95

96

97
/*
98
 * Return a list of all variables.
99
 * @return a vector of all variables.
100
 */
101
vector<BaseVariable*> ExportMap::AllVariables() const {
1✔
102
  vector<BaseVariable*> variables;
1✔
103
  STLValues(m_bool_variables, &variables);
1✔
104
  STLValues(m_counter_variables, &variables);
1✔
105
  STLValues(m_int_map_variables, &variables);
1✔
106
  STLValues(m_int_variables, &variables);
1✔
107
  STLValues(m_str_map_variables, &variables);
1✔
108
  STLValues(m_string_variables, &variables);
1✔
109
  STLValues(m_uint_map_variables, &variables);
1✔
110

111
  sort(variables.begin(), variables.end(), VariableLessThan());
1✔
112
  return variables;
1✔
113
}
×
114

115

116
template<typename Type>
117
Type *ExportMap::GetVar(map<string, Type*> *var_map, const string &name) {
16✔
118
  typename map<string, Type*>::iterator iter;
16✔
119
  iter = var_map->find(name);
16✔
120

121
  if (iter == var_map->end()) {
16✔
122
    Type *var = new Type(name);
16✔
123
    (*var_map)[name] = var;
16✔
124
    return var;
16✔
125
  }
126
  return iter->second;
×
127
}
128

129

130
template<typename Type>
131
Type *ExportMap::GetMapVar(map<string, Type*> *var_map,
4!
132
                           const string &name,
133
                           const string &label) {
134
  typename map<string, Type*>::iterator iter;
4!
135
  iter = var_map->find(name);
4!
136

137
  if (iter == var_map->end()) {
4!
138
    Type *var = new Type(name, label);
3!
139
    (*var_map)[name] = var;
3✔
140
    return var;
3✔
141
  }
142
  return iter->second;
1✔
143
}
144
}  // namespace ola
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc