X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FModule.hh;h=1a3d22bd1d81d07bd504292c5939d0d3c48172d9;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=30d52d9892a1d290811674bddc4e810b69cbb219;hpb=145f6a7d0f3a6aaa77b3625351c952d24cb0b8a1;p=senf.git diff --git a/PPI/Module.hh b/PPI/Module.hh index 30d52d9..1a3d22b 100644 --- a/PPI/Module.hh +++ b/PPI/Module.hh @@ -26,8 +26,11 @@ #define HH_Module_ 1 // Custom includes +#include #include #include +#include +#include "predecl.hh" //#include "Module.mpp" ///////////////////////////////hh.p//////////////////////////////////////// @@ -56,10 +59,9 @@ namespace module { { protected: Module(); - ~Module(); template - Route & route(Source const & source, Target const & target); + Route & route(Source & source, Target & target); ///< Define flow information /**< Using the route() and noroute() members, the information flow within the module is defined. Routing @@ -85,8 +87,7 @@ namespace module { outgoing data \returns Route instance describing this route */ - template - void noroute(Connector const & connector); ///< Define terminal connectors + void noroute(connector::Connector & connector); ///< Define terminal connectors /**< The noroute() member explicitly declares, that a connector is terminal and does not directly receive/forward data from/to some other @@ -98,7 +99,7 @@ namespace module { \param[in] connector Terminal connector to declare */ template - void registerEvent(Target target, Descriptor const & descriptor); + void registerEvent(Target target, Descriptor & descriptor); ///< Register an external event /**< The \a target argument may be either an arbitrary callable object or it may be a member function pointer @@ -109,6 +110,7 @@ namespace module { information on the event delivered. The \a descriptor describes the event to signal. This + may be a timer event or some type of I/O event on a file descriptor or socket. @@ -118,6 +120,21 @@ namespace module { boost::posix_time::ptime eventTime(); ///< Return timestamp of the currently processing ///< event + + private: + EventManager & eventManager(); + + void registerConnector(connector::Connector & connector); + RouteBase & addRoute(std::auto_ptr route); + + typedef std::vector ConnectorRegistry; + ConnectorRegistry connectorRegistry_; + + typedef boost::ptr_vector RouteInfoBase; + RouteInfoBase routes_; + + template + friend class detail::RouteHelper; }; /** \brief Connect compatible connectors @@ -131,8 +148,8 @@ namespace module { }}} ///////////////////////////////hh.e//////////////////////////////////////// -//#include "Module.cci" -//#include "Module.ct" +#include "Module.cci" +#include "Module.ct" //#include "Module.cti" #endif