senf::ppi::module::ActiveSocketSink< Writer > Class Template Reference
[Source/Sink Modules]

Output module writing data to a FileHandle using the provided Writer. If using the default ConnectedDgramWriter the filehandle must be writable, connected and able to handle complete datagrams. More...

#include <senf/PPI/SocketSink.hh>

Inheritance diagram for senf::ppi::module::ActiveSocketSink< Writer >:
Inheritance graph
[legend]

List of all members.


Detailed Description

template<class Writer = ConnectedDgramWriter>
class senf::ppi::module::ActiveSocketSink< Writer >

Output module writing data to a FileHandle using the provided Writer. If using the default ConnectedDgramWriter the filehandle must be writable, connected and able to handle complete datagrams.

This output module will write data to a FileHandle object using a given Writer. This output module is active. This requires the file handle to be able to signal its readiness to accept more data via the Scheduler.

The default Writer is senf::ppi::ConnectedDgramWriter which will write out the complete packet to the file handle.

A Writer must fulfill the following interface:

  class SomeWriter
  {
  public:
      typedef unspecified Handle;                          // type of handle requested
      typedef unspecified_type PacketType                  // type of packet read

      SomeWriter();                                        // EITHER default constructible OR
      SomeWriter(SomeWriter const & other);                // copy constructible

      bool operator()(Handle handle, Packet packet);       // insertion function
  };
Whenever a packet is received for sending, the Writer's operator() is called.

Definition at line 195 of file SocketSink.hh.


Public Types

typedef Writer::Handle  Handle
  Handle type requested by writer.

Public Member Functions

  ActiveSocketSink ()
  Create non-connected writer.
  ActiveSocketSink (Writer const &writer)
  Create non-connected writer.
  ActiveSocketSink (Handle const &handle)
  Create new writer for the given handle.
  ActiveSocketSink (Handle const &handle, Writer const &writer)
  Create new writer for the given handle.
Writer &  writer ()
  Access the Writer.
Handle  handle ()
  Access handle.
void  handle (Handle const &handle)
  Set handle.

Public Attributes

connector::ActiveInput
< typename Writer::PacketType > 
input
  Input connector from which data is received.

Member Typedef Documentation

template<class Writer = ConnectedDgramWriter>
typedef Writer::Handle senf::ppi::module::ActiveSocketSink< Writer >::
Handle

Handle type requested by writer.

Definition at line 197 of file SocketSink.hh.


Constructor & Destructor Documentation

template<class Writer >
senf::ppi::module::ActiveSocketSink< Writer >::
ActiveSocketSink ()

Create non-connected writer.

The writer will be disabled until a socket is set

Precondition:
Requires Writer to be default constructible

Definition at line 37 of file SocketSink.ct.

template<class Writer>
senf::ppi::module::ActiveSocketSink< Writer >::
ActiveSocketSink ( Writer const &  writer )

Create non-connected writer.

The writer will be disabled until a socket is set

Precondition:
Requires Writer to be copy constructible
Parameters:
[in]  writer  Writer helper writing packet date to the socket

Definition at line 44 of file SocketSink.ct.

template<class Writer>
senf::ppi::module::ActiveSocketSink< Writer >::
ActiveSocketSink ( Handle const &  handle )

Create new writer for the given handle.

Data will be written to handle using Writer.

Precondition:
Requires Writer to be default constructible
Parameters:
[in]  handle  Handle to write data to

Definition at line 52 of file SocketSink.ct.

template<class Writer>
senf::ppi::module::ActiveSocketSink< Writer >::
ActiveSocketSink ( Handle const &  handle,
Writer const &  writer )

Create new writer for the given handle.

Data will be written to handle using Writer.

Precondition:
Requires Writer to be copy constructible
Parameters:
[in]  handle  Handle to write data to
[in]  writer  Writer helper writing packet date to the socket

Definition at line 60 of file SocketSink.ct.


Member Function Documentation

template<class Writer >
void senf::ppi::module::ActiveSocketSink< Writer >::
handle ( Handle const &  handle )

Set handle.

Assigning an empty or in-valid() handle will disable the module until a new. valid handle is assigned.

Definition at line 87 of file SocketSink.cti.

template<class Writer >
senf::ppi::module::ActiveSocketSink< Writer >::Handle senf::ppi::module::ActiveSocketSink< Writer >::
handle ()

Access handle.

Definition at line 81 of file SocketSink.cti.

template<class Writer >
Writer & senf::ppi::module::ActiveSocketSink< Writer >::
writer ()

Access the Writer.

Definition at line 74 of file SocketSink.cti.


Member Data Documentation

template<class Writer = ConnectedDgramWriter>
connector::ActiveInput<typename Writer::PacketType> senf::ppi::module::ActiveSocketSink< Writer >::
input

Input connector from which data is received.

Definition at line 202 of file SocketSink.hh.


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