senf::ProtocolClientSocketHandle< SocketProtocol > Class Template Reference
[The Handle Hierarchy]

Protocol specific socket handle (client interface). More...

#include <senf/Socket/ProtocolClientSocketHandle.hh>

Inheritance diagram for senf::ProtocolClientSocketHandle< SocketProtocol >:
Inheritance graph
[legend]

List of all members.


Detailed Description

template<class SocketProtocol>
class senf::ProtocolClientSocketHandle< SocketProtocol >

Protocol specific socket handle (client interface).

The ProtocolClientSocketHandle is the client interface leaf class of the handle hierarchy. This is the class to instantiate to open a new socket. This is also the only class, which can be used to open a client socket.

The Protocol template argument defines the protocol of the socket. This protocol provides the protocol interface of the socket as well as the complete socket policy of this protocol.

The ProtocolClientSocketHandle adds the protocol interface as an additional interface to the socket handle. This interface is only accessible via the protocol class. All socket functionality not available through the policy interface (see ClientSocketHandle) is accessible via the protocol() member.

See also:
The Protocol Classes

Definition at line 62 of file ProtocolClientSocketHandle.hh.


Public Types

typedef SocketProtocol  Protocol
  The sockets protocol.

Public Member Functions

Protocol protocol ()
  Access the protocol interface.
void  state (SocketStateMap &map, unsigned lod=0)
  Inquire state information of socket handle.
std::string  dumpState (unsigned lod=0)
  Format complete state information as string.

Static Public Member Functions

static ProtocolClientSocketHandle  cast_static (FileHandle handle)
static ProtocolClientSocketHandle  cast_dynamic (FileHandle handle)

Structors and default members

  ProtocolClientSocketHandle ()
  Create new client socket.
  ProtocolClientSocketHandle (senf::NoInit_t)
  Create uninitialized socket variable.

Protected Member Functions

  ProtocolClientSocketHandle (FileHandle other, bool isChecked)

Member Typedef Documentation

template<class SocketProtocol>
typedef SocketProtocol senf::ProtocolClientSocketHandle< SocketProtocol >::
Protocol

The sockets protocol.

Definition at line 69 of file ProtocolClientSocketHandle.hh.


Constructor & Destructor Documentation

template<class SocketProtocol >
senf::ProtocolClientSocketHandle< SocketProtocol >::
ProtocolClientSocketHandle ()

Create new client socket.

This constructor is one of the possible constructors. The exact Signature of the constructor (or constructors) is defined by the init_client() member (or members) of the Protocol class. ProtocolClientSocketHandle defines a number of constructors taking up to 9 arguments which just forward to a corresponding Protocolinit_client() member. See the documentation of the respective Protocol class for a detailed documentation of that protocols constructors.

Definition at line 44 of file ProtocolClientSocketHandle.cti.

template<class SocketProtocol >
senf::ProtocolClientSocketHandle< SocketProtocol >::
ProtocolClientSocketHandle ( senf::NoInit_t  )

Create uninitialized socket variable.

This special constructor is called when passing senf::noinit as only argument to the constructor. This will create an in-valid() socket handle which can however be assigned later with another socket instance.

Implementation note:
The socket handle will have no body allocated.

Definition at line 40 of file ProtocolClientSocketHandle.cti.

template<class SocketProtocol >
senf::ProtocolClientSocketHandle< SocketProtocol >::
ProtocolClientSocketHandle ( FileHandle  other,
bool  isChecked )

Definition at line 57 of file ProtocolClientSocketHandle.cti.


Member Function Documentation

template<class SocketProtocol >
senf::ProtocolClientSocketHandle< SocketProtocol > senf::ProtocolClientSocketHandle< SocketProtocol >::
cast_dynamic ( FileHandle  handle )

For internal use only.

Reimplemented from senf::ClientSocketHandle< SocketProtocol::Policy >.

Definition at line 81 of file ProtocolClientSocketHandle.cti.

template<class SocketProtocol >
senf::ProtocolClientSocketHandle< SocketProtocol > senf::ProtocolClientSocketHandle< SocketProtocol >::
cast_static ( FileHandle  handle )

For internal use only.

Reimplemented from senf::ClientSocketHandle< SocketProtocol::Policy >.

Definition at line 74 of file ProtocolClientSocketHandle.cti.

template<class SocketProtocol >
std::string senf::ProtocolClientSocketHandle< SocketProtocol >::
dumpState ( unsigned  lod = 0 )

Format complete state information as string.

Formats the complete state map value and returns it as a single multi-line string.

Parameters:
lod  level of detail requested. The interpretation of this value is protocol specific
Implementation note:
This member will be re-implemented in every derived class. See the state() documentation.

Reimplemented from senf::ClientSocketHandle< SocketProtocol::Policy >.

Definition at line 105 of file ProtocolClientSocketHandle.cti.

template<class SocketProtocol >
SocketProtocol & senf::ProtocolClientSocketHandle< SocketProtocol >::
protocol ()

Access the protocol interface.

The returned protocol class reference gives access to the complete protocol interface as defined by that class. See the respective protocol class documentation.

Returns:
Protocol class reference

Definition at line 63 of file ProtocolClientSocketHandle.cti.

template<class SocketProtocol >
void senf::ProtocolClientSocketHandle< SocketProtocol >::
state ( SocketStateMap map,
unsigned  lod = 0 )

Inquire state information of socket handle.

The map argument (a string to string mapping) will be filled with information covering the current state of the socket. The information provided depends on the socket protocol. The amount of information returned can be controlled using the lod value.

See senf::SocketProtocol::state() for more information, how the Information is generated.

Parameters:
map  string to string mapping to be filled with state information
lod  level of detail requested. The interpretation of this value is protocol specific
Implementation note:
This member will be re-implemented in every derived class. This is very important since state() is not a virtual function (which we don't want since we don't want to add a vtable pointer to every handle instance).

Reimplemented from senf::ClientSocketHandle< SocketProtocol::Policy >.

Definition at line 92 of file ProtocolClientSocketHandle.cti.


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