From: pug Date: Thu, 5 Nov 2009 13:16:52 +0000 (+0000) Subject: added STL-compatible predicate for GenericParsers X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=4a99bad0289a65567e85cb51bd357a34562b2c04;p=senf.git added STL-compatible predicate for GenericParsers git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1516 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Packets/GenericTLV.hh b/senf/Packets/GenericTLV.hh index 7cb5da7..b1298e0 100644 --- a/senf/Packets/GenericTLV.hh +++ b/senf/Packets/GenericTLV.hh @@ -193,6 +193,16 @@ namespace senf { { virtual void dump(GenericTLVParserBase const & parser, std::ostream & os) const; }; + + //Helper Functor for STL-compatible predicate (E.g. find_if, for_each ...) + template + class Predicate + { + public: + const bool operator() (BaseParser const &p) const{ + return p.template is(); + } + }; } /** \brief TLV parser registration facility