Scale Stack 0.3 Developer Documentation

scalestack::database_proxy::connection Class Reference

#include <connection.h>

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

Public Member Functions

 connection (service &creator)
size_t read (uint8_t *buffer, size_t size)
void continue_write (void)
void flush_write (void)
void error (void)
void run (void)
void yield (void)

Private Types

enum  { CLIENT_HANDSHAKE_PACKET, CLIENT_HANDSHAKE_FLUSH, COMMAND_PACKET, COMMAND_FLUSH }

Private Member Functions

 connection (const connection &)
connectionoperator= (const connection &)
size_t _client_write (void)

Private Attributes

enum
scalestack::database_proxy::connection:: { ... }  
_state
bool _need_handshake
bool _need_yield
bool _in_transaction
bool _shutdown
size_t _size
size_t _packet_size
uint8_t * _buffer
client_client

Detailed Description

Definition at line 37 of file connection.h.


Member Enumeration Documentation

anonymous enum [private]
Enumerator:
CLIENT_HANDSHAKE_PACKET 
CLIENT_HANDSHAKE_FLUSH 
COMMAND_PACKET 
COMMAND_FLUSH 

Definition at line 91 of file connection.h.


Constructor & Destructor Documentation

scalestack::database_proxy::connection::connection ( service creator  ) 

Definition at line 35 of file connection.cc.

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

Don't allow copying of objects.


Member Function Documentation

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

See network::stream::read().

Implements scalestack::network::stream.

Definition at line 50 of file connection.cc.

void scalestack::database_proxy::connection::continue_write ( void   ) 

Continue writing to the client from the read buffer.

Definition at line 57 of file connection.cc.

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

See network::stream::flush_write().

Implements scalestack::network::stream.

Definition at line 62 of file connection.cc.

void scalestack::database_proxy::connection::error ( void   ) 

Start shutdown process.

Definition at line 68 of file connection.cc.

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

Process shutdown requests, detaching from client.

Reimplemented from scalestack::network::stream.

Definition at line 74 of file connection.cc.

void scalestack::database_proxy::connection::yield ( void   ) 

Notify connection it can yielf the client now.

Definition at line 100 of file connection.cc.

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

Don't allow assignment of objects.

size_t scalestack::database_proxy::connection::_client_write ( void   )  [private]

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

Definition at line 110 of file connection.cc.


Field Documentation

Definition at line 98 of file connection.h.

Definition at line 99 of file connection.h.

Definition at line 100 of file connection.h.

Definition at line 101 of file connection.h.

Definition at line 102 of file connection.h.

Definition at line 103 of file connection.h.

Definition at line 104 of file connection.h.

Definition at line 105 of file connection.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