From: g0dil Date: Wed, 12 Mar 2008 14:01:24 +0000 (+0000) Subject: PPI: Move generic packet typeid check into connector base-class X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=8aa27cfde664f462f1aebd601f1521c186d819c3;p=senf.git PPI: Move generic packet typeid check into connector base-class git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@744 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/PPI/Connectors.cc b/PPI/Connectors.cc index 5c4ceff..e11e5e2 100644 --- a/PPI/Connectors.cc +++ b/PPI/Connectors.cc @@ -53,6 +53,11 @@ prefix_ void senf::ppi::connector::Connector::connect(Connector & target) target.peer_ = this; } +prefix_ std::type_info const & senf::ppi::connector::Connector::packetTypeID() +{ + return typeid(void); +} + /////////////////////////////////////////////////////////////////////////// // senf::ppi::connector::PassiveConnector diff --git a/PPI/Connectors.hh b/PPI/Connectors.hh index be55849..60b1f71 100644 --- a/PPI/Connectors.hh +++ b/PPI/Connectors.hh @@ -123,7 +123,7 @@ namespace connector { void connect(Connector & target); private: - virtual std::type_info const & packetTypeID() = 0; + virtual std::type_info const & packetTypeID(); void setModule(module::Module & module); @@ -456,27 +456,24 @@ namespace connector { # define TypedConnector_Input read # define TypedConnector_Output write -# define TypedConnector(pType, dir) \ +# define TypedConnector(pType, dir) \ template \ - class pType ## dir \ - : public Generic ## pType ## dir, \ - private detail::Typed ## dir ## Mixin, PacketType> \ + class pType ## dir \ + : public Generic ## pType ## dir, \ + private detail::Typed ## dir ## Mixin, PacketType> \ { \ - typedef detail::Typed ## dir ## Mixin, PacketType> mixin; \ + typedef detail::Typed ## dir ## Mixin, PacketType> mixin; \ public: \ using mixin::operator(); \ using mixin::TypedConnector_ ## dir ; \ private: \ virtual std::type_info const & packetTypeID() \ { return typeid(typename PacketType::type); } \ - friend class detail::Typed ## dir ## Mixin, PacketType>; \ + friend class detail::Typed ## dir ## Mixin, PacketType>; \ }; \ template <> \ - class pType ## dir : public Generic ## pType ## dir \ - { \ - private: \ - virtual std::type_info const & packetTypeID() { return typeid(void); } \ - } + class pType ## dir : public Generic ## pType ## dir \ + {} TypedConnector( Passive, Input ); TypedConnector( Passive, Output ); diff --git a/PPI/Route.ih b/PPI/Route.ih index 01836c9..76125e3 100644 --- a/PPI/Route.ih +++ b/PPI/Route.ih @@ -47,6 +47,8 @@ namespace detail { struct RoutingTraitsImplementation { BOOST_STATIC_ASSERT((boost::is_base_of::value)); + + static bool const event = false; static bool const notifySource = boost::is_base_of< connector::ActiveConnector, Connector>::value; @@ -66,6 +68,8 @@ namespace detail { template struct RoutingTraitsImplementation { + static bool const event = true; + static bool const notifySource = false; static bool const notifyTarget = true; diff --git a/Packets/ParseHelpers.hh b/Packets/ParseHelpers.hh index f79e956..a8d5fbd 100644 --- a/Packets/ParseHelpers.hh +++ b/Packets/ParseHelpers.hh @@ -278,7 +278,7 @@ \ingroup packetparser */ -///\ingroup packetparsermacros +///\addtogroup packetparsermacros ///\{ ///\name Control information