0.9.8.10
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Protected Attributes | List of all members
Hypertable::ResponseCallback Class Reference

This class is used to generate and deliver standard responses back to a client. More...

#include <ResponseCallback.h>

Inheritance diagram for Hypertable::ResponseCallback:
Inheritance graph
[legend]
Collaboration diagram for Hypertable::ResponseCallback:
Collaboration graph
[legend]

Public Member Functions

 ResponseCallback (Comm *comm, EventPtr &event)
 Constructor. More...
 
 ResponseCallback ()
 Default constructor. More...
 
virtual ~ResponseCallback ()
 Destructor. More...
 
virtual int error (int error, const String &msg)
 Sends a standard error response back to the client. More...
 
virtual int response_ok ()
 Sends a a simple success response back to the client which is just the 4-byte error code Error::OK. More...
 
void get_address (struct sockaddr_in &addr)
 Gets the remote address of the requesting client. More...
 
const InetAddr get_address () const
 Gets the remote address of the requesting client. More...
 
EventPtrevent ()
 Get smart pointer to event object that triggered the request. More...
 

Protected Attributes

Commm_comm
 Comm pointer. More...
 
EventPtr m_event
 Smart pointer to event object. More...
 

Detailed Description

This class is used to generate and deliver standard responses back to a client.

Definition at line 46 of file ResponseCallback.h.

Constructor & Destructor Documentation

Hypertable::ResponseCallback::ResponseCallback ( Comm comm,
EventPtr event 
)
inline

Constructor.

Initializes a pointer to the Comm object and saves a pointer to the event that triggered the request.

Parameters
commPointer to the Comm object
eventSmart pointer to the event that generated the request

Definition at line 56 of file ResponseCallback.h.

Hypertable::ResponseCallback::ResponseCallback ( )
inline

Default constructor.

Definition at line 61 of file ResponseCallback.h.

virtual Hypertable::ResponseCallback::~ResponseCallback ( )
inlinevirtual

Destructor.

Definition at line 64 of file ResponseCallback.h.

Member Function Documentation

int ResponseCallback::error ( int  error,
const String msg 
)
virtual

Sends a standard error response back to the client.

The response message that is generated and sent back has the following format:

  [int32] error code
  [int16] error message length
  [chars] error message
Parameters
errorError code
msgError message
Returns
Error::OK on success or error code on failure

Reimplemented in Hypertable::RangeServer::Response::Callback::PhantomUpdate.

Definition at line 42 of file ResponseCallback.cc.

EventPtr& Hypertable::ResponseCallback::event ( )
inline

Get smart pointer to event object that triggered the request.

Returns
Smart pointer to event object that triggered the request.

Definition at line 103 of file ResponseCallback.h.

void Hypertable::ResponseCallback::get_address ( struct sockaddr_in &  addr)
inline

Gets the remote address of the requesting client.

Parameters
addrReference to address structure to hold result

Definition at line 89 of file ResponseCallback.h.

const InetAddr Hypertable::ResponseCallback::get_address ( ) const
inline

Gets the remote address of the requesting client.

Returns
Remote address

Definition at line 96 of file ResponseCallback.h.

int ResponseCallback::response_ok ( )
virtual

Sends a a simple success response back to the client which is just the 4-byte error code Error::OK.

This can be used to signal success for all methods that don't have return values.

Returns
Error::OK on success or error code on failure

Reimplemented in Hypertable::RangeServer::Response::Callback::PhantomUpdate.

Definition at line 55 of file ResponseCallback.cc.

Member Data Documentation

Comm* Hypertable::ResponseCallback::m_comm
protected

Comm pointer.

Definition at line 106 of file ResponseCallback.h.

EventPtr Hypertable::ResponseCallback::m_event
protected

Smart pointer to event object.

Definition at line 107 of file ResponseCallback.h.


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