Google APIs Client Library for C++
|
#include "client/transport/http_scribe.h"
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. | |
HttpEntryScribe * | scribe () const |
Returns bound scribe. | |
const HttpRequest * | request () const |
Returns bound request. | |
struct timeval & | timeval () 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. |
Entry | ( | HttpEntryScribe * | scribe, |
const HttpRequest * | request | ||
) |
Standard constructor.
[in] | scribe | The scribe constructing the entry. |
[in] | request | The 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.
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.
virtual void Failed | ( | const HttpRequest * | request, |
const util::Status & | status | ||
) | [pure virtual] |
Hook for recording that the request encountered a transport error.
[in] | request | The request encountered a transport error so will never receive a response. It might have been previously sent but might not have. |
[in] | status | Explains 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.
virtual void Received | ( | const HttpRequest * | request | ) | [pure virtual] |
Hook for recording that the request received a response.
[in] | request | The request has a response. The response might be an HTTP failure. |
const HttpRequest* request | ( | ) | const [inline] |
Returns bound request.
HttpEntryScribe* scribe | ( | ) | const [inline] |
Returns bound scribe.
virtual void Sent | ( | const HttpRequest * | request | ) | [pure virtual] |
Hook for recording that the request was sent.
[in] | request | The 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..