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/topic_filter.hpp | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/topic_filter.hpp (limited to 'src/topic_filter.hpp') diff --git a/src/topic_filter.hpp b/src/topic_filter.hpp new file mode 100644 index 0000000..bc81675 --- /dev/null +++ b/src/topic_filter.hpp @@ -0,0 +1,32 @@ +/* + Copyright (c) 2012 250bpm s.r.o. + Copyright (c) 2012 Other contributors as noted in the AUTHORS file + + This file is part of Crossroads I/O project. + + Crossroads I/O is free software; you can redistribute it and/or modify it + under the terms of the GNU Lesser General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + Crossroads is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public License + along with this program. If not, see . +*/ + +#ifndef __XS_TOPIC_FILTER_HPP_INCLUDED__ +#define __XS_TOPIC_FILTER_HPP_INCLUDED__ + +namespace xs +{ + + // Canonical extension object. + extern void *topic_filter; + +} + +#endif -- cgit v1.2.3