INSTINCT Code Coverage Report


Directory: src/
File: NodeData/General/StringObs.hpp
Date: 2025-02-07 16:54:41
Exec Total Coverage
Lines: 5 8 62.5%
Functions: 2 4 50.0%
Branches: 4 8 50.0%

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 /// @file StringObs.hpp
10 /// @brief Wrapper for String Messages
11 /// @author T. Topp (topp@ins.uni-stuttgart.de)
12 /// @date 2021-07-01
13
14 #pragma once
15
16 #include <string>
17
18 #include "NodeData/NodeData.hpp"
19
20 namespace NAV
21 {
22 /// IMU Observation storage class
23 class StringObs : public NodeData
24 {
25 public:
26 /// @brief Constructor
27 /// @param[in] str String to store in the observation
28 explicit StringObs(std::string str)
29 : data(std::move(str)) {}
30
31 /// @brief Returns the type of the data class
32 /// @return The data type
33 581624 [[nodiscard]] static std::string type()
34 {
35
1/2
✓ Branch 1 taken 581624 times.
✗ Branch 2 not taken.
1163248 return "StringObs";
36 }
37
38 /// @brief Returns the type of the data class
39 /// @return The data type
40 [[nodiscard]] std::string getType() const override { return type(); }
41
42 /// @brief Returns the parent types of the data class
43 /// @return The parent data types
44 112 [[nodiscard]] static std::vector<std::string> parentTypes()
45 {
46
3/6
✓ Branch 1 taken 112 times.
✗ Branch 2 not taken.
✓ Branch 3 taken 112 times.
✓ Branch 4 taken 112 times.
✗ Branch 6 not taken.
✗ Branch 7 not taken.
336 return { NodeData::type() };
47 112 }
48
49 /// @brief The string to transport
50 std::string data;
51 };
52
53 } // namespace NAV
54