18#ifndef MONITOR_FILTER_H_
19#define MONITOR_FILTER_H_
51#include <unordered_map>
55#include "std_filesystem.h"
64 enum class Direction { kInput, kHandled, kOutput, kInternal, kNone };
65 enum class Accepted { kOk, kFilteredNoOutput, kFilteredDropped, kNone };
66 enum class State { kOk, kChecksumError, kMalformed, kTxError, kNone };
68 NavmsgStatus(Direction direction_, State status_, Accepted accepted_)
69 : direction(direction_), status(status_), accepted(accepted_) {}
75 :
NavmsgStatus(Direction::kInput, status, Accepted::kOk) {}
78 :
NavmsgStatus(Direction::kInput, State::kOk, accepted) {}
103 static std::vector<NavmsgFilter>
GetFilters(
const fs::path& path);
128 std::string m_description;
129 std::set<NavmsgStatus::Direction> directions;
130 std::set<NavmsgStatus::State> status;
131 std::set<NavmsgStatus::Accepted> accepted;
132 std::set<NavAddr::Bus> buses;
133 std::set<std::string> include_msg;
134 std::set<std::string> exclude_msg;
135 std::set<std::string> interfaces;
136 std::set<N2kPGN> pgns;
137 std::set<N2kName> src_pgns;
bool Pass(NavmsgStatus status, const std::shared_ptr< const NavMsg > &msg)
Return true if message is not matched by filter.
static std::vector< NavmsgFilter > GetFilters(const fs::path &path)
Return list of pre-defined filters shipped with app, test hook.
static std::vector< NavmsgFilter > GetAllFilters()
Return list of all filters, system + user defined.
std::string to_string() const
Output parsable JSON string representation.
std::string GetName()
Return human-readable name.
static NavmsgFilter Parse(const std::string &s)
Parse text as created by to_string().
void SetName(const std::string &new_name)
Set human-readable name.
static std::vector< NavmsgFilter > GetSystemFilters()
Return list of pre-defined filters shipped with application.
Representation of message status as determined by the multiplexer.
static Accepted StringToAccepted(const std::string &s)
Return Accepted value corresponding to argument s.
static std::string AcceptedToString(Accepted)
Return string representation of argument.
Raw, undecoded messages definitions.