Skip to content
Snippets Groups Projects
Commit e01ba6d7 authored by g0dil's avatar g0dil
Browse files

PPI: Extend ppi::connect() / connector compatibility documentation

parent 65dd34c6
No related branches found
No related tags found
No related merge requests found
...@@ -47,9 +47,10 @@ namespace connector { ...@@ -47,9 +47,10 @@ namespace connector {
/** \namespace senf::ppi::connector /** \namespace senf::ppi::connector
\brief Connector classes \brief Connector classes
A connector has two independent properties A connector has three independent properties
- it may be \e active or \e passive \li it may be \e active or \e passive
- it may be an \e input or an \e output \li it may be an \e input or an \e output
\li it has an (optional) packet type
\e Active connectors are activated from within the module, \e passive connectors are \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 signaled by the external framework. \e Input modules receive packets, \e output modules send
...@@ -58,11 +59,12 @@ namespace connector { ...@@ -58,11 +59,12 @@ namespace connector {
All passive connectors call some onRequest callback whenever I/O needs to be performed. All All passive connectors call some onRequest callback whenever I/O needs to be performed. All
input modules possess a packet queue. input modules possess a packet queue.
We therefore have 4 connector types: We therefore have 4 connector types each of which is parameterized by the type of packet
- senf::ppi::connector::ActiveInput traversing the connector:
- senf::ppi::connector::ActiveOutput \li senf::ppi::connector::ActiveInput
- senf::ppi::connector::PassiveInput \li senf::ppi::connector::ActiveOutput
- senf::ppi::connector::PassiveOutput. \li senf::ppi::connector::PassiveInput
\li senf::ppi::connector::PassiveOutput.
Connectors are declared as module data members and are then externally connected to other Connectors are declared as module data members and are then externally connected to other
modules. modules.
...@@ -100,6 +102,16 @@ namespace connector { ...@@ -100,6 +102,16 @@ namespace connector {
\ref ppi_connectors \ref ppi_connectors
*/ */
/** \brief Incompatible connectors connected
This exception is thrown, when two incompatible connectors are connected. This happens if
both connectors of a senf::ppi::connect() statement declare a packet type (the connector
template argument) but they don't declare the same packet type.
You need to ensure, that both connectors use the same packet type.
\see senf::ppi::connect()
*/
struct IncompatibleConnectorsException : public senf::Exception struct IncompatibleConnectorsException : public senf::Exception
{ IncompatibleConnectorsException() : senf::Exception("Incompatible connectors") {} }; { IncompatibleConnectorsException() : senf::Exception("Incompatible connectors") {} };
......
...@@ -52,7 +52,8 @@ namespace ppi { ...@@ -52,7 +52,8 @@ namespace ppi {
\li Either or both of the connectors are untyped (they accept/send arbitrary senf::Packet's) \li Either or both of the connectors are untyped (they accept/send arbitrary senf::Packet's)
\li Both connectors send/accept the exactly same packet type. \li Both connectors send/accept the exactly same packet type.
\throws IncompatibleConnectorsException if the two connectors are not type compatible. \throws connector::IncompatibleConnectorsException if the two connectors are not type
compatible.
\see \ref ppi_connections \see \ref ppi_connections
*/ */
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment