Google APIs Client Library for C++
JsonPlaybackTransportFactory Class Reference

A transport factory for creating JsonPlaybackTransport. More...

#include "client/transport/json_playback_transport.h"

+ Inheritance diagram for JsonPlaybackTransportFactory:

List of all members.

Public Member Functions

 JsonPlaybackTransportFactory ()
 The default consructor will use the default transport options.
 JsonPlaybackTransportFactory (const HttpTransportLayerConfig *config)
 Standard constructor.
virtual ~JsonPlaybackTransportFactory ()
 Standard destructor.
util::Status LoadTranscript (DataReader *reader)
 Loads the transcript to be shared among all instances created.
void ResetCensor (HttpScribeCensor *censor)
 Changes the censor used by this factory.
HttpScribeCensorcensor ()
 Returns the censor currently owned by the factory.

Protected Member Functions

virtual HttpTransportDoAlloc (const HttpTransportOptions &options)
 Creates a new JsonPlaybackTransport instance configured with the playback attributes specified in this factory.

Detailed Description

A transport factory for creating JsonPlaybackTransport.

This is a standard HttpTransportFactory that can be used in place of any other.

You will need to configure it by loading a transcript and binding an HttpScribeCensor. See the JsonPlaybackTransport for details regarding the censor to use here for best results.

Warning:
The factory must remain valid over the lifetime of the instances it creates because it owns the censor and transcript that those instances are using. If you replace the censor and transcript on the instances then you can destroy the fatory while those instances are still in use.

Constructor & Destructor Documentation

The default consructor will use the default transport options.

Standard constructor.

virtual ~JsonPlaybackTransportFactory ( ) [virtual]

Standard destructor.


Member Function Documentation

HttpScribeCensor* censor ( ) [inline]

Returns the censor currently owned by the factory.

virtual HttpTransport* DoAlloc ( const HttpTransportOptions options) [protected, virtual]

Creates a new JsonPlaybackTransport instance configured with the playback attributes specified in this factory.

Implements HttpTransportFactory.

Loads the transcript to be shared among all instances created.

The factory will maintain ownership of this

Parameters:
[in]readerThe reader containing the data output by a JsonScribe.
Returns:
Whether the transcript could be loaded or not.
void ResetCensor ( HttpScribeCensor censor)

Changes the censor used by this factory.

Parameters:
censorOwnership is passed to the factory.
Warning:
The factory owns the censor given to instances it creates so this method will invalidate the censor used by any outstanding instances unless they had been explicitly replaced.

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