21#ifndef MONITOR_FILTER_H_
22#define MONITOR_FILTER_H_
53#include <unordered_map>
57#include "std_filesystem.h"
64 enum class Direction { kInput, kReceived, kOutput, kInternal, kNone };
65 enum class Accepted { kOk, kFilteredNoOutput, kFilteredDropped, kNone };
66 enum class State { kOk, kChecksumError, kMalformed, kTxError, kNone };
69 : direction(Direction::kInput),
71 accepted(Accepted::kOk) {}
94 static std::vector<NavmsgFilter>
GetFilters(
const fs::path& path);
119 std::string m_description;
120 std::set<NavmsgStatus::Direction> directions;
121 std::set<NavmsgStatus::State> status;
122 std::set<NavmsgStatus::Accepted> accepted;
123 std::set<NavAddr::Bus> buses;
124 std::set<std::string> include_msg;
125 std::set<std::string> exclude_msg;
126 std::set<std::string> interfaces;
127 std::set<N2kPGN> pgns;
128 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.