BESXMLInfo Class Reference

represents an xml formatted response object More...

#include <BESXMLInfo.h>

Inheritance diagram for BESXMLInfo:

Inheritance graph
[legend]
Collaboration diagram for BESXMLInfo:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 BESXMLInfo ()
 constructs an html information response object.
virtual ~BESXMLInfo ()
virtual void begin_response (const string &response_name)
 begin the informational response
virtual void end_response ()
 end the response
virtual void add_tag (const string &tag_name, const string &tag_data, map< string, string > *attrs=0)
 add tagged information to the inforamtional response
virtual void begin_tag (const string &tag_name, map< string, string > *attrs=0)
 begin a tagged part of the information, information to follow
virtual void end_tag (const string &tag_name)
 end a tagged part of the informational response
virtual void add_data (const string &s)
 add data to this informational object. If buffering is not set then the information is output directly to the output stream.
virtual void add_space (unsigned long num_spaces)
 add a space to the informational response
virtual void add_break (unsigned long num_breaks)
 add a line break to the information
virtual void add_data_from_file (const string &key, const string &name)
 add data from a file to the informational object
virtual void print (FILE *out)
 print the information from this informational object to the specified FILE descriptor
virtual void transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi)
 transmit the text information as text
virtual void dump (ostream &strm) const
 dumps information about this object
virtual void add_exception (BESException &e)
 add exception information to this informational object
virtual bool set_buffered (bool buffered)
 return whether the information is to be buffered or not.
virtual bool is_buffered ()
 return whether the information is to be buffered or not.

Static Public Member Functions

static BESInfoBuildXMLInfo (const string &info_type)

Protected Attributes

ostream * _strm
bool _buffered
bool _response_started
stack< string > _tags
string _response_name

Detailed Description

represents an xml formatted response object

An informational response object that is formated as an XML document.

See also:
BESInfo

BESResponseObject

Definition at line 45 of file BESXMLInfo.h.


Constructor & Destructor Documentation

BESXMLInfo::BESXMLInfo (  ) 

constructs an html information response object.

Uses the default BES.Info.Buffered key in the bes configuration file to determine whether the information should be buffered or not.

See also:
BESInfo

BESResponseObject

Definition at line 51 of file BESXMLInfo.cc.

Referenced by BuildXMLInfo().

BESXMLInfo::~BESXMLInfo (  )  [virtual]

Definition at line 58 of file BESXMLInfo.cc.


Member Function Documentation

void BESXMLInfo::begin_response ( const string &  response_name  )  [virtual]

begin the informational response

This will add the response name as well as the <response> tag tot he informational response object

Parameters:
response_name name of the response this information represents

Reimplemented from BESInfo.

Definition at line 70 of file BESXMLInfo.cc.

References BESInfo::_response_name, add_data(), and BESInfo::begin_response().

Referenced by infoT::run().

Here is the call graph for this function:

void BESXMLInfo::end_response (  )  [virtual]

end the response

Add the terminating tags for the response and for the response name. If there are still tags that have not been closed then an exception is thrown.

Reimplemented from BESInfo.

Definition at line 89 of file BESXMLInfo.cc.

References BESInfo::_response_name, add_data(), and BESInfo::end_response().

Referenced by infoT::run().

Here is the call graph for this function:

void BESXMLInfo::add_tag ( const string &  tag_name,
const string &  tag_data,
map< string, string > *  attrs = 0 
) [virtual]

add tagged information to the inforamtional response

Parameters:
tag_name name of the tag to be added to the response
tag_data information describing the tag

Implements BESInfo.

Definition at line 106 of file BESXMLInfo.cc.

References add_data().

Referenced by infoT::run().

Here is the call graph for this function:

void BESXMLInfo::begin_tag ( const string &  tag_name,
map< string, string > *  attrs = 0 
) [virtual]

begin a tagged part of the information, information to follow

Parameters:
tag_name name of the tag to begin

Reimplemented from BESInfo.

Definition at line 135 of file BESXMLInfo.cc.

References add_data(), and BESInfo::begin_tag().

Referenced by infoT::run().

Here is the call graph for this function:

void BESXMLInfo::end_tag ( const string &  tag_name  )  [virtual]

end a tagged part of the informational response

If the named tag is not the current tag then an error is thrown.

Parameters:
tag_name name of the tag to end

Reimplemented from BESInfo.

Definition at line 167 of file BESXMLInfo.cc.

References add_data(), and BESInfo::end_tag().

Referenced by infoT::run().

Here is the call graph for this function:

void BESXMLInfo::add_data ( const string &  s  )  [virtual]

add data to this informational object. If buffering is not set then the information is output directly to the output stream.

Parameters:
s information to be added to this informational response object

Reimplemented from BESInfo.

Definition at line 208 of file BESXMLInfo.cc.

References BESInfo::add_data().

Referenced by add_break(), add_space(), add_tag(), begin_response(), begin_tag(), end_response(), and end_tag().

Here is the call graph for this function:

void BESXMLInfo::add_space ( unsigned long  num_spaces  )  [virtual]

add a space to the informational response

Parameters:
num_spaces the number of spaces to add to the information

Implements BESInfo.

Definition at line 180 of file BESXMLInfo.cc.

References add_data().

Here is the call graph for this function:

void BESXMLInfo::add_break ( unsigned long  num_breaks  )  [virtual]

add a line break to the information

Parameters:
num_breaks the number of line breaks to add to the information

Implements BESInfo.

Definition at line 196 of file BESXMLInfo.cc.

References add_data().

Here is the call graph for this function:

void BESXMLInfo::add_data_from_file ( const string &  key,
const string &  name 
) [virtual]

add data from a file to the informational object

This method simply adds a .XML to the end of the key and passes the request on up to the BESInfo parent class.

Parameters:
key Key from the initialization file specifying the file to be
name A description of what is the information being loaded

Reimplemented from BESInfo.

Definition at line 226 of file BESXMLInfo.cc.

References BESInfo::add_data_from_file().

Here is the call graph for this function:

void BESXMLInfo::print ( FILE *  out  )  [virtual]

print the information from this informational object to the specified FILE descriptor

Parameters:
out output to this file descriptor

Reimplemented from BESInfo.

Definition at line 253 of file BESXMLInfo.cc.

References BESInfo::print().

Referenced by infoT::run().

Here is the call graph for this function:

void BESXMLInfo::transmit ( BESTransmitter transmitter,
BESDataHandlerInterface dhi 
) [virtual]

transmit the text information as text

use the send_text method on the transmitter to transmit the information back to the client.

Parameters:
transmitter The type of transmitter to use to transmit the info
dhi information to help with the transmission

Implements BESInfo.

Definition at line 241 of file BESXMLInfo.cc.

References BESTransmitter::send_text().

Here is the call graph for this function:

void BESXMLInfo::dump ( ostream &  strm  )  const [virtual]

dumps information about this object

Displays the pointer value of this instance along with information about this XML informational object.

Parameters:
strm C++ i/o stream to dump the information to

Reimplemented from BESInfo.

Definition at line 266 of file BESXMLInfo.cc.

References BESInfo::dump(), BESIndent::Indent(), BESIndent::LMarg(), and BESIndent::UnIndent().

Here is the call graph for this function:

BESInfo * BESXMLInfo::BuildXMLInfo ( const string &  info_type  )  [static]

Definition at line 278 of file BESXMLInfo.cc.

References BESXMLInfo().

Referenced by BESDefaultModule::initialize(), and infoT::run().

Here is the call graph for this function:

void BESInfo::add_exception ( BESException e  )  [virtual, inherited]

add exception information to this informational object

Exception information is added differently to different informational objects, such as html, xml, plain text. But, using the other methods of this class we can take care of exceptions here.

Parameters:
type The type of exception being thrown
e The exception to add to the informational response object

Reimplemented in BESSilentInfo, and BESVersionInfo.

Definition at line 205 of file BESInfo.cc.

References BESInfo::add_tag(), BESInfo::begin_tag(), BESInfo::end_tag(), BESException::get_context(), BESException::get_file(), BESException::get_line(), and BESException::get_message().

Referenced by BESVersionInfo::add_exception(), BESExceptionManager::handle_exception(), and TestException::handleException().

Here is the call graph for this function:

virtual bool BESInfo::set_buffered ( bool  buffered  )  [inline, virtual, inherited]

return whether the information is to be buffered or not.

Returns:
true if information is buffered, false if not

Definition at line 120 of file BESInfo.h.

References BESInfo::_buffered.

virtual bool BESInfo::is_buffered (  )  [inline, virtual, inherited]

return whether the information is to be buffered or not.

Returns:
true if information is buffered, false if not

Definition at line 130 of file BESInfo.h.

References BESInfo::_buffered.

Referenced by BESFilterTransmitter::send_html(), BESBasicHttpTransmitter::send_html(), BESFilterTransmitter::send_text(), and BESBasicHttpTransmitter::send_text().


Member Data Documentation

ostream* BESInfo::_strm [protected, inherited]

Definition at line 71 of file BESInfo.h.

Referenced by BESInfo::BESInfo(), BESInfo::print(), and BESInfo::~BESInfo().

bool BESInfo::_buffered [protected, inherited]

Definition at line 72 of file BESInfo.h.

Referenced by BESTextInfo::add_data(), BESInfo::add_data(), BESHTMLInfo::add_data(), BESInfo::BESInfo(), BESInfo::dump(), BESInfo::is_buffered(), BESInfo::print(), BESInfo::set_buffered(), and BESInfo::~BESInfo().

bool BESInfo::_response_started [protected, inherited]

Definition at line 73 of file BESInfo.h.

Referenced by BESInfo::begin_response(), BESInfo::dump(), and BESInfo::end_response().

stack<string> BESInfo::_tags [protected, inherited]

Definition at line 75 of file BESInfo.h.

Referenced by BESInfo::begin_tag(), BESInfo::dump(), BESInfo::end_response(), and BESInfo::end_tag().

string BESInfo::_response_name [protected, inherited]

Definition at line 76 of file BESInfo.h.

Referenced by begin_response(), BESInfo::begin_response(), BESInfo::dump(), and end_response().


The documentation for this class was generated from the following files:
Generated on Wed Aug 29 03:30:06 2007 for OPeNDAP Back End Server (BES) by  doxygen 1.5.2