Response Class Reference

#include <Response.h>

Inheritance diagram for Response:

Inheritance graph
[legend]
Collaboration diagram for Response:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Response (FILE *s)
virtual ~Response ()
Accessors


virtual string get_protocol () const
virtual int get_status () const
virtual FILE * get_stream () const
virtual ObjectType get_type () const
virtual string get_version () const
Mutators


virtual void set_protocol (const string &p)
virtual void set_status (int s)
virtual void set_stream (FILE *s)
virtual void set_type (ObjectType o)
virtual void set_version (const string &v)

Protected Member Functions

Suppressed default methods


Response & operator= (const Response &)
 Response (const Response &)
 Response ()

Detailed Description

Encapsulate a response. Instead of directly returning the FILE pointer from which a response is read, return an instance of this object. For a simple system where all that needs to be done to free the stream and its associated resources, this is overkill. However, some streams may require complex operations to free their resources once the client is done with the stream. Those classes should return a subclass of Response which has those operations built into the destructor.

Todo:
If the code that parses the MIME headers was moved from Connect and HTTPConnect to this class and its children, it would be easier to build a FileConnect class (or maybe the specifics of the connection type could be held in the Response object and HTTPConnect and the to be written FileConnect would not be needed).

Definition at line 50 of file Response.h.


Constructor & Destructor Documentation

Response::Response (  )  [inline, protected]

Definition at line 67 of file Response.h.

Response::Response ( const Response &   )  [inline, protected]

Definition at line 69 of file Response.h.

Response::Response ( FILE *  s  )  [inline]

Initialize with a stream. Create an instance initialized to a stream. by default get_type() and get_version() return default values of unknown_type and "dods/0.0", respectively. Specializations (see HTTPResponse and HTTPConnect) may fill these fields in with other values.

Definition at line 83 of file Response.h.

virtual Response::~Response (  )  [inline, virtual]

Close the stream.

Definition at line 89 of file Response.h.


Member Function Documentation

virtual string Response::get_protocol (  )  const [inline, virtual]

Definition at line 113 of file Response.h.

virtual int Response::get_status (  )  const [inline, virtual]

Definition at line 97 of file Response.h.

virtual FILE* Response::get_stream (  )  const [inline, virtual]

Reimplemented in StdinResponse.

Definition at line 101 of file Response.h.

virtual ObjectType Response::get_type (  )  const [inline, virtual]

Definition at line 105 of file Response.h.

virtual string Response::get_version (  )  const [inline, virtual]

Definition at line 109 of file Response.h.

Response& Response::operator= ( const Response &   )  [inline, protected]

Definition at line 71 of file Response.h.

virtual void Response::set_protocol ( const string &  p  )  [inline, virtual]

Definition at line 137 of file Response.h.

virtual void Response::set_status ( int  s  )  [inline, virtual]

Definition at line 121 of file Response.h.

virtual void Response::set_stream ( FILE *  s  )  [inline, virtual]

Reimplemented in StdinResponse.

Definition at line 125 of file Response.h.

virtual void Response::set_type ( ObjectType  o  )  [inline, virtual]

Definition at line 129 of file Response.h.

virtual void Response::set_version ( const string &  v  )  [inline, virtual]

Definition at line 133 of file Response.h.


The documentation for this class was generated from the following file:
Generated on Wed Aug 29 03:05:19 2007 for libdap++ by  doxygen 1.5.2