senf::ppi::connector::PassiveConnector Class Reference

Passive connector base-class. More...

#include <senf/PPI/Connectors.hh>

Inheritance diagram for senf::ppi::connector::PassiveConnector:

Public Member Functions

 ~PassiveConnector ()
 
template<class Handler >
void onRequest (Handler handler)
 Register I/O event handler. More...
 
bool throttled () const
 Get accumulative throttling state. More...
 
bool nativeThrottled () const
 Get native throttling state. More...
 
void throttle ()
 Set native throttling. More...
 
void unthrottle ()
 Revoke native throttling. More...
 
ActiveConnectorpeer () const
 
- Public Member Functions inherited from senf::ppi::connector::Connector
Connectorpeer () const
 Get peer connected to this connector. More...
 
module::Modulemodule () const
 Get this connectors containing module. More...
 
bool connected () const
 true, if connector connected, false otherwise More...
 
void disconnect ()
 Disconnect connector from peer. More...
 
console::DirectoryNodeconsoleDir () const
 
void tracingState (TraceState state)
 
TraceState tracingState () const
 

Protected Member Functions

 PassiveConnector ()
 
void emit ()
 
virtual void v_disconnected ()
 
virtual void v_connected ()
 
- Protected Member Functions inherited from senf::ppi::connector::Connector
 Connector ()
 
virtual ~Connector ()
 
void connect (Connector &target)
 
void trace (Packet const &p, char const *label)
 
void throttleTrace (char const *label, char const *type)
 
void unregisterConnector ()
 

Additional Inherited Members

- Public Types inherited from senf::ppi::connector::Connector
enum  TraceState { NO_TRACING, TRACE_IDS, TRACE_CONTENTS }
 
- Static Public Member Functions inherited from senf::ppi::connector::Connector
static void staticTracingState (TraceState state)
 
static void tracingFilter (std::string const &traceFilter)
 

Detailed Description

Passive connector base-class.

A passive connector is a connector which is activated externally whenever an I/O request occurs. Passive connectors are the origin of throttling notifications. Depending on the type of connector (output or input) the respective throttling is called forward or backward throttling.

Passive connectors always handle two throttling states:

  • The native throttling state is set manually by the module. It is the throttling state originating in the current module
  • The forwarded throttling state is the state as it is received by throttling notifications

The accumulative throttling state is generated by combining all sub-states.

Definition at line 231 of file Connectors.hh.

Constructor & Destructor Documentation

◆ ~PassiveConnector()

senf::ppi::connector::PassiveConnector::~PassiveConnector ( )

Definition at line 272 of file Connectors.cc.

◆ PassiveConnector()

senf::ppi::connector::PassiveConnector::PassiveConnector ( )
protected

Definition at line 265 of file Connectors.cc.

Member Function Documentation

◆ emit()

void senf::ppi::connector::PassiveConnector::emit ( )
protected

◆ nativeThrottled()

bool senf::ppi::connector::PassiveConnector::nativeThrottled ( ) const

Get native throttling state.

◆ onRequest()

template<class Handler >
void senf::ppi::connector::PassiveConnector::onRequest ( Handler  handler)

Register I/O event handler.

The registered handler will be called, whenever packets arrive or should be generated by the module depending on the connector type (input or output). The handler argument is either an arbitrary callable object or it is a pointer-to-member to a member of the class which holds this input. In the second case, the pointer will automatically be bound to the containing instance.

Parameters
[in]handlerHandler to call, whenever an I/O operation is to be performed.

◆ peer()

ActiveConnector& senf::ppi::connector::PassiveConnector::peer ( ) const

◆ throttle()

void senf::ppi::connector::PassiveConnector::throttle ( )

Set native throttling.

◆ throttled()

bool senf::ppi::connector::PassiveConnector::throttled ( ) const

Get accumulative throttling state.

◆ unthrottle()

void senf::ppi::connector::PassiveConnector::unthrottle ( )

Revoke native throttling.

◆ v_connected()

void senf::ppi::connector::PassiveConnector::v_connected ( )
protectedvirtual

◆ v_disconnected()

void senf::ppi::connector::PassiveConnector::v_disconnected ( )
protectedvirtual

The documentation for this class was generated from the following files: