| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 1 | #pragma once |
| 2 | |
| 3 | #include "perform_scan.hpp" |
| 4 | |
| Ed Tanous | dbf95b2 | 2025-10-13 11:38:35 -0700 | [diff] [blame] | 5 | #include <flat_map> |
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 6 | #include <memory> |
| 7 | #include <string> |
| 8 | #include <vector> |
| 9 | |
| 10 | namespace probe |
| 11 | { |
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 12 | |
| 13 | // underscore T for collison with dbus c api |
| 14 | enum class probe_type_codes |
| 15 | { |
| 16 | FALSE_T, |
| 17 | TRUE_T, |
| 18 | AND, |
| 19 | OR, |
| 20 | FOUND, |
| 21 | MATCH_ONE |
| 22 | }; |
| 23 | |
| Amithash Prasad | 60618a7 | 2025-05-13 11:03:02 -0700 | [diff] [blame] | 24 | using FoundProbeTypeT = std::optional<probe_type_codes>; |
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 25 | |
| 26 | FoundProbeTypeT findProbeType(const std::string& probe); |
| 27 | |
| 28 | // this class finds the needed dbus fields and on destruction runs the probe |
| Ed Tanous | 7f2fbf8 | 2025-10-14 15:39:28 -0700 | [diff] [blame] | 29 | struct PerformProbe |
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 30 | { |
| 31 | PerformProbe(nlohmann::json& recordRef, |
| 32 | const std::vector<std::string>& probeCommand, |
| 33 | std::string probeName, |
| 34 | std::shared_ptr<scan::PerformScan>& scanPtr); |
| 35 | virtual ~PerformProbe(); |
| 36 | |
| Alexander Hansen | b4c4e03 | 2025-08-05 17:59:07 +0200 | [diff] [blame] | 37 | private: |
| Christopher Meis | 26fbbd5 | 2025-03-26 14:55:06 +0100 | [diff] [blame] | 38 | nlohmann::json& recordRef; |
| 39 | std::vector<std::string> _probeCommand; |
| 40 | std::string probeName; |
| 41 | std::shared_ptr<scan::PerformScan> scan; |
| 42 | }; |
| 43 | |
| 44 | } // namespace probe |