INSTINCT Code Coverage Report


Directory: src/
File: NodeRegistry.cpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 147 191 77.0%
Functions: 81 83 97.6%
Branches: 173 518 33.4%

Line Branch Exec Source
1 // This file is part of INSTINCT, the INS Toolkit for Integrated
2 // Navigation Concepts and Training by the Institute of Navigation of
3 // the University of Stuttgart, Germany.
4 //
5 // This Source Code Form is subject to the terms of the Mozilla Public
6 // License, v. 2.0. If a copy of the MPL was not distributed with this
7 // file, You can obtain one at https://mozilla.org/MPL/2.0/.
8
9 #include "NodeRegistry.hpp"
10
11 #include "util/Logger.hpp"
12
13 #include "internal/Node/Node.hpp"
14 #include "NodeData/NodeData.hpp"
15
16 #include <string>
17
18 /* -------------------------------------------------------------------------------------------------------- */
19 /* Private Members */
20 /* -------------------------------------------------------------------------------------------------------- */
21
22 namespace NAV::NodeRegistry
23 {
24 namespace
25 {
26
27 /// List of all registered nodes.
28 /// Key: category, Value: Nodes
29 std::map<std::string, std::vector<NodeInfo>> _registeredNodes;
30
31 /// List of all registered node data types.
32 /// Key: NodeData.type(), Value: parentTypes()
33 std::map<std::string, std::vector<std::string>> _registeredNodeDataTypes;
34
35 /* -------------------------------------------------------------------------------------------------------- */
36 /* Private Function Declarations */
37 /* -------------------------------------------------------------------------------------------------------- */
38
39 /// @brief Registers a Node with the NodeManager
40 /// @tparam T Node Class to register
41 template<std::derived_from<Node> T>
42 12096 void registerNodeType()
43 {
44 12096 NodeInfo info;
45 12442 info.constructor = []() { return new T(); }; // NOLINT(cppcoreguidelines-owning-memory)
46
1/2
✓ Branch 1 taken 6048 times.
✗ Branch 2 not taken.
12096 info.type = T::typeStatic();
47
48
1/2
✓ Branch 1 taken 6048 times.
✗ Branch 2 not taken.
12096 T obj;
49
2/2
✓ Branch 5 taken 5040 times.
✓ Branch 6 taken 6048 times.
22176 for (const InputPin& pin : obj.inputPins)
50 {
51
1/2
✓ Branch 1 taken 5040 times.
✗ Branch 2 not taken.
10080 info.pinInfoList.emplace_back(pin.kind, pin.type, pin.dataIdentifier);
52 }
53
2/2
✓ Branch 5 taken 7056 times.
✓ Branch 6 taken 6048 times.
26208 for (const OutputPin& pin : obj.outputPins)
54 {
55
1/2
✓ Branch 1 taken 7056 times.
✗ Branch 2 not taken.
14112 info.pinInfoList.emplace_back(pin.kind, pin.type, pin.dataIdentifier);
56 }
57
58
3/6
✓ Branch 1 taken 6048 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 6048 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 6048 times.
✗ Branch 8 not taken.
12096 _registeredNodes[T::category()].push_back(info);
59 12096 }
60
61 /// @brief Register a NodeData with the NodeManager
62 /// @tparam T NodeData Class to register
63 template<std::derived_from<NodeData> T>
64 4480 void registerNodeDataType()
65 {
66
5/8
✓ Branch 1 taken 2128 times.
✓ Branch 2 taken 112 times.
✗ Branch 3 not taken.
✓ Branch 4 taken 2128 times.
✓ Branch 5 taken 112 times.
✗ Branch 6 not taken.
✓ Branch 7 taken 2128 times.
✗ Branch 8 not taken.
4480 _registeredNodeDataTypes[T::type()] = T::parentTypes();
67 4480 }
68
69 } // namespace
70 } // namespace NAV::NodeRegistry
71
72 /* -------------------------------------------------------------------------------------------------------- */
73 /* Function Definitions */
74 /* -------------------------------------------------------------------------------------------------------- */
75
76 bool NAV::NodeRegistry::NodeInfo::hasCompatiblePin(const Pin* pin) const
77 {
78 if (pin == nullptr)
79 {
80 return true;
81 }
82
83 Pin::Kind searchPinKind = pin->kind == Pin::Kind::Input ? Pin::Kind::Output : Pin::Kind::Input;
84 for (const auto& pinInfo : this->pinInfoList)
85 {
86 const std::vector<std::string>& startPinDataIdentifier = pin->kind == Pin::Kind::Input ? pinInfo.dataIdentifier : pin->dataIdentifier;
87 const std::vector<std::string>& endPinDataIdentifier = pin->kind == Pin::Kind::Input ? pin->dataIdentifier : pinInfo.dataIdentifier;
88 const std::string& startPinParentNodeType = pin->kind == Pin::Kind::Input ? this->type : pin->parentNode->type();
89
90 if (pinInfo.kind == searchPinKind && pinInfo.type == pin->type)
91 {
92 if ((pinInfo.type == Pin::Type::Flow
93 && NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(startPinDataIdentifier, endPinDataIdentifier))
94 || (pinInfo.type == Pin::Type::Delegate
95 && std::ranges::find(endPinDataIdentifier, startPinParentNodeType) != endPinDataIdentifier.end())
96 || ((pinInfo.type == Pin::Type::Object || pinInfo.type == Pin::Type::Matrix) // NOLINT(misc-redundant-expression) - false positive warning
97 && Pin::dataIdentifierHaveCommon(startPinDataIdentifier, endPinDataIdentifier))
98 || pinInfo.type == Pin::Type::Bool || pinInfo.type == Pin::Type::Int || pinInfo.type == Pin::Type::Float || pinInfo.type == Pin::Type::String)
99 {
100 return true;
101 }
102 }
103 }
104
105 return false;
106 }
107
108 346 const std::map<std::string, std::vector<NAV::NodeRegistry::NodeInfo>>& NAV::NodeRegistry::RegisteredNodes()
109 {
110 346 return _registeredNodes;
111 }
112
113 66359244 bool NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(const std::vector<std::string>& childTypes, const std::vector<std::string>& parentTypes)
114 {
115
2/2
✓ Branch 5 taken 66352274 times.
✓ Branch 6 taken 65719664 times.
132070861 for (const auto& childType : childTypes)
116 {
117
2/2
✓ Branch 5 taken 66361180 times.
✓ Branch 6 taken 65711617 times.
131851516 for (const auto& parentType : parentTypes)
118 {
119
2/2
✓ Branch 1 taken 642461 times.
✓ Branch 2 taken 65718789 times.
66360237 if (childType == parentType)
120 {
121 643383 return true;
122 }
123
2/2
✓ Branch 7 taken 1313286549 times.
✓ Branch 8 taken 65492780 times.
1378969980 for (const auto& [dataType, parentTypes] : _registeredNodeDataTypes)
124 {
125
2/2
✓ Branch 1 taken 65719978 times.
✓ Branch 2 taken 1247532426 times.
1312709353 if (dataType == childType)
126 {
127
2/2
✓ Branch 5 taken 60111283 times.
✓ Branch 6 taken 65718765 times.
125837330 for (const auto& parentTypeOfChild : parentTypes)
128 {
129
9/16
✓ Branch 1 taken 60120459 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 60120269 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 60122460 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 60121874 times.
✓ Branch 11 taken 60119527 times.
✓ Branch 14 taken 60119993 times.
✓ Branch 15 taken 60118274 times.
✓ Branch 17 taken 922 times.
✓ Branch 18 taken 60117352 times.
✗ Branch 20 not taken.
✗ Branch 21 not taken.
✗ Branch 24 not taken.
✗ Branch 25 not taken.
360717160 if (NodeDataTypeAnyIsChildOf({ parentTypeOfChild }, { parentType }))
130 {
131 922 return true;
132 }
133 }
134 }
135 }
136 }
137 }
138
139 65719664 return false;
140 120241293 }
141
142 12 std::vector<std::string> NAV::NodeRegistry::GetParentNodeDataTypes(const std::string& type)
143 {
144 12 std::vector<std::string> returnTypes;
145
2/4
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 12 times.
✗ Branch 4 not taken.
12 if (_registeredNodeDataTypes.contains(type))
146 {
147
1/2
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
12 const auto& parentTypes = _registeredNodeDataTypes.at(type);
148
149 // Add all the immediate parents
150
2/2
✓ Branch 1 taken 8 times.
✓ Branch 2 taken 4 times.
12 if (!parentTypes.empty())
151 {
152
1/2
✓ Branch 5 taken 8 times.
✗ Branch 6 not taken.
8 returnTypes.insert(returnTypes.end(), parentTypes.begin(), parentTypes.end());
153 }
154
155 // Add parents of parents
156
2/2
✓ Branch 5 taken 10 times.
✓ Branch 6 taken 12 times.
22 for (const auto& parentType : parentTypes)
157 {
158
1/2
✓ Branch 1 taken 10 times.
✗ Branch 2 not taken.
10 auto parentParentTypes = GetParentNodeDataTypes(parentType);
159
2/2
✓ Branch 1 taken 6 times.
✓ Branch 2 taken 4 times.
10 if (!parentParentTypes.empty())
160 {
161
1/2
✓ Branch 5 taken 6 times.
✗ Branch 6 not taken.
6 returnTypes.insert(returnTypes.end(), parentParentTypes.begin(), parentParentTypes.end());
162 }
163 10 }
164 }
165
166 12 return returnTypes;
167 }
168
169 // Utility
170 #include "Nodes/Utility/Combiner.hpp"
171 #include "Nodes/Utility/Demo.hpp"
172 #include "Nodes/Utility/GroupBox.hpp"
173 #include "Nodes/Utility/Merger.hpp"
174 #include "Nodes/Utility/Terminator.hpp"
175 #include "Nodes/Utility/TimeWindow.hpp"
176 // Converter
177 #include "Nodes/Converter/GNSS/RtklibPosConverter.hpp"
178 #include "Nodes/Converter/GNSS/UartPacketConverter.hpp"
179 #include "Nodes/Converter/GNSS/UbloxGnssObsConverter.hpp"
180 #include "Nodes/Converter/GNSS/UbloxGnssOrbitCollector.hpp"
181 #include "Nodes/Converter/IMU/VectorNavBinaryConverter.hpp"
182 // Data Link
183 #if __linux__ || __APPLE__
184 #include "Nodes/DataLink/mavlinkSend.hpp"
185 #endif
186 #include "Nodes/DataLink/udpSend.hpp"
187 #include "Nodes/DataLink/udpRecv.hpp"
188 // Data Logger
189 #include "Nodes/DataLogger/General/CsvLogger.hpp"
190 #include "Nodes/DataLogger/General/KmlLogger.hpp"
191 #include "Nodes/DataLogger/General/MatrixLogger.hpp"
192 #include "Nodes/DataLogger/GNSS/RinexObsLogger.hpp"
193 #include "Nodes/DataLogger/GNSS/UartDataLogger.hpp"
194 #include "Nodes/DataLogger/IMU/VectorNavDataLogger.hpp"
195 #include "Nodes/DataLogger/WiFi/WiFiObsLogger.hpp"
196 // Data Processor
197 #include "Nodes/DataProcessor/ErrorModel/AllanDeviation.hpp"
198 #include "Nodes/DataProcessor/ErrorModel/ErrorModel.hpp"
199 #include "Nodes/DataProcessor/GNSS/GnssAnalyzer.hpp"
200 #include "Nodes/DataProcessor/GNSS/SinglePointPositioning.hpp"
201 #include "Nodes/DataProcessor/Integrator/ImuIntegrator.hpp"
202 #include "Nodes/DataProcessor/KalmanFilter/LooselyCoupledKF.hpp"
203 #include "Nodes/DataProcessor/SensorCombiner/ImuFusion.hpp"
204 #include "Nodes/DataProcessor/WiFi/WiFiPositioning.hpp"
205 #include "Nodes/DataProcessor/Filter/LowPassFilter.hpp"
206 // Data Provider
207 #include "Nodes/DataProvider/CSV/CsvFile.hpp"
208 #include "Nodes/DataProvider/GNSS/FileReader/RinexNavFile.hpp"
209 #include "Nodes/DataProvider/GNSS/FileReader/RinexObsFile.hpp"
210 #include "Nodes/DataProvider/GNSS/FileReader/EmlidFile.hpp"
211 #include "Nodes/DataProvider/GNSS/FileReader/RtklibPosFile.hpp"
212 #include "Nodes/DataProvider/GNSS/FileReader/NmeaFile.hpp"
213 #include "Nodes/DataProvider/GNSS/FileReader/UbloxFile.hpp"
214 #include "Nodes/DataProvider/GNSS/Sensors/EmlidSensor.hpp"
215 #include "Nodes/DataProvider/GNSS/Sensors/UbloxSensor.hpp"
216 #include "Nodes/DataProvider/IMU/FileReader/ImuFile.hpp"
217 #include "Nodes/DataProvider/IMU/FileReader/KvhFile.hpp"
218 #include "Nodes/DataProvider/IMU/FileReader/VectorNavFile.hpp"
219 #include "Nodes/DataProvider/IMU/Sensors/KvhSensor.hpp"
220 #include "Nodes/DataProvider/IMU/Sensors/Navio2Sensor.hpp"
221 #include "Nodes/DataProvider/IMU/Sensors/VectorNavSensor.hpp"
222 #include "Nodes/DataProvider/IMU/FileReader/UlogFile.hpp"
223 #include "Nodes/DataProvider/State/PosVelAttFile.hpp"
224 #include "Nodes/DataProvider/IMU/FileReader/MultiImuFile.hpp"
225 #include "Nodes/DataProvider/WiFi/Sensors/EspressifSensor.hpp"
226 #include "Nodes/DataProvider/WiFi/Sensors/ArubaSensor.hpp"
227 #include "Nodes/DataProvider/WiFi/FileReader/WiFiObsFile.hpp"
228 // Data Simulator
229 #include "Nodes/DataProvider/IMU/Simulators/ImuSimulator.hpp"
230 // Plotting
231 #include "Nodes/Plotting/Plot.hpp"
232 // State
233 #include "Nodes/State/PosVelAttInitializer.hpp"
234 // Experimental
235 #include "Nodes/Experimental/DataProcessor/ARMA.hpp"
236 #include "Nodes/Experimental/DataProvider/IMU/NetworkStream/SkydelNetworkStream.hpp"
237 #include "Nodes/Experimental/Simple/Delay.hpp"
238
239 112 void NAV::NodeRegistry::RegisterNodeTypes()
240 {
241 LOG_TRACE("called");
242
243 112 Node::_autostartWorker = false;
244
245 // Utility
246 112 registerNodeType<Combiner>();
247 112 registerNodeType<Demo>();
248 112 registerNodeType<GroupBox>();
249 112 registerNodeType<Merger>();
250 112 registerNodeType<Terminator>();
251 112 registerNodeType<TimeWindow>();
252 // Converter
253 112 registerNodeType<RtklibPosConverter>();
254 112 registerNodeType<UartPacketConverter>();
255 112 registerNodeType<UbloxGnssObsConverter>();
256 112 registerNodeType<UbloxGnssOrbitCollector>();
257 112 registerNodeType<VectorNavBinaryConverter>();
258 // Data Link
259 #if __linux__ || __APPLE__
260 112 registerNodeType<MavlinkSend>();
261 #endif
262 112 registerNodeType<UdpSend>();
263 112 registerNodeType<UdpRecv>();
264 // Data Logger
265 112 registerNodeType<CsvLogger>();
266 112 registerNodeType<KmlLogger>();
267 112 registerNodeType<MatrixLogger>();
268 112 registerNodeType<RinexObsLogger>();
269 112 registerNodeType<UartDataLogger>();
270 112 registerNodeType<VectorNavDataLogger>();
271 112 registerNodeType<WiFiObsLogger>();
272 // Data Processor
273 112 registerNodeType<AllanDeviation>();
274 112 registerNodeType<ErrorModel>();
275 112 registerNodeType<GnssAnalyzer>();
276 112 registerNodeType<SinglePointPositioning>();
277 112 registerNodeType<ImuIntegrator>();
278 112 registerNodeType<LooselyCoupledKF>();
279 112 registerNodeType<LowPassFilter>();
280 112 registerNodeType<ImuFusion>();
281 112 registerNodeType<WiFiPositioning>();
282 // Data Provider
283 112 registerNodeType<CsvFile>();
284 112 registerNodeType<RinexNavFile>();
285 112 registerNodeType<RinexObsFile>();
286 112 registerNodeType<EmlidFile>();
287 112 registerNodeType<RtklibPosFile>();
288 112 registerNodeType<NmeaFile>();
289 112 registerNodeType<UbloxFile>();
290 112 registerNodeType<EmlidSensor>();
291 112 registerNodeType<UbloxSensor>();
292 112 registerNodeType<ImuFile>();
293 112 registerNodeType<KvhFile>();
294 112 registerNodeType<VectorNavFile>();
295 112 registerNodeType<KvhSensor>();
296 112 registerNodeType<Navio2Sensor>();
297 112 registerNodeType<VectorNavSensor>();
298 112 registerNodeType<UlogFile>();
299 112 registerNodeType<PosVelAttFile>();
300 112 registerNodeType<MultiImuFile>();
301 112 registerNodeType<EspressifSensor>();
302 112 registerNodeType<ArubaSensor>();
303 112 registerNodeType<WiFiObsFile>();
304 // Data Simulator
305 112 registerNodeType<ImuSimulator>();
306 // Experimental
307 // registerNodeType<NAV::experimental::ARMA>();
308 // registerNodeType<NAV::experimental::SkydelNetworkStream>();
309 // registerNodeType<NAV::experimental::Delay>();
310 // Plotting
311 112 registerNodeType<Plot>();
312 // State
313 112 registerNodeType<PosVelAttInitializer>();
314
315 112 Node::_autostartWorker = true;
316 112 }
317
318 #include "NodeData/General/DynamicData.hpp"
319 #include "NodeData/General/StringObs.hpp"
320 #include "NodeData/GNSS/EmlidObs.hpp"
321 #include "NodeData/GNSS/GnssCombination.hpp"
322 #include "NodeData/GNSS/GnssObs.hpp"
323 #include "NodeData/GNSS/RtklibPosObs.hpp"
324 #include "NodeData/GNSS/SppSolution.hpp"
325 #include "NodeData/GNSS/UbloxObs.hpp"
326 #include "NodeData/IMU/ImuObs.hpp"
327 #include "NodeData/IMU/ImuObsSimulated.hpp"
328 #include "NodeData/IMU/ImuObsWDelta.hpp"
329 #include "NodeData/IMU/KvhObs.hpp"
330 #include "NodeData/IMU/VectorNavBinaryOutput.hpp"
331 #include "NodeData/State/InsGnssLCKFSolution.hpp"
332 #include "NodeData/State/InsGnssTCKFSolution.hpp"
333 #include "NodeData/State/Pos.hpp"
334 #include "NodeData/State/PosVel.hpp"
335 #include "NodeData/State/PosVelAtt.hpp"
336 #include "NodeData/WiFi/WiFiObs.hpp"
337 #include "NodeData/WiFi/WiFiPositioningSolution.hpp"
338
339 112 void NAV::NodeRegistry::RegisterNodeDataTypes()
340 {
341 112 registerNodeDataType<NodeData>();
342 // General
343 112 registerNodeDataType<DynamicData>();
344 112 registerNodeDataType<StringObs>();
345 // GNSS
346 112 registerNodeDataType<EmlidObs>();
347 112 registerNodeDataType<GnssCombination>();
348 112 registerNodeDataType<GnssObs>();
349 112 registerNodeDataType<RtklibPosObs>();
350 112 registerNodeDataType<SppSolution>();
351 112 registerNodeDataType<UbloxObs>();
352 // IMU
353 112 registerNodeDataType<ImuObs>();
354 112 registerNodeDataType<ImuObsSimulated>();
355 112 registerNodeDataType<ImuObsWDelta>();
356 112 registerNodeDataType<KvhObs>();
357 112 registerNodeDataType<VectorNavBinaryOutput>();
358 // State
359 112 registerNodeDataType<InsGnssLCKFSolution>();
360 112 registerNodeDataType<Pos>();
361 112 registerNodeDataType<PosVel>();
362 112 registerNodeDataType<PosVelAtt>();
363 // WiFi
364 112 registerNodeDataType<WiFiObs>();
365 112 registerNodeDataType<WiFiPositioningSolution>();
366 112 }
367
368 581401 std::vector<std::string> NAV::NodeRegistry::GetStaticDataDescriptors(const std::vector<std::string>& dataIdentifier)
369 {
370 // ATTENTION: Entries need to be in correct inheritance order (deepest inheritance first)
371
372 // NodeData
373
6/10
✓ Branch 1 taken 581401 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581401 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581401 times.
✓ Branch 8 taken 581401 times.
✓ Branch 10 taken 1 times.
✓ Branch 11 taken 581400 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744203 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { DynamicData::type() })) { return DynamicData::GetStaticDataDescriptors(); }
374
5/10
✓ Branch 1 taken 581400 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581400 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581400 times.
✓ Branch 8 taken 581400 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581400 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744200 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { StringObs::type() })) { return StringObs::GetStaticDataDescriptors(); }
375
5/10
✓ Branch 1 taken 581400 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581400 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581400 times.
✓ Branch 8 taken 581400 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581400 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744200 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { GnssCombination::type() })) { return GnssCombination::GetStaticDataDescriptors(); }
376
5/10
✓ Branch 1 taken 581400 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581400 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581400 times.
✓ Branch 8 taken 581400 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581400 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744200 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { GnssObs::type() })) { return GnssObs::GetStaticDataDescriptors(); }
377
6/10
✓ Branch 1 taken 581400 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581400 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581400 times.
✓ Branch 8 taken 581400 times.
✓ Branch 10 taken 6 times.
✓ Branch 11 taken 581394 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744200 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { VectorNavBinaryOutput::type() })) { return VectorNavBinaryOutput::GetStaticDataDescriptors(); }
378
5/10
✓ Branch 1 taken 581394 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581394 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581394 times.
✓ Branch 8 taken 581394 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581394 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744182 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { EmlidObs::type() })) { return EmlidObs::GetStaticDataDescriptors(); }
379
5/10
✓ Branch 1 taken 581394 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581394 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581394 times.
✓ Branch 8 taken 581394 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581394 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744182 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { UbloxObs::type() })) { return UbloxObs::GetStaticDataDescriptors(); }
380
5/10
✓ Branch 1 taken 581394 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581394 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581394 times.
✓ Branch 8 taken 581394 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581394 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744182 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { WiFiObs::type() })) { return WiFiObs::GetStaticDataDescriptors(); }
381 // Pos
382
5/10
✓ Branch 1 taken 581394 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581394 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581394 times.
✓ Branch 8 taken 581394 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 581394 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744182 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { InsGnssTCKFSolution::type() })) { return InsGnssTCKFSolution::GetStaticDataDescriptors(); }
383
6/10
✓ Branch 1 taken 581394 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 581394 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 581394 times.
✓ Branch 8 taken 581394 times.
✓ Branch 10 taken 290688 times.
✓ Branch 11 taken 290706 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
1744182 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { InsGnssLCKFSolution::type() })) { return InsGnssLCKFSolution::GetStaticDataDescriptors(); }
384
6/10
✓ Branch 1 taken 290706 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 290706 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 290706 times.
✓ Branch 8 taken 290706 times.
✓ Branch 10 taken 290684 times.
✓ Branch 11 taken 22 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
872118 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { PosVelAtt::type() })) { return PosVelAtt::GetStaticDataDescriptors(); }
385
6/10
✓ Branch 1 taken 22 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 22 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 22 times.
✓ Branch 8 taken 22 times.
✓ Branch 10 taken 3 times.
✓ Branch 11 taken 19 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
66 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { SppSolution::type() })) { return SppSolution::GetStaticDataDescriptors(); }
386
6/10
✓ Branch 1 taken 19 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 19 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 19 times.
✓ Branch 8 taken 19 times.
✓ Branch 10 taken 7 times.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
57 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { RtklibPosObs::type() })) { return RtklibPosObs::GetStaticDataDescriptors(); }
387
5/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { WiFiPositioningSolution::type() })) { return WiFiPositioningSolution::GetStaticDataDescriptors(); }
388
5/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { PosVel::type() })) { return PosVel::GetStaticDataDescriptors(); }
389
5/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 12 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { Pos::type() })) { return Pos::GetStaticDataDescriptors(); }
390 // ImuObs
391
6/10
✓ Branch 1 taken 12 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 12 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 12 times.
✓ Branch 8 taken 12 times.
✓ Branch 10 taken 4 times.
✓ Branch 11 taken 8 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
36 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { ImuObsSimulated::type() })) { return ImuObsSimulated::GetStaticDataDescriptors(); }
392
5/10
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 8 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 8 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
24 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { ImuObsWDelta::type() })) { return ImuObsWDelta::GetStaticDataDescriptors(); }
393
5/10
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 8 times.
✗ Branch 10 not taken.
✓ Branch 11 taken 8 times.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
24 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { KvhObs::type() })) { return KvhObs::GetStaticDataDescriptors(); }
394
5/10
✓ Branch 1 taken 8 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 8 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 8 times.
✓ Branch 8 taken 8 times.
✓ Branch 10 taken 8 times.
✗ Branch 11 not taken.
✗ Branch 14 not taken.
✗ Branch 15 not taken.
24 if (NAV::NodeRegistry::NodeDataTypeAnyIsChildOf(dataIdentifier, { ImuObs::type() })) { return ImuObs::GetStaticDataDescriptors(); }
395
396 return {};
397 6104790 }
398
399 73 bool NAV::NodeRegistry::TypeHasDynamicData(const std::string& type)
400 {
401
0/2
✗ Branch 1 not taken.
✗ Branch 2 not taken.
73 return type == DynamicData::type()
402
3/8
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 72 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 73 times.
✗ Branch 8 not taken.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
145 || type == GnssCombination::type()
403
4/8
✓ Branch 1 taken 72 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 72 times.
✗ Branch 5 not taken.
✓ Branch 7 taken 72 times.
✓ Branch 8 taken 1 times.
✗ Branch 9 not taken.
✗ Branch 10 not taken.
145 || type == GnssObs::type()
404
10/14
✓ Branch 1 taken 73 times.
✗ Branch 2 not taken.
✓ Branch 4 taken 72 times.
✓ Branch 5 taken 1 times.
✓ Branch 7 taken 72 times.
✗ Branch 8 not taken.
✓ Branch 10 taken 3 times.
✓ Branch 11 taken 69 times.
✓ Branch 12 taken 72 times.
✓ Branch 13 taken 1 times.
✓ Branch 15 taken 72 times.
✓ Branch 16 taken 1 times.
✗ Branch 17 not taken.
✗ Branch 18 not taken.
218 || type == SppSolution::type();
405 }
406
407 std::shared_ptr<NAV::NodeData> NAV::NodeRegistry::CopyNodeData(const std::shared_ptr<const NodeData>& nodeData)
408 {
409 if (nodeData == nullptr) { return nullptr; }
410
411 // General
412 if (nodeData->getType() == DynamicData::type()) { return std::make_shared<DynamicData>(*std::static_pointer_cast<const DynamicData>(nodeData)); }
413 if (nodeData->getType() == StringObs::type()) { return std::make_shared<StringObs>(*std::static_pointer_cast<const StringObs>(nodeData)); }
414 // GNSS
415 if (nodeData->getType() == EmlidObs::type()) { return std::make_shared<EmlidObs>(*std::static_pointer_cast<const EmlidObs>(nodeData)); }
416 if (nodeData->getType() == GnssCombination::type()) { return std::make_shared<GnssCombination>(*std::static_pointer_cast<const GnssCombination>(nodeData)); }
417 if (nodeData->getType() == GnssObs::type()) { return std::make_shared<GnssObs>(*std::static_pointer_cast<const GnssObs>(nodeData)); }
418 if (nodeData->getType() == RtklibPosObs::type()) { return std::make_shared<RtklibPosObs>(*std::static_pointer_cast<const RtklibPosObs>(nodeData)); }
419 if (nodeData->getType() == SppSolution::type()) { return std::make_shared<SppSolution>(*std::static_pointer_cast<const SppSolution>(nodeData)); }
420 if (nodeData->getType() == UbloxObs::type()) { return std::make_shared<UbloxObs>(*std::static_pointer_cast<const UbloxObs>(nodeData)); }
421 // IMU
422 if (nodeData->getType() == ImuObs::type()) { return std::make_shared<ImuObs>(*std::static_pointer_cast<const ImuObs>(nodeData)); }
423 if (nodeData->getType() == ImuObsSimulated::type()) { return std::make_shared<ImuObsSimulated>(*std::static_pointer_cast<const ImuObsSimulated>(nodeData)); }
424 if (nodeData->getType() == ImuObsWDelta::type()) { return std::make_shared<ImuObsWDelta>(*std::static_pointer_cast<const ImuObsWDelta>(nodeData)); }
425 if (nodeData->getType() == KvhObs::type()) { return std::make_shared<KvhObs>(*std::static_pointer_cast<const KvhObs>(nodeData)); }
426 if (nodeData->getType() == VectorNavBinaryOutput::type()) { return std::make_shared<VectorNavBinaryOutput>(*std::static_pointer_cast<const VectorNavBinaryOutput>(nodeData)); }
427 // State
428 if (nodeData->getType() == InsGnssLCKFSolution::type()) { return std::make_shared<InsGnssLCKFSolution>(*std::static_pointer_cast<const InsGnssLCKFSolution>(nodeData)); }
429 if (nodeData->getType() == InsGnssTCKFSolution::type()) { return std::make_shared<InsGnssTCKFSolution>(*std::static_pointer_cast<const InsGnssTCKFSolution>(nodeData)); }
430 if (nodeData->getType() == Pos::type()) { return std::make_shared<Pos>(*std::static_pointer_cast<const Pos>(nodeData)); }
431 if (nodeData->getType() == PosVel::type()) { return std::make_shared<PosVel>(*std::static_pointer_cast<const PosVel>(nodeData)); }
432 if (nodeData->getType() == PosVelAtt::type()) { return std::make_shared<PosVelAtt>(*std::static_pointer_cast<const PosVelAtt>(nodeData)); }
433 // WiFi
434 if (nodeData->getType() == WiFiObs::type()) { return std::make_shared<WiFiObs>(*std::static_pointer_cast<const WiFiObs>(nodeData)); }
435 if (nodeData->getType() == WiFiPositioningSolution::type()) { return std::make_shared<WiFiPositioningSolution>(*std::static_pointer_cast<const WiFiPositioningSolution>(nodeData)); }
436
437 return nullptr;
438 }
439