senf::ppi Namespace Reference

Namespaces

 connector
 Connector classes.
 
 detail
 
 module
 PPI Modules.
 

Classes

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

Typedefs

typedef std::function< bool(senf::Packet const &pkt, std::uint32_t usage)> REDFilterCallback
 

Functions

template<class PacketType >
void connect (connector::FastActiveOutput< PacketType > &source, connector::FastPassiveInput< PacketType > &target)
 
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)
 
std::ostream & operator<< (std::ostream &os, QueueBufferAnnotation const &annotation)
 
void connect (connector::OutputConnector &source, connector::InputConnector &target,...)
 Connect modules. More...
 
void run ()
 Start the network. More...
 
void init ()
 Manually initialize the network. More...
 
std::ostream & operator<< (std::ostream &os, ReadTimestamp const &annotation)
 

Typedef Documentation

◆ REDFilterCallback

typedef std::function<bool (senf::Packet const & pkt, std::uint32_t usage)> senf::ppi::REDFilterCallback

Definition at line 48 of file QueueSocketSourceSink.hh.

Function Documentation

◆ connect() [1/3]

template<class PacketType >
void senf::ppi::connect ( connector::FastActiveOutput< PacketType > &  source,
connector::FastPassiveInput< PacketType > &  target 
)

◆ connect() [2/3]

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::IncompatibleConnectorsExceptionif the two connectors are not type compatible.
See also
Connections

◆ connect() [3/3]

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 
)

◆ init()

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().

◆ operator<<() [1/2]

std::ostream& senf::ppi::operator<< ( std::ostream &  os,
ReadTimestamp const &  annotation 
)

◆ operator<<() [2/2]

std::ostream& senf::ppi::operator<< ( std::ostream &  os,
QueueBufferAnnotation const &  annotation 
)

◆ run()

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