}
template <class AnnotationType>
-prefix_ senf::ppi::connector::ActiveOutput<> &
-senf::ppi::module::AnnotationRouter<AnnotationType>::newOutput(AnnotationType const & key)
+prefix_ AnnotationType senf::ppi::module::AnnotationRouter<AnnotationType>::
+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<connector::ActiveOutput<> >(
- new connector::ActiveOutput<>())).first->second;
-#else
- AnnotationType k (key);
- return *outputs_.insert(k, new connector::ActiveOutput<>()).first;
-#endif
+ route(input, conn);
+ return key;
}
template <class AnnotationType>
prefix_ void senf::ppi::module::AnnotationRouter<AnnotationType>::request()
{
Packet p (input());
- typename Outputs::iterator i (outputs_.find(p.annotation<AnnotationType>()));
- if (i == outputs_.end())
+ typename AnnotationRouter::ContainerType::iterator i (
+ this->connectors().find(p.annotation<AnnotationType>()));
+ if (i == this->connectors().end())
defaultOutput(p);
else {
#if BOOST_VERSION >= 103400