senf::ppi Namespace Reference


Namespaces

namespace   connector
  Connector classes.
namespace   detail
namespace   module
  PPI Modules.

Classes

class   DebugEvent
  Manually triggered event. More...
class   EventManager
  Event registry and control. More...
class   EventDescriptor
  Generic event interface base-class. More...
class   EventImplementationHelper
  Internal: Callback forwarders. More...
class   EventImplementation
  Event implementation base class. More...
class   IdleEvent
  Continually signaled event. More...
struct   IntervalTimerEventInfo
  IntervalTimer event information. More...
class   IntervalTimer
  High precision regularly signaled event. More...
struct   IOEventInfo
  IOEvent event information. More...
class   IOEvent
  FileHandle based I/O read/write event. More...
class   ModuleManager
  Internal: Module management. More...
class   QueueingDiscipline
  Queueing discipline base class. More...
class   ThresholdQueueing
  Simple queueing discipline with high and low threshold. More...
class   QueueingAlgorithm
class   QueueingAlgorithmRegistry
class   FIFOQueueingAlgorithm
class   RouteBase
  Routing base class. More...
class   ForwardingRoute
  Forwarding route base class. More...
class   Route
  Route descriptor. More...
class   ConnectedDgramWriter
  Writer for module::ActiveSocketSink / module::PassiveSocketSink. More...
class   TargetDgramWriter
  Writer sending data with ClientSocketHandle::writeto(). More...
class   IPv4SourceForcingDgramWriter
class   IPv6SourceForcingDgramWriter
class   DgramReader
  Reader for module::ActiveSocketSource. More...

Functions

template<class MultiConnectorSource , class MultiConnectorTarget , class A1 , class A2 >
std::pair
< MultiConnectorSource::ConnectorType
&, MultiConnectorTarget::ConnectorType & > 
connect (MultiConnectorSource &source, MultiConnectorTarget &target, A1 const &a1, A2 const &a2)
void  connect (connector::OutputConnector &source, connector::InputConnector &target,...)
  Connect modules.
void  run ()
  Start the network.
void  init ()
  Manually initialize the network.

Function Documentation

void senf::ppi::
connect ( connector::OutputConnector &  source,
connector::InputConnector &  target,
  ... )

Connect modules.

senf::ppi::connect() establishes a connection between two modules or, to be more precise, between two connectors. It will connect any input to any output connector as long as one is active and the other passive.

If a module has an output connector called output, the module may be directly specified as source argument. In the same way, if a module has an input connector called input, the module may be given directly as target argument. This simplifies the most common case of a module with one input and one output connector.

The connect call will check at runtime, whether the two connectors are type-compatible:

  • Either or both of the connectors are untyped (they accept/send arbitrary senf::Packet's)
  • Both connectors send/accept the exactly same packet type.
Depending on the type of input or output, the connect call may require additional arguments. See the respective module documentation for more information
Exceptions:
connector::IncompatibleConnectorsException  if the two connectors are not type compatible.
See also:
Connections

template<class MultiConnectorSource , class MultiConnectorTarget , class A1 , class A2 >
std::pair<MultiConnectorSource::ConnectorType &, MultiConnectorTarget::ConnectorType &> senf::ppi::
connect ( MultiConnectorSource &  source,
MultiConnectorTarget &  target,
A1 const &  a1,
A2 const &  a2 )

void senf::ppi::
init ()

Manually initialize the network.

For debugging purposes, it is sometimes simpler to not use senf::ppi::run() but instead drive the network via explicit calls using the debug modules. However, it is still necessary to initialize the network. This operation is performed by senf::ppi::init().

void senf::ppi::
run ()

Start the network.

Calling senf::ppi::run() will start processing the network. The main event loop is managed by the Scheduler. Before starting the Scheduler main loop, all Module init() members are called.

senf::ppi::run() will return when no more work is to be done, that is when no events are enabled (Since the events are enabled and disabled by the throttle notifications which depend among other things on the packet queues, this is the same as checking for packets in any queue). It is Ok to call senf::ppi::run() multiple times during the program lifetime.

See also:
Running the network