bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
informational response object More...
#include <BESInfo.h>
Public Member Functions | |
virtual void | add_break (unsigned long num_breaks)=0 |
virtual void | add_data (const std::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_data_from_file (const std::string &key, const std::string &name) |
add data from a file to the informational object. | |
virtual void | add_exception (const BESError &e, const std::string &admin) |
add exception information to this informational object | |
virtual void | add_space (unsigned long num_spaces)=0 |
virtual void | add_tag (const std::string &tag_name, const std::string &tag_data, std::map< std::string, std::string, std::less<> > *attrs=nullptr)=0 |
virtual void | begin_response (const std::string &response_name, BESDataHandlerInterface &dhi) |
begin the informational response | |
virtual void | begin_response (const std::string &response_name, std::map< std::string, std::string, std::less<> > *attrs, BESDataHandlerInterface &dhi) |
begin the informational response | |
virtual void | begin_tag (const std::string &tag_name, std::map< std::string, std::string, std::less<> > *attrs=nullptr) |
BESInfo () | |
constructs a BESInfo object | |
BESInfo (const std::string &buffered_key, std::ostream *strm, bool strm_owned) | |
constructs a BESInfo object | |
virtual void | dump (std::ostream &strm) const |
Displays debug information about this object. | |
virtual void | end_response () |
virtual void | end_tag (const std::string &tag_name) |
virtual bool | is_buffered () |
return whether the information is to be buffered or not. | |
virtual void | print (std::ostream &strm) |
print the information from this informational object to the specified stream | |
virtual void | transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi)=0 |
transmit the informational object | |
Protected Attributes | |
bool | _buffered |
std::string | _response_name |
bool | _response_started |
std::ostream * | _strm |
bool | _strm_owned |
std::stack< std::string > | _tags |
informational response object
This class provides a means to store informational responses, such as help information and version information. The retrieval of this information can be buffered until all information is retrieved, or can be directly output thereby not using memory resources.
Information is added to this response object through the add_data method and then output using the print method. If the information is not buffered then the information is output during the add_data processing, otherwise the print method performs the output.
This class is cannot be directly created but simply provides a base class implementation of BESResponseObject for simple informational responses.
BESInfo::BESInfo | ( | ) |
constructs a BESInfo object
By default, informational responses are buffered, so the output stream is created
Definition at line 52 of file BESInfo.cc.
BESInfo::BESInfo | ( | const std::string & | buffered_key, |
std::ostream * | strm, | ||
bool | strm_owned ) |
constructs a BESInfo object
If the passed key is set to true, True, TRUE, yes, Yes, or YES then the information will be buffered, otherwise it will not be buffered.
If the information is not to be buffered then the output stream is set to standard output.
key | parameter from BES configuration file |
strm | if not buffered then use the passed stream to output information |
strm_owned | if stream was created (not cout or cerr for example) then either take ownership or not |
Definition at line 71 of file BESInfo.cc.
|
virtual |
Definition at line 93 of file BESInfo.cc.
|
pure virtual |
Implemented in BESHTMLInfo, BESTextInfo, and BESXMLInfo.
|
virtual |
add data to this informational object. If buffering is not set then the information is output directly to the output stream.
s | information to be added to this informational response object |
Reimplemented in BESHTMLInfo, BESTextInfo, BESVersionInfo, and BESXMLInfo.
Definition at line 151 of file BESInfo.cc.
|
virtual |
add data from a file to the informational object.
Adds data from a file to the informational object using the file specified by the passed key string. The key is found from the bes configuration file.
If the key does not exist in the initialization file then this information is added to the informational object, no excetion is thrown.
If the file does not exist then this information is added to the informational object, no exception is thrown.
key | Key from the initialization file specifying the file to be |
name | A description of what is the information being loaded |
Reimplemented in BESHTMLInfo, BESTextInfo, BESVersionInfo, and BESXMLInfo.
Definition at line 172 of file BESInfo.cc.
|
virtual |
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.
e | The exception to add to the informational response object |
admin | The contact information for the person responsible for this error |
Reimplemented in BESVersionInfo.
Definition at line 221 of file BESInfo.cc.
|
pure virtual |
Implemented in BESHTMLInfo, BESTextInfo, and BESXMLInfo.
|
pure virtual |
Implemented in BESHTMLInfo, BESTextInfo, and BESXMLInfo.
|
virtual |
begin the informational response
basic setup of the response from abstract class
response_name | name of the response this information represents |
dhi | information about the request and response |
Reimplemented in BESHTMLInfo, BESTextInfo, BESVersionInfo, and BESXMLInfo.
Definition at line 120 of file BESInfo.cc.
|
virtual |
begin the informational response
basic setup of the response from abstract class
response_name | name of the response this information represents |
dhi | information about the request and response |
Reimplemented in BESXMLInfo.
Definition at line 108 of file BESInfo.cc.
|
virtual |
Reimplemented in BESHTMLInfo, BESTextInfo, and BESXMLInfo.
Definition at line 133 of file BESInfo.cc.
|
virtual |
Displays debug information about this object.
dumps information about this object
strm | output stream to use to dump the contents of this object |
Displays the pointer value of this instance along with values of data members.
strm | C++ i/o stream to dump the information to |
Implements BESResponseObject.
Reimplemented in BESHTMLInfo, BESTextInfo, BESVersionInfo, and BESXMLInfo.
Definition at line 262 of file BESInfo.cc.
|
virtual |
Reimplemented in BESHTMLInfo, and BESXMLInfo.
Definition at line 125 of file BESInfo.cc.
|
virtual |
Reimplemented in BESHTMLInfo, BESTextInfo, and BESXMLInfo.
Definition at line 137 of file BESInfo.cc.
|
inlinevirtual |
|
virtual |
print the information from this informational object to the specified stream
If the information was not buffered then this method does nothing, otherwise the information is output to the specified ostream.
strm | output to this file descriptor if information buffered. |
Reimplemented in BESVersionInfo, and BESXMLInfo.
Definition at line 249 of file BESInfo.cc.
|
pure virtual |
transmit the informational object
The derived informational object knows how it needs to be transmitted. Does it need to be sent as html? As text? As something else?
transmitter | The type of transmitter to use to transmit the info |
dhi | information to help with the transmission |
Implemented in BESHTMLInfo, BESTextInfo, BESVersionInfo, and BESXMLInfo.