X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FModule.hh;h=1a3d22bd1d81d07bd504292c5939d0d3c48172d9;hb=81ffa1c459b96dd44472bcef37e1e373934ee138;hp=a60382e12a1bb9aff4eee1827dafb518d10e24db;hpb=0c6e42841266e5983ef9a9836b8f1bb98de684ba;p=senf.git diff --git a/PPI/Module.hh b/PPI/Module.hh index a60382e..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 @@ -79,14 +81,13 @@ namespace module { The return value may be used to alter routing parameters like throttling parameters. - \param[in] source Data source, object which controlls + \param[in] source Data source, object which controls incoming data - \param[in] target Data target, object which controlls + \param[in] target Data target, object which controls 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 @@ -143,4 +160,6 @@ namespace module { // c-file-style: "senf" // indent-tabs-mode: nil // ispell-local-dictionary: "american" +// compile-command: "scons -u test" +// comment-column: 40 // End: