Scheduler< Impl, ImplPtr >::UploadReq Class Reference

#include <scheduler.h>

Inheritance diagram for Scheduler< Impl, ImplPtr >::UploadReq:

Inheritance graph
[legend]
Collaboration diagram for Scheduler< Impl, ImplPtr >::UploadReq:

Collaboration graph
[legend]
List of all members.

Detailed Description

template<typename Impl, typename ImplPtr = Impl*>
class Scheduler< Impl, ImplPtr >::UploadReq

Upload request is a request that indicates we wish to send out data to a socket.

The request is to be passed to SchedBase class which in turn calls us back through virtual function doSend() when we are allowed to perform the actual sending.

Definition at line 574 of file scheduler.h.


Public Member Functions

 UploadReq (const SSocketWrapper &s)
 Construct new upload request.
 ~UploadReq ()
 Erase ourselves from s_upReqs map.
virtual uint32_t doSend (uint32_t num)
 Send out data.
virtual void notify () const
 Send notification to client code, requesting more data.
virtual uint32_t getPending () const
 Retrieve number of pending bytes in this request.

Private Member Functions

 UploadReq ()
 Forbidden.

Private Attributes

SSocketWrapper m_obj
 Keeps reference data for socket.

Constructor & Destructor Documentation

template<typename Impl, typename ImplPtr = Impl*>
Scheduler< Impl, ImplPtr >::UploadReq::UploadReq const SSocketWrapper s  )  [inline]
 

Construct new upload request.

Parameters:
s Socket where this request belongs to
buf Pointer to data buffer to be sent

Definition at line 582 of file scheduler.h.

References CHECK_FAIL, Scheduler< Impl, ImplPtr >::UploadReq::m_obj, and Scheduler< Impl, ImplPtr >::s_upReqs.

template<typename Impl, typename ImplPtr = Impl*>
Scheduler< Impl, ImplPtr >::UploadReq::~UploadReq  )  [inline]
 

Erase ourselves from s_upReqs map.

Definition at line 592 of file scheduler.h.

References Scheduler< Impl, ImplPtr >::SSocketWrapper::getSocket(), Scheduler< Impl, ImplPtr >::UploadReq::m_obj, and Scheduler< Impl, ImplPtr >::s_upReqs.

Here is the call graph for this function:

template<typename Impl, typename ImplPtr = Impl*>
Scheduler< Impl, ImplPtr >::UploadReq::UploadReq  )  [private]
 

Forbidden.


Member Function Documentation

template<typename Impl, typename ImplPtr = Impl*>
virtual uint32_t Scheduler< Impl, ImplPtr >::UploadReq::doSend uint32_t  num  )  [inline, virtual]
 

Send out data.

Parameters:
num Number of bytes to send out
Returns:
Number of bytes actually sent out

Implements SchedBase::UploadReqBase.

Definition at line 602 of file scheduler.h.

References Scheduler< Impl, ImplPtr >::SSocketWrapper::getSocket(), SchedBase::instance(), SchedBase::ReqBase::invalidate(), SchedBase::isLimited(), Scheduler< Impl, ImplPtr >::UploadReq::m_obj, and Scheduler< Impl, ImplPtr >::SSocketWrapper::m_outBuffer.

Here is the call graph for this function:

template<typename Impl, typename ImplPtr = Impl*>
virtual uint32_t Scheduler< Impl, ImplPtr >::UploadReq::getPending  )  const [inline, virtual]
 

Retrieve number of pending bytes in this request.

Implements SchedBase::UploadReqBase.

Definition at line 631 of file scheduler.h.

References Scheduler< Impl, ImplPtr >::UploadReq::m_obj, and Scheduler< Impl, ImplPtr >::SSocketWrapper::m_outBuffer.

template<typename Impl, typename ImplPtr = Impl*>
virtual void Scheduler< Impl, ImplPtr >::UploadReq::notify  )  const [inline, virtual]
 

Send notification to client code, requesting more data.

Implements SchedBase::ReqBase.

Definition at line 626 of file scheduler.h.

References Scheduler< Impl, ImplPtr >::UploadReq::m_obj, Scheduler< Impl, ImplPtr >::SSocketWrapper::notify(), and SOCK_WRITE.

Here is the call graph for this function:


Member Data Documentation

template<typename Impl, typename ImplPtr = Impl*>
SSocketWrapper Scheduler< Impl, ImplPtr >::UploadReq::m_obj [private]
 

Keeps reference data for socket.

Definition at line 636 of file scheduler.h.

Referenced by Scheduler< Impl, ImplPtr >::UploadReq::doSend(), Scheduler< Impl, ImplPtr >::UploadReq::getPending(), Scheduler< Impl, ImplPtr >::UploadReq::notify(), Scheduler< Impl, ImplPtr >::UploadReq::UploadReq(), and Scheduler< Impl, ImplPtr >::UploadReq::~UploadReq().


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