#include <daytime.h>
Public Member Functions | |
virtual | ~endpoint_daytime () |
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_daytime (int fd) | |
endpoint_daytime () | |
endpoint_daytime (const endpoint_daytime &rhs) | |
endpoint_daytime & | operator= (const endpoint_daytime &rhs) |
Private Attributes | |
char | data [100] |
size_t | data_position |
size_t | data_size |
The plumbing::endpoint_daytime class is used to represent a server that reports the time-of-day in text.
Definition at line 29 of file daytime.h.
plumbing::endpoint_daytime::~endpoint_daytime | ( | ) | [virtual] |
The destructor.
Definition at line 25 of file daytime.cc.
plumbing::endpoint_daytime::endpoint_daytime | ( | int | fd | ) | [private] |
The constructor. It is private on purpose, use the create class method instead.
fd | The file descriptor connected to the client for both reading and writing. |
Definition at line 30 of file daytime.cc.
plumbing::endpoint_daytime::endpoint_daytime | ( | ) | [private] |
The default constructor. Do not use.
plumbing::endpoint_daytime::endpoint_daytime | ( | const endpoint_daytime & | rhs | ) | [private] |
The copy constructor. Do not use.
rhs | The right hand side of the initialisation. |
plumbing::endpoint::pointer plumbing::endpoint_daytime::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_daytime::endpoint_factory method to create new servers when a connection has been accepted.
fd | The file descriptor connected to the client for both reading and writing. |
Definition at line 44 of file daytime.cc.
int plumbing::endpoint_daytime::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.
Reimplemented from plumbing::endpoint.
Definition at line 62 of file daytime.cc.
endpoint_daytime& plumbing::endpoint_daytime::operator= | ( | const endpoint_daytime & | rhs | ) | [private] |
The assignment operator. Do not use.
rhs | The rights hand side of the assignment. |
void plumbing::endpoint_daytime::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 51 of file daytime.cc.
void plumbing::endpoint_daytime::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 69 of file daytime.cc.
char plumbing::endpoint_daytime::data[100] [private] |
size_t plumbing::endpoint_daytime::data_position [private] |
size_t plumbing::endpoint_daytime::data_size [private] |
The data_size instance variable is used to remember how much of the data has been used. This is the limit of the data_position instance variable.