Scale Stack 0.3 Developer Documentation

scalestack::database_proxy::client Class Reference

#include <client.h>

Inheritance diagram for scalestack::database_proxy::client:
scalestack::network::stream

Public Member Functions

 client (client_service &creator)
void set_connection (database_proxy::connection *bound_connection, bool need_handshake)
void yield (void)
void connected (void)
size_t read (uint8_t *buffer, size_t size)
void continue_write (void)
void flush_write (void)
void error (void)
void run (void)

Private Types

enum  {
  SERVER_HANDSHAKE_PACKET, SERVER_HANDSHAKE_FLUSH, RESULT_PACKET, RESULT_FLUSH,
  COLUMN_PACKET, COLUMN_FLUSH, ROW_PACKET, ROW_FLUSH
}

Private Member Functions

 client (const client &)
clientoperator= (const client &)
size_t _connection_write (void)

Private Attributes

enum
scalestack::database_proxy::client:: { ... }  
_state
enum
scalestack::database_proxy::client:: { ... }  
_next_state
bool _need_yield
bool _shutdown
size_t _size
size_t _packet_size
uint8_t * _buffer
database_proxy::connection_connection

Detailed Description

Definition at line 37 of file client.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
SERVER_HANDSHAKE_PACKET 
SERVER_HANDSHAKE_FLUSH 
RESULT_PACKET 
RESULT_FLUSH 
COLUMN_PACKET 
COLUMN_FLUSH 
ROW_PACKET 
ROW_FLUSH 

Definition at line 102 of file client.h.


Constructor & Destructor Documentation

scalestack::database_proxy::client::client ( client_service creator  ) 

Definition at line 35 of file client.cc.

scalestack::database_proxy::client::client ( const client  )  [private]

Don't allow copying of objects.


Member Function Documentation

void scalestack::database_proxy::client::set_connection ( database_proxy::connection bound_connection,
bool  need_handshake 
)

Set the connection that uses this client.

Definition at line 48 of file client.cc.

void scalestack::database_proxy::client::yield ( void   ) 

Notify client it should be yielded once current request is complete.

Definition at line 66 of file client.cc.

void scalestack::database_proxy::client::connected ( void   )  [virtual]

Once connected, starting writing data from attached connection.

Reimplemented from scalestack::network::stream.

Definition at line 71 of file client.cc.

size_t scalestack::database_proxy::client::read ( uint8_t *  buffer,
size_t  size 
) [virtual]

See Socket_tCP::connection::read().

Implements scalestack::network::stream.

Definition at line 79 of file client.cc.

void scalestack::database_proxy::client::continue_write ( void   ) 

Continue writing to the connection from the read buffer.

Definition at line 86 of file client.cc.

void scalestack::database_proxy::client::flush_write ( void   )  [virtual]

See Socket_tCP::connection::flush_write().

Implements scalestack::network::stream.

Definition at line 91 of file client.cc.

void scalestack::database_proxy::client::error ( void   ) 

On error, notify attached connection to shutdown.

Definition at line 96 of file client.cc.

void scalestack::database_proxy::client::run ( void   )  [virtual]

Process requests from attached connection on this clients thread.

Reimplemented from scalestack::network::stream.

Definition at line 101 of file client.cc.

client& scalestack::database_proxy::client::operator= ( const client  )  [private]

Don't allow assignment of objects.

size_t scalestack::database_proxy::client::_connection_write ( void   )  [private]

Write data to the connection. This is used by both the read() and continue_write() methods.

Definition at line 116 of file client.cc.


Field Documentation

Definition at line 113 of file client.h.

Definition at line 114 of file client.h.

Definition at line 115 of file client.h.

Definition at line 116 of file client.h.

Definition at line 117 of file client.h.

Definition at line 118 of file client.h.


The documentation for this class was generated from the following files:
Generated on Thu Feb 17 13:10:21 2011 by  doxygen 1.6.3