X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FAnnotationRouter.ct;h=29a9cab8caefcf35d4a3f611df8ac2bda2e64328;hb=164fe477094d42463722584e527a02379ab5d985;hp=bef2f9c48752fef659fa9ba24bc175e9d57b2407;hpb=38863ce7cf677eb69a98a3fd96bd44dea3509e9a;p=senf.git diff --git a/PPI/AnnotationRouter.ct b/PPI/AnnotationRouter.ct index bef2f9c..29a9cab 100644 --- a/PPI/AnnotationRouter.ct +++ b/PPI/AnnotationRouter.ct @@ -39,30 +39,22 @@ prefix_ senf::ppi::module::AnnotationRouter::AnnotationRouter() } template -prefix_ senf::ppi::connector::ActiveOutput<> & -senf::ppi::module::AnnotationRouter::newOutput(AnnotationType const & key) +prefix_ AnnotationType senf::ppi::module::AnnotationRouter:: +connectorSetup(connector::ActiveOutput<> & conn, AnnotationType const & key) { - if (outputs_.find(key) != outputs_.end()) + if (this->connectors().find(key) != this->connectors().end()) throw DuplicateKeyException(key); - // key must not be const ... has something to do with exception guarantees ?? - // From boost 1.34.0 on we can use auto_ptr which we really should for exception safety - // but this doesn't work with boost 1.33.1 :-( -#if BOOST_VERSION >= 103400 - return *outputs_.insert(key, - std::auto_ptr >( - new connector::ActiveOutput<>())).first->second; -#else - AnnotationType k (key); - return *outputs_.insert(k, new connector::ActiveOutput<>()).first; -#endif + route(input, conn); + return key; } template prefix_ void senf::ppi::module::AnnotationRouter::request() { Packet p (input()); - typename Outputs::iterator i (outputs_.find(p.annotation())); - if (i == outputs_.end()) + typename AnnotationRouter::ContainerType::iterator i ( + this->connectors().find(p.annotation())); + if (i == this->connectors().end()) defaultOutput(p); else { #if BOOST_VERSION >= 103400