Google APIs Client Library for C++
HttpEntryScribe::Entry Class Reference

#include "client/transport/http_scribe.h"

List of all members.

Public Member Functions

 Entry (HttpEntryScribe *scribe, const HttpRequest *request)
 Standard constructor.
virtual void FlushAndDestroy ()=0
 Finish recording the entry instance and destroy it.
virtual void CancelAndDestroy ()
 Destroys instance without flushing it so may forget about it.
virtual void Sent (const HttpRequest *request)=0
 Hook for recording that the request was sent.
virtual void Received (const HttpRequest *request)=0
 Hook for recording that the request received a response.
virtual void Failed (const HttpRequest *request, const util::Status &status)=0
 Hook for recording that the request encountered a transport error.
int64 MicrosElapsed () const
 Returns the age of this intance.
HttpEntryScribescribe () const
 Returns bound scribe.
const HttpRequestrequest () const
 Returns bound request.
struct timevaltimeval () const
 Returns time instance was constructed.
bool done () const
 Returns true if the request has completed.
void set_done (bool is_done)
 Informs the entry that the reqeust has finished.

Protected Member Functions

virtual ~Entry ()
 Do not explicitly call this destructor.

Constructor & Destructor Documentation

Entry ( HttpEntryScribe scribe,
const HttpRequest request 
)

Standard constructor.

Parameters:
[in]scribeThe scribe constructing the entry.
[in]requestThe request that the entry is for.

Caller should call either CancelAndDestroy or FlushAndDestroy when done.

virtual ~Entry ( ) [protected, virtual]

Do not explicitly call this destructor.

See also:
FlushAndDestroy
CancelAndDestroy

Member Function Documentation

virtual void CancelAndDestroy ( ) [virtual]

Destroys instance without flushing it so may forget about it.

Intended to destory an instance without recording it.

bool done ( ) const [inline]

Returns true if the request has completed.

If this is true then the request might have been destroyed already.

The request will always be valid in the Sent, Received, and Failed methods.

Returns:
true If the request is known to have finished.
virtual void Failed ( const HttpRequest request,
const util::Status status 
) [pure virtual]

Hook for recording that the request encountered a transport error.

Parameters:
[in]requestThe request encountered a transport error so will never receive a response. It might have been previously sent but might not have.
[in]statusExplains te error.
virtual void FlushAndDestroy ( ) [pure virtual]

Finish recording the entry instance and destroy it.

The entry has finished so should finish recording. Ownershp is passed so that it can be destroyed. The entry is no longer in the scribe's map or queue.

This is called from the scribe within a critical section so does not have to worry about threads.

int64 MicrosElapsed ( ) const

Returns the age of this intance.

Returns:
microseconds since constructed.
virtual void Received ( const HttpRequest request) [pure virtual]

Hook for recording that the request received a response.

Parameters:
[in]requestThe request has a response. The response might be an HTTP failure.
const HttpRequest* request ( ) const [inline]

Returns bound request.

Returns:
request bound in constructor.
HttpEntryScribe* scribe ( ) const [inline]

Returns bound scribe.

Returns:
scribe bound in constructor.
virtual void Sent ( const HttpRequest request) [pure virtual]

Hook for recording that the request was sent.

Parameters:
[in]requestThe request is about to be executed.
void set_done ( bool  is_done) [inline]

Informs the entry that the reqeust has finished.

This method is called internally so you do not need to call this..

struct timeval& timeval ( ) const [inline, read]

Returns time instance was constructed.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines