Mads
Multi-Agent Distributed System
Loading...
Searching...
No Matches
topic_match.hpp File Reference
#include <string>
#include <string_view>

Go to the source code of this file.

Namespaces

namespace  Mads
 

Enumerations

enum class  Mads::SubMatch { Mads::None , Mads::Exact , Mads::Prefix , Mads::Wildcard }
 

Functions

bool Mads::topic_match (std::string_view pattern, std::string_view topic)
 Tests whether a concrete topic matches an MQTT-style pattern.
 
bool Mads::has_wildcard (std::string_view sub_entry)
 Tells whether a sub_topic entry is a wildcard pattern.
 
SubMatch Mads::subscription_match (std::string_view sub_entry, std::string_view topic)
 Single source of truth for "would an agent subscribing to `sub_entry` receive a message published on `topic`?".
 
bool Mads::subscription_matches (std::string_view sub_entry, std::string_view topic)
 Convenience predicate over subscription_match().
 
std::string Mads::literal_prefix (std::string_view pattern)
 Computes the longest literal (wildcard-free) prefix of a pattern.