X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=PPI%2FConnectors.hh;h=0f54dc6476a8b5cf6e987cf7b74a8d0559588e3e;hb=e67faa588ac375105c0a6d12c79ef93d5499bcab;hp=f2e94aaad24600815d48b09b90efcee9780de28c;hpb=410b5d6536361b7a7376c38efee92263e793fea4;p=senf.git diff --git a/PPI/Connectors.hh b/PPI/Connectors.hh index f2e94aa..0f54dc6 100644 --- a/PPI/Connectors.hh +++ b/PPI/Connectors.hh @@ -28,7 +28,7 @@ #include #include #include -#include "../Utils/SafeBool.hh" +#include "../Utils/safe_bool.hh" #include "../Packets/Packets.hh" #include "predecl.hh" #include "detail/Callback.hh" @@ -55,8 +55,19 @@ namespace connector { All passive connectors call some onRequest callback whenever I/O needs to be performed. All input modules possess a packet queue. - We therefore have 4 connector types: senf::ppi::ActiveInput, senf::ppi::ActiveOutput, - senf::ppi::PassiveInput and senf::ppi::PassiveOutput. + We therefore have 4 connector types: + \li senf::ppi::connector::ActiveInput + \li senf::ppi::connector::ActiveOutput + \li senf::ppi::connector::PassiveInput + \li senf::ppi::connector::PassiveOutput. + + Connectors are declared as module data members and are then externally connected to other + modules. + + \see + senf::ppi::module::Module \n + senf::ppi::connect() + \ref ppi_connectors */ /** \brief Connector base-class @@ -255,6 +266,7 @@ namespace connector { typedef Queue::const_iterator queue_iterator; ///< Iterator type of the embedded queue typedef Queue::size_type size_type; ///< Unsigned type for counting queue elements + Packet operator()(); ///< Get a packet /**< This member is the primary method to access received data. On passive connectors, this operator will just @@ -265,6 +277,8 @@ namespace connector { logic error in the module implementation and an exception is raised. */ + Packet read(); ///< Alias for operator()() + OutputConnector & peer() const; queue_iterator begin() const; ///< Access queue begin (head) @@ -299,7 +313,9 @@ namespace connector { : public virtual Connector { public: - void operator()(Packet p); ///< Send out a packet + void operator()(Packet p); ///< Send out a packet + + void write(Packet p); ///< Alias for operator()(Packet p) InputConnector & peer() const; @@ -318,7 +334,7 @@ namespace connector { */ class PassiveInput : public PassiveConnector, public InputConnector, - public SafeBool + public safe_bool { public: PassiveInput(); @@ -346,7 +362,7 @@ namespace connector { */ class PassiveOutput : public PassiveConnector, public OutputConnector, - public SafeBool + public safe_bool { public: ActiveInput & peer() const; @@ -362,7 +378,7 @@ namespace connector { */ class ActiveInput : public ActiveConnector, public InputConnector, - public SafeBool + public safe_bool { public: PassiveOutput & peer() const; @@ -379,7 +395,7 @@ namespace connector { */ class ActiveOutput : public ActiveConnector, public OutputConnector, - public SafeBool + public safe_bool { public: PassiveInput & peer() const;