Google APIs Client Library for C++
|
Specifies the implementation components for the TransportLayer. More...
#include "client/transport/http_transport.h"
Public Member Functions | |
HttpTransportLayerConfig () | |
Standard constructor does not bind a default HttpTransportFactory. | |
virtual | ~HttpTransportLayerConfig () |
Standard destructor. | |
void | ResetDefaultTransportFactory (HttpTransportFactory *factory) |
Sets the default transport factory. | |
HttpTransportFactory * | default_transport_factory () const |
Returns the default transport factory, if one was set. | |
const HttpTransportOptions & | default_transport_options () const |
Returns the default HttpTransport options for this configuration. | |
HttpTransportOptions * | mutable_default_transport_options () |
Returns a modifiable instance for changing the default HttpTransport options. | |
HttpTransport * | NewDefaultTransport (util::Status *status) const |
Returns a new transport using the default transport factory with the default user agent set. | |
HttpTransport * | NewDefaultTransportOrDie () const |
Create a new transport or terminate the program on failure. | |
void | ResetDefaultErrorHandler (HttpTransportErrorHandler *error_handler) |
Resets the error handler used by the default options, passing ownership. | |
void | ResetDefaultExecutor (thread::Executor *executor) |
Resets the executor used by the default options, passing ownership. |
Specifies the implementation components for the TransportLayer.
Standard constructor does not bind a default HttpTransportFactory.
The default configuration does not bind a specific transport factory so you must add one yourself. For the application name and SSL certificate validation see the static methods that determine the default values for more details.
virtual ~HttpTransportLayerConfig | ( | ) | [virtual] |
Standard destructor.
HttpTransportFactory* default_transport_factory | ( | ) | const [inline] |
Returns the default transport factory, if one was set.
const HttpTransportOptions& default_transport_options | ( | ) | const [inline] |
Returns the default HttpTransport options for this configuration.
The returned options can be copied and modified for each transport independently.
HttpTransportOptions* mutable_default_transport_options | ( | ) | [inline] |
Returns a modifiable instance for changing the default HttpTransport options.
HttpTransport* NewDefaultTransport | ( | util::Status * | status | ) | const |
Returns a new transport using the default transport factory with the default user agent set.
[out] | status | Reason for failure if NULL is returned |
This method requires that ResetDefaultTransportFactory was called or it will return NULL and set an error status.
HttpTransport* NewDefaultTransportOrDie | ( | ) | const |
Create a new transport or terminate the program on failure.
Similar to NewDefaultTransport but will CHECK-fail rather than returning NULL if there is not default transport factory to use.
void ResetDefaultErrorHandler | ( | HttpTransportErrorHandler * | error_handler | ) |
Resets the error handler used by the default options, passing ownership.
The HttpTransportOptions does not own its error handler. This method changes the error handler in the default transport options but passes ownership of that handler to this configuration. Otherwise the caller would need to take responsibility for it if it set the handler directly in the mutable_default_transport_options.
This method will destroy any previous default error handler that was owned by this configuration. If there were other HttpTransportOptions previously using it then they will become corrupted with an invalid pointer to the old (deleted) handler.
[in] | error_handler | Ownership is passed to the configuration. NULL will unset the default error handler in the options as well. |
void ResetDefaultExecutor | ( | thread::Executor * | executor | ) |
Resets the executor used by the default options, passing ownership.
The HttpTransportOptions does not own its executor. This method changes the executor in the default transport options but passes ownership of that handler to this configuration. Otherwise the caller would need to take responsibility for it if it set the handler directly in the mutable_default_transport_options.
This method will destroy any previous default executor that was owned by this configuration. If there were other HttpTransportOptions previously using it then they will become corrupted with an invalid pointer to the old (deleted) handler.
[in] | executor | Ownership is passed to the configuration. NULL will unset the default executor in the options as well. |
void ResetDefaultTransportFactory | ( | HttpTransportFactory * | factory | ) |
Sets the default transport factory.
[in] | factory | Ownership is passed to the configuration. NULL will unset the default factory. |