senf::ppi::connector Namespace Reference

Connector classes. More...

Classes

class  ActiveConnector
 Active connector base-class. More...
 
class  ActiveInput
 Connector actively reading packets. More...
 
class  ActiveInputJack
 Jack with packet type referencing an ActiveInput. More...
 
class  ActiveOutput
 Connector actively sending packets. More...
 
class  ActiveOutputJack
 Jack with packet type referencing an ActiveOutput. More...
 
class  Connector
 Connector base-class. More...
 
struct  DuplicateConnectionException
 
class  FastActiveOutput
 Fast active output connector. More...
 
class  FastConnector
 
class  FastPassiveInput
 Fast passive input connector. More...
 
class  GenericActiveInput
 Combination of ActiveConnector and InputConnector. More...
 
class  GenericActiveInputJack
 Jack referencing an ActiveInput. More...
 
class  GenericActiveOutput
 Combination of ActiveConnector and OutputConnector. More...
 
class  GenericActiveOutputJack
 Jack referencing an ActiveOutput. More...
 
class  GenericPassiveInput
 Combination of PassiveConnector and InputConnector. More...
 
class  GenericPassiveInputJack
 Jack referencing a PassiveInput. More...
 
class  GenericPassiveOutput
 Combination of PassiveConnector and OutputConnector. More...
 
class  GenericPassiveOutputJack
 Jack referencing a PassiveOutput. More...
 
struct  IncompatibleConnectorsException
 Incompatible connectors connected. More...
 
class  InputConnector
 Input connector base-class. More...
 
class  Jack
 Connector Jack base class. More...
 
class  OutputConnector
 Output connector base-class. More...
 
class  PassiveConnector
 Passive connector base-class. More...
 
class  PassiveInput
 Connector passively receiving packets. More...
 
class  PassiveInputJack
 Jack with packet type referencing a PassiveInput. More...
 
class  PassiveOutput
 Connector passively providing packets. More...
 
class  PassiveOutputJack
 Jack with packet type referencing a PassiveOutput. More...
 

Functions

 SENF_CONSOLE_REGISTER_ENUM_MEMBER (Connector, TraceState,(NO_TRACING)(TRACE_IDS)(TRACE_CONTENTS))
 

Detailed Description

Connector classes.

A connector has three independent properties

  • it may be active or passive
  • it may be an input or an output
  • it has an (optional) packet type

Active connectors are activated from within the module, passive connectors are signaled by the external framework. Input connectors receive packets, output connectors send packets.

All passive connectors call some onRequest callback whenever I/O needs to be performed. All input connectors possess a packet queue.

We therefore have 4 connector types each of which is parameterized by the type of packet traversing the connector:

Connectors are declared as module data members and are then externally connected to other modules.

The connectors each take an optional template argument. If this argument is specified, it must be the type of packet expected or sent on this connector. If it is not specified, packets will be passed using the generic Packet handle.

class IpFilter : public senf::ppi::module::Module
{
SENF_PPI_MODULE(SomeModule);
public:
IpFilter() {
route(input, output);
input.onRequest(&IpFilter::onRequest);
}
private:
void onRequest() {
// 'input()' will return a senf::EthernetPacket packet handle
try { output( input().find<senf::IpPacket>() ); }
}
};

Jacks

    A Jack is a packet type aware and possibly packet type converting reference to an arbitrary
    connector of the same type. Jacks are used in groups to indirectly declare the input's and
    output's
class MyGroup
{
private:
public:
MyGroup()
: queue (), analyzer (), input (queue.input), output (analyzer.output)
{
senf::ppi::connect(queue, analyzer);
}
};
    The jacks are initialized by passing an arbitrary compatible connector to the jack
    constructor. A connector is compatible, if
    \li It has the same input/output active/passive specification
    \li Either the Jack or the Connector are generic (senf::Packet) or Jack and Connector have
        the same packet type

    Jacks can be used wherever connectors may be used. Jacks may be defined anywhere, not only
    in modules. It is however important to ensure that the lifetime of the jack does not exceed
    the lifetime of the referenced connector.

    \see
        senf::ppi::module::Module \n
        senf::ppi::connect() \n
        \ref ppi_connectors

Function Documentation

◆ SENF_CONSOLE_REGISTER_ENUM_MEMBER()

senf::ppi::connector::SENF_CONSOLE_REGISTER_ENUM_MEMBER ( Connector  ,
TraceState  ,
(NO_TRACING)(TRACE_IDS)(TRACE_CONTENTS)   
)