OpenCPN Partial API docs
Loading...
Searching...
No Matches
NavmsgFilter Class Reference

Public Member Functions

 NavmsgFilter (bool is_valid)
 
std::string to_string () const
 Output parsable JSON string representation.
 
bool Pass (NavmsgStatus status, const std::shared_ptr< const NavMsg > &msg)
 Return true if message is not matched by filter.
 
std::string GetName ()
 Return human-readable name.
 
void SetName (const std::string &new_name)
 Set human-readable name.
 

Static Public Member Functions

static std::vector< NavmsgFilterGetSystemFilters ()
 Return list of pre-defined filters shipped with application.
 
static std::vector< NavmsgFilterGetFilters (const fs::path &path)
 Return list of pre-defined filters shipped with app, test hook.
 
static std::vector< NavmsgFilterGetAllFilters ()
 Return list of all filters, system + user defined.
 
static NavmsgFilter Parse (const std::string &s)
 Parse text as created by to_string().
 
static NavmsgFilter Parse (const fs::path &path)
 Parse text as created by to_string() stored in a file.
 

Public Attributes

bool m_is_valid
 
std::string m_name
 
std::string m_description
 
std::set< NavmsgStatus::Direction > directions
 
std::set< NavmsgStatus::State > status
 
std::set< NavmsgStatus::Accepted > accepted
 
std::set< NavAddr::Bus > buses
 
std::set< std::string > include_msg
 
std::set< std::string > exclude_msg
 
std::set< std::string > interfaces
 
std::set< N2kPGNpgns
 
std::set< N2kNamesrc_pgns
 

Detailed Description

Definition at line 84 of file navmsg_filter.h.

Constructor & Destructor Documentation

◆ NavmsgFilter() [1/2]

NavmsgFilter::NavmsgFilter ( )
inline

Definition at line 86 of file navmsg_filter.h.

◆ NavmsgFilter() [2/2]

NavmsgFilter::NavmsgFilter ( bool  is_valid)
inline

Definition at line 88 of file navmsg_filter.h.

Member Function Documentation

◆ GetAllFilters()

std::vector< NavmsgFilter > NavmsgFilter::GetAllFilters ( )
static

Return list of all filters, system + user defined.

Definition at line 213 of file navmsg_filter.cpp.

◆ GetFilters()

std::vector< NavmsgFilter > NavmsgFilter::GetFilters ( const fs::path &  path)
static

Return list of pre-defined filters shipped with app, test hook.

Definition at line 186 of file navmsg_filter.cpp.

◆ GetSystemFilters()

std::vector< NavmsgFilter > NavmsgFilter::GetSystemFilters ( )
static

Return list of pre-defined filters shipped with application.

Definition at line 203 of file navmsg_filter.cpp.

◆ Parse() [1/2]

NavmsgFilter NavmsgFilter::Parse ( const fs::path &  path)
static

Parse text as created by to_string() stored in a file.

Definition at line 256 of file navmsg_filter.cpp.

◆ Parse() [2/2]

NavmsgFilter NavmsgFilter::Parse ( const std::string &  s)
static

Parse text as created by to_string().

Definition at line 264 of file navmsg_filter.cpp.

◆ Pass()

bool NavmsgFilter::Pass ( NavmsgStatus  status,
const std::shared_ptr< const NavMsg > &  msg 
)

Return true if message is not matched by filter.

Definition at line 220 of file navmsg_filter.cpp.

◆ to_string()

std::string NavmsgFilter::to_string ( ) const

Output parsable JSON string representation.

Definition at line 296 of file navmsg_filter.cpp.

Member Data Documentation

◆ accepted

std::set<NavmsgStatus::Accepted> NavmsgFilter::accepted

Definition at line 122 of file navmsg_filter.h.

◆ buses

std::set<NavAddr::Bus> NavmsgFilter::buses

Definition at line 123 of file navmsg_filter.h.

◆ directions

std::set<NavmsgStatus::Direction> NavmsgFilter::directions

Definition at line 120 of file navmsg_filter.h.

◆ exclude_msg

std::set<std::string> NavmsgFilter::exclude_msg

Definition at line 125 of file navmsg_filter.h.

◆ include_msg

std::set<std::string> NavmsgFilter::include_msg

Definition at line 124 of file navmsg_filter.h.

◆ interfaces

std::set<std::string> NavmsgFilter::interfaces

Definition at line 126 of file navmsg_filter.h.

◆ m_description

std::string NavmsgFilter::m_description

Definition at line 119 of file navmsg_filter.h.

◆ m_is_valid

bool NavmsgFilter::m_is_valid

Definition at line 117 of file navmsg_filter.h.

◆ m_name

std::string NavmsgFilter::m_name

Definition at line 118 of file navmsg_filter.h.

◆ pgns

std::set<N2kPGN> NavmsgFilter::pgns

Definition at line 127 of file navmsg_filter.h.

◆ src_pgns

std::set<N2kName> NavmsgFilter::src_pgns

Definition at line 128 of file navmsg_filter.h.

◆ status

std::set<NavmsgStatus::State> NavmsgFilter::status

Definition at line 121 of file navmsg_filter.h.


The documentation for this class was generated from the following files: