X-Git-Url: http://sru.miketaylor.org.uk/?a=blobdiff_plain;f=src%2Ffilter.hpp;h=b71e85f77123a7f40d0c18f2b400a29dd069dfd2;hb=7467b072bb64f5c8575daa9917cce7df62d832f1;hp=4632a3be262c8f1a310bc2a6b32ef8e017fb446b;hpb=7969e482bd427717e116917116e52958432a9c16;p=metaproxy-moved-to-github.git diff --git a/src/filter.hpp b/src/filter.hpp index 4632a3b..b71e85f 100644 --- a/src/filter.hpp +++ b/src/filter.hpp @@ -1,43 +1,33 @@ +/* $Id: filter.hpp,v 1.7 2005-10-29 22:23:36 marc Exp $ + Copyright (c) 2005, Index Data. + +%LICENSE% + */ #ifndef FILTER_HPP #define FILTER_HPP #include +#include namespace yp2 { class Package; - - class Filter { - public: - virtual ~Filter(){}; - ///sends Package off to next Filter, returns altered Package - virtual Package & process(Package & package) const { - return package; + namespace filter { + class Base { + public: + virtual ~Base(){}; + + ///sends Package off to next Filter, returns altered Package + virtual void process(Package & package) const = 0; + + virtual void configure(const xmlNode * ptr = 0) { }; + + + virtual const std::string type() const = 0; }; - virtual void configure(){}; - - /// get function - right val in assignment - std::string name() const { - return m_name; - } - - /// set function - left val in assignment - std::string & name() { - return m_name; - } - - /// set function - can be chained - Filter & name(const std::string & name){ - m_name = name; - return *this; - } - - private: - std::string m_name; - }; - + } class FilterException : public std::runtime_error { public: @@ -54,6 +44,7 @@ namespace yp2 { * Local variables: * c-basic-offset: 4 * indent-tabs-mode: nil + * c-file-style: "stroustrup" * End: * vim: shiftwidth=4 tabstop=8 expandtab */