plumbing::endpoint_chargen Class Reference

#include <chargen.h>

Inheritance diagram for plumbing::endpoint_chargen:
plumbing::endpoint

Public Member Functions

virtual ~endpoint_chargen ()

Static Public Member Functions

static pointer create (int fd)

Protected Member Functions

int get_write_file_descriptor ()
void process_read ()
void process_write ()

Private Member Functions

 endpoint_chargen (int fd)
 endpoint_chargen ()
 endpoint_chargen (const endpoint_chargen &rhs)
endpoint_chargenoperator= (const endpoint_chargen &rhs)

Private Attributes

size_t sequence
char data [74]
size_t data_size
size_t data_position

Detailed Description

The plumbing::endpoint_chargen class is used to represent a server that gerenerates test as spefified in RFC864.

Definition at line 30 of file chargen.h.


Constructor & Destructor Documentation

plumbing::endpoint_chargen::~endpoint_chargen (  )  [virtual]

The destructor.

Definition at line 25 of file chargen.cc.

plumbing::endpoint_chargen::endpoint_chargen ( int  fd  )  [private]

The constructor. It is private on purpose, use the create class method instead.

Parameters:
fd The file descriptor connected to the client for both reading and writing.

Definition at line 30 of file chargen.cc.

plumbing::endpoint_chargen::endpoint_chargen (  )  [private]

The default constructor. Do not use.

plumbing::endpoint_chargen::endpoint_chargen ( const endpoint_chargen rhs  )  [private]

The copy constructor. Do not use.

Parameters:
rhs The right hand side of the initialisation.

Member Function Documentation

plumbing::endpoint::pointer plumbing::endpoint_chargen::create ( int  fd  )  [static]

The create class methods is used to create new dynamically allocated instances of this class. Typically it is used by the plumbing::endpoint_listener_chargen::endpoint_factory method to create new servers when a connection has been accepted.

Parameters:
fd The file descriptor connected to the client for both reading and writing.

Definition at line 40 of file chargen.cc.

int plumbing::endpoint_chargen::get_write_file_descriptor (  )  [protected, virtual]

The get_write_file_descriptor method is used to obtain the file descriptor that select is to wait upon for write events. The default implementation returns -1.

Returns:
int; >=0 for a valid file descriptior, or -1 if write events should not be waited for.
Note:
This method need not returns the same file descriptor as returned by the get_read_file_descriptor method. You could, for example, use dup(2) to separate the two.
DO NOT close the file descriptor and set it to -1 in this method. Do that in the process_write method instead, otherwise you confuse the select() processing.

Reimplemented from plumbing::endpoint.

Definition at line 58 of file chargen.cc.

endpoint_chargen& plumbing::endpoint_chargen::operator= ( const endpoint_chargen rhs  )  [private]

The assignment operator. Do not use.

Parameters:
rhs The rights hand side of the assignment.
void plumbing::endpoint_chargen::process_read (  )  [protected, virtual]

The process_read method is called by the select loop when a readable event is detected on the read file descriptor.

Implements plumbing::endpoint.

Definition at line 47 of file chargen.cc.

void plumbing::endpoint_chargen::process_write (  )  [protected, virtual]

The process_write method is called by the select loop when a writable event is detected on the read file descriptor.

Implements plumbing::endpoint.

Definition at line 65 of file chargen.cc.


Field Documentation

The data instance variable used to remember the data to be transmitted.

Definition at line 84 of file chargen.h.

the data_position instance variable is used to remember where we are up to in transmitting the data.

Definition at line 96 of file chargen.h.

The data_size instance variable is used to remember how much data has been initialized int he data array.

Definition at line 90 of file chargen.h.

The sequence instance variable is used to remember the start point for the line cycles we are to generate.

Definition at line 78 of file chargen.h.


The documentation for this class was generated from the following files:
Generated on Thu Sep 16 14:51:27 2010 for Plumbing by  doxygen 1.6.3