From a696112a5c1a493e24ec4f72d1c4df95e5d390dc Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Sat, 26 May 2012 09:17:47 +0200 Subject: Topic filter implemented The filter is build into libxs rather than being a plug-in. It's ID is XS_FILTER_TOPIC. The filter assumed that the messages are text-based and consider binary 0 to be a delimiter separating message topic from the message body. Use of the delimiter is not mandatory though. If binary zero is not present, whole message is used for matching. The topic is separated into elements using dots, e.g. "animals.dogs.fluffy". Subscriptions match individual elements. Each element can be matched by either literal string or a wildcard (*), for example: "animals.*.fluffy" matches all animals called Fluffy irrsepctive of whether they are dogs, cats or whatever. Signed-off-by: Martin Sustrik --- src/ctx.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ctx.cpp') diff --git a/src/ctx.cpp b/src/ctx.cpp index 7f4c88a..6460dd2 100644 --- a/src/ctx.cpp +++ b/src/ctx.cpp @@ -56,6 +56,7 @@ #include "err.hpp" #include "msg.hpp" #include "prefix_filter.hpp" +#include "topic_filter.hpp" xs::ctx_t::ctx_t () : tag (0xbadcafe0), @@ -73,7 +74,8 @@ xs::ctx_t::ctx_t () : // Plug in the standard plugins. rc = plug (prefix_filter); errno_assert (rc == 0); - + rc = plug (topic_filter); + errno_assert (rc == 0); // Now plug in all the extensions found in plugin directory. -- cgit v1.2.3