Wolframe, 0.0.3

_Wolframe::cmdbind::CommandHandler Class Referenceabstract

Command handler interface. More...

#include <commandHandler.hpp>

Inheritance diagram for _Wolframe::cmdbind::CommandHandler:
_Wolframe::cmdbind::IOFilterCommandHandler

Public Types

enum  Operation { READ, WRITE, CLOSE }
 Operation type. More...
 

Public Member Functions

 CommandHandler ()
 Defaul constructor. More...
 
virtual ~CommandHandler ()
 Destructor. More...
 
virtual Operation nextOperation ()=0
 Get the next operation to do for the connection handler. More...
 
virtual void putInput (const void *begin, std::size_t bytesTransferred, bool eod)=0
 Passes the network input to the command handler (READ operation) More...
 
virtual void getOutput (const void *&begin, std::size_t &bytesToTransfer)=0
 Get the next output chunk from the command handler (WRITE operation) More...
 
const char * lastError () const
 Get the last error message of command execution to be returned to the client. More...
 
void setLastError (const std::string &msg)
 Set the last error message of command execution to be returned to the client. More...
 
virtual void setExecContext (proc::ExecContext *c)
 Pass the reference to the execution context to the command handler. More...
 
proc::ExecContextexecContext ()
 Get the reference to the processor provider. More...
 
const types::DoctypeInfodoctypeInfo () const
 Get info about processed document type. More...
 
virtual void setDoctypeInfo (const types::DoctypeInfoR &doctypeinfo_)
 Set info about processed document type. More...
 
std::size_t outputChunkSize () const
 Get a hint for the size of output chunks in bytes. More...
 
virtual void setOutputChunkSize (std::size_t outputChunkSize_)
 Set a hint for the size of output chunks in bytes. More...
 

Private Attributes

std::string m_lastError
 Error operation for the client. More...
 
proc::ExecContextm_execContext
 The reference to the execution context of the connection. More...
 
types::DoctypeInfoR m_doctypeinfo
 Document type information. More...
 
std::size_t m_outputChunkSize
 Hint for the size of output chunks. More...
 

Detailed Description

Command handler interface.

Member Enumeration Documentation

Operation type.

Enumerator
READ 
WRITE 

<request to read data

CLOSE 

<request to write data

<request to terminate processing

Constructor & Destructor Documentation

_Wolframe::cmdbind::CommandHandler::CommandHandler ( )
inline

Defaul constructor.

virtual _Wolframe::cmdbind::CommandHandler::~CommandHandler ( )
inlinevirtual

Destructor.

Member Function Documentation

const types::DoctypeInfo* _Wolframe::cmdbind::CommandHandler::doctypeInfo ( ) const
inline

Get info about processed document type.

proc::ExecContext* _Wolframe::cmdbind::CommandHandler::execContext ( )
inline

Get the reference to the processor provider.

Returns
the reference to the processor provider
virtual void _Wolframe::cmdbind::CommandHandler::getOutput ( const void *&  begin,
std::size_t &  bytesToTransfer 
)
pure virtual

Get the next output chunk from the command handler (WRITE operation)

Parameters
[out]beginstart of the output chunk
[out]bytesToTransfersize of the output chunk to send in bytes

Implemented in _Wolframe::cmdbind::IOFilterCommandHandler.

const char* _Wolframe::cmdbind::CommandHandler::lastError ( ) const
inline

Get the last error message of command execution to be returned to the client.

virtual Operation _Wolframe::cmdbind::CommandHandler::nextOperation ( )
pure virtual

Get the next operation to do for the connection handler.

Returns
the next operation for the connection handler

Implemented in _Wolframe::cmdbind::IOFilterCommandHandler.

std::size_t _Wolframe::cmdbind::CommandHandler::outputChunkSize ( ) const
inline

Get a hint for the size of output chunks in bytes.

virtual void _Wolframe::cmdbind::CommandHandler::putInput ( const void *  begin,
std::size_t  bytesTransferred,
bool  eod 
)
pure virtual

Passes the network input to the command handler (READ operation)

Parameters
[in]beginstart of the network input block.
[in]bytesTransferrednumber of bytes passed in the input block
[in]eod(end of data) true, if the passed chunk is the last one

Implemented in _Wolframe::cmdbind::IOFilterCommandHandler.

virtual void _Wolframe::cmdbind::CommandHandler::setDoctypeInfo ( const types::DoctypeInfoR doctypeinfo_)
inlinevirtual

Set info about processed document type.

virtual void _Wolframe::cmdbind::CommandHandler::setExecContext ( proc::ExecContext c)
inlinevirtual

Pass the reference to the execution context to the command handler.

Parameters
[in]cthe reference to the execution context owned by the caller (connection)
void _Wolframe::cmdbind::CommandHandler::setLastError ( const std::string &  msg)
inline

Set the last error message of command execution to be returned to the client.

virtual void _Wolframe::cmdbind::CommandHandler::setOutputChunkSize ( std::size_t  outputChunkSize_)
inlinevirtual

Set a hint for the size of output chunks in bytes.

Reimplemented in _Wolframe::cmdbind::IOFilterCommandHandler.

Member Data Documentation

types::DoctypeInfoR _Wolframe::cmdbind::CommandHandler::m_doctypeinfo
private

Document type information.

proc::ExecContext* _Wolframe::cmdbind::CommandHandler::m_execContext
private

The reference to the execution context of the connection.

std::string _Wolframe::cmdbind::CommandHandler::m_lastError
private

Error operation for the client.

std::size_t _Wolframe::cmdbind::CommandHandler::m_outputChunkSize
private

Hint for the size of output chunks.


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