Howtos/NewPacket: Small fixes
[senf.git] / PPI / Connectors.hh
index ee07dc0..68a0ea4 100644 (file)
@@ -47,8 +47,8 @@ namespace connector {
         \brief Connector classes
 
         A connector has two independent properties
-        \li it may be \e active or \e passive
-        \li it may be an \e input or an \e output
+        - it may be \e active or \e passive
+        - it may be an \e input or an \e output
 
         \e Active connectors are activated from within the module, \e passive connectors are
         signaled by the external framework. \e Input modules receive packets, \e output modules send
@@ -58,10 +58,10 @@ namespace connector {
         input modules possess a packet queue.
 
         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.
+        - senf::ppi::connector::ActiveInput
+        - senf::ppi::connector::ActiveOutput
+        - senf::ppi::connector::PassiveInput
+        - senf::ppi::connector::PassiveOutput.
 
         Connectors are declared as module data members and are then externally connected to other
         modules.
@@ -136,9 +136,9 @@ namespace connector {
 
         Passive connectors always handle two throttling states:
 
-        \li The \e native throttling state is set manually by the module. It is the throttling state
+        - The \e native throttling state is set manually by the module. It is the throttling state
             originating in the current module
-        \li The \e forwarded throttling state is the state as it is received by throttling
+        - The \e forwarded throttling state is the state as it is received by throttling
             notifications
 
         The accumulative throttling state is generated by combining all sub-states.
@@ -460,6 +460,8 @@ namespace connector {
         public:                                                                                   \
             using mixin::operator();                                                              \
             using mixin::TypedConnector_ ## dir ;                                                 \
+        private:                                                                                  \
+             friend class detail::Typed ## dir ## Mixin<type ## dir <PacketType>, PacketType>;    \
         };                                                                                        \
         template <>                                                                               \
         class type ## dir <Packet> : public Generic ## type ## dir                                \
@@ -483,9 +485,9 @@ namespace connector {
         that read packets are returned as \a PacketType instead of generic senf::Packet references.
 
         \see GenericActiveInput \n
-            senf::ppi::connectro
+            senf::ppi::connector
      */
-    template <class PacketType>
+    template <class PacketType=Packet>
     class ActiveInput : public GenericActiveInput
     {
     public:
@@ -526,12 +528,12 @@ namespace connector {
         \see GenericActiveOutput \n
             senf::ppi::connector
      */
-    template <class PacketType>
+    template <class PacketType=Packet>
     class ActiveOutput : public GenericActiveOutput
     {
     public:
-        PacketType operator()();
-        PacketType write();
+        operator()(PacketType packet);  ///< Send out a packet
+        write(PacketType packet);       ///< Alias for operator()
     };
 
     /** \brief Connector passively providing packets
@@ -543,12 +545,12 @@ namespace connector {
         \see GenericPassiveOutput \n
             senf::ppi::connector
      */
-    template <class PacketType>
+    template <class PacketType=Packet>
     class PassiveOutput : public GenericPassiveOutput
     {
     public:
-        PacketType operator()();
-        PacketType write();
+        operator()(PacketType packet);  ///< Send out a packet
+        write(PacketType packet);       ///< Alias for operator()
     };
 
 #endif