libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::HTTPCacheResponse Class Reference

#include <HTTPCacheResponse.h>

Inheritance diagram for libdap::HTTPCacheResponse:
Inheritance graph
Collaboration diagram for libdap::HTTPCacheResponse:
Collaboration graph

Public Member Functions

 HTTPCacheResponse (FILE *s, int status_code, const vector< string > &headers, const string &file_name, HTTPCache *c)
 
 HTTPCacheResponse (FILE *s, int status_code, const vector< string > &headers, HTTPCache *c)
 
void transform_to_cpp ()
 
 ~HTTPCacheResponse () override
 
Suppressed default methods
 HTTPCacheResponse ()=delete
 
 HTTPCacheResponse (const HTTPCacheResponse &rs)=delete
 
HTTPCacheResponseoperator= (const HTTPCacheResponse &)=delete
 
Accessors
virtual std::vector< std::string > & get_headers ()
 
virtual std::string get_file () const
 
Mutators
virtual void set_headers (std::vector< std::string > &h)
 
virtual void set_file (const std::string &n)
 
getters
virtual int get_status () const
 
virtual FILE * get_stream () const
 
virtual std::istream * get_cpp_stream () const
 
virtual ObjectType get_type () const
 
virtual std::string get_version () const
 
virtual std::string get_protocol () const
 
setters
virtual void set_status (int s)
 
virtual void set_stream (FILE *s)
 
virtual void set_cpp_stream (std::istream *s)
 
virtual void set_type (ObjectType o)
 
virtual void set_version (const std::string &v)
 
virtual void set_protocol (const std::string &p)
 

Protected Attributes

bool d_delete_cpp_stream_ptr = false
 

Detailed Description

Encapsulate a response. Instead of directly returning the FILE pointer from which a response is read, return an instance of this object.

Definition at line 37 of file HTTPCacheResponse.h.

Constructor & Destructor Documentation

◆ HTTPCacheResponse() [1/4]

libdap::HTTPCacheResponse::HTTPCacheResponse ( )
delete

◆ HTTPCacheResponse() [2/4]

libdap::HTTPCacheResponse::HTTPCacheResponse ( const HTTPCacheResponse & rs)
delete

◆ HTTPCacheResponse() [3/4]

libdap::HTTPCacheResponse::HTTPCacheResponse ( FILE * s,
int status_code,
const vector< string > & headers,
HTTPCache * c )
inline

Build a Response object. Instances of this class are used to represent responses from a local HTTP/1.1 cache. The stream and headers pointer are passed to the parent (HTTPResponse); there's no temporary file for the parent to manage since the body is read from a file managed by the cache subsystem. This class releases the lock on the cache entry when the destructor is called.

Definition at line 55 of file HTTPCacheResponse.h.

◆ HTTPCacheResponse() [4/4]

libdap::HTTPCacheResponse::HTTPCacheResponse ( FILE * s,
int status_code,
const vector< string > & headers,
const string & file_name,
HTTPCache * c )
inline

Build a Response object. Instances of this class are used to represent responses from a local HTTP/1.1 cache. The stream and headers pointer are passed to the parent (HTTPResponse); there's no temporary file for the parent to manage since the body is read from a file managed by the cache subsystem. This class releases the lock on the cache entry when the destructor is called.

Definition at line 64 of file HTTPCacheResponse.h.

◆ ~HTTPCacheResponse()

libdap::HTTPCacheResponse::~HTTPCacheResponse ( )
inlineoverride

Free the cache entry lock. Call the parent's destructor.

Definition at line 68 of file HTTPCacheResponse.h.

Member Function Documentation

◆ get_cpp_stream()

virtual std::istream * libdap::Response::get_cpp_stream ( ) const
inlinevirtualinherited

Reimplemented in libdap::StdinResponse.

Definition at line 104 of file Response.h.

◆ get_file()

virtual std::string libdap::HTTPResponse::get_file ( ) const
inlinevirtualinherited

Definition at line 120 of file HTTPResponse.h.

◆ get_headers()

virtual std::vector< std::string > & libdap::HTTPResponse::get_headers ( )
inlinevirtualinherited

Definition at line 119 of file HTTPResponse.h.

◆ get_protocol()

virtual std::string libdap::Response::get_protocol ( ) const
inlinevirtualinherited

Definition at line 108 of file Response.h.

◆ get_status()

virtual int libdap::Response::get_status ( ) const
inlinevirtualinherited

Definition at line 102 of file Response.h.

◆ get_stream()

virtual FILE * libdap::Response::get_stream ( ) const
inlinevirtualinherited

Reimplemented in libdap::PipeResponse, and libdap::StdinResponse.

Definition at line 103 of file Response.h.

◆ get_type()

virtual ObjectType libdap::Response::get_type ( ) const
inlinevirtualinherited

Definition at line 106 of file Response.h.

◆ get_version()

virtual std::string libdap::Response::get_version ( ) const
inlinevirtualinherited

Definition at line 107 of file Response.h.

◆ operator=()

HTTPCacheResponse & libdap::HTTPCacheResponse::operator= ( const HTTPCacheResponse & )
delete

◆ set_cpp_stream()

virtual void libdap::Response::set_cpp_stream ( std::istream * s)
inlinevirtualinherited

Reimplemented in libdap::StdinResponse.

Definition at line 116 of file Response.h.

◆ set_file()

virtual void libdap::HTTPResponse::set_file ( const std::string & n)
inlinevirtualinherited

Definition at line 126 of file HTTPResponse.h.

◆ set_headers()

virtual void libdap::HTTPResponse::set_headers ( std::vector< std::string > & h)
inlinevirtualinherited

Definition at line 125 of file HTTPResponse.h.

◆ set_protocol()

virtual void libdap::Response::set_protocol ( const std::string & p)
inlinevirtualinherited

Definition at line 120 of file Response.h.

◆ set_status()

virtual void libdap::Response::set_status ( int s)
inlinevirtualinherited

Definition at line 113 of file Response.h.

◆ set_stream()

virtual void libdap::Response::set_stream ( FILE * s)
inlinevirtualinherited

Reimplemented in libdap::PipeResponse, and libdap::StdinResponse.

Definition at line 115 of file Response.h.

◆ set_type()

virtual void libdap::Response::set_type ( ObjectType o)
inlinevirtualinherited

Definition at line 118 of file Response.h.

◆ set_version()

virtual void libdap::Response::set_version ( const std::string & v)
inlinevirtualinherited

Definition at line 119 of file Response.h.

◆ transform_to_cpp()

void libdap::HTTPResponse::transform_to_cpp ( )
inlineinherited

Build a new HTTPResponse object that works with C++ streams. Assume that the FILE* references a disk file.

Returns

Definition at line 104 of file HTTPResponse.h.

Member Data Documentation

◆ d_delete_cpp_stream_ptr

bool libdap::Response::d_delete_cpp_stream_ptr = false
protectedinherited

Definition at line 67 of file Response.h.


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