bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
BESVersionInfo Class Reference

#include <BESVersionInfo.h>

Inheritance diagram for BESVersionInfo:
Inheritance graph
Collaboration diagram for BESVersionInfo:
Collaboration graph

Public Member Functions

void add_break (unsigned long num_breaks) override
 
void add_data (const std::string &s) override
 add data to this informational object. If buffering is not set then the information is output directly to the output stream.
 
void add_data_from_file (const std::string &key, const std::string &name) override
 add data from a file to the informational object.
 
void add_exception (const BESError &e, const std::string &admin) override
 add exception information to this informational object
 
virtual void add_library (const std::string &n, const std::string &v)
 
virtual void add_module (const std::string &n, const std::string &v)
 
virtual void add_service (const std::string &n, const std::list< std::string > &vers)
 
void add_space (unsigned long num_spaces) override
 
void add_tag (const std::string &tag_name, const std::string &tag_data, std::map< std::string, std::string, std::less<> > *attrs=nullptr) override
 
virtual void begin_response (const std::string &response_name, std::map< std::string, std::string, std::less<> > *attrs, BESDataHandlerInterface &dhi)
 begin the informational response
 
void begin_response (const std::string &response_name, BESDataHandlerInterface &dhi) override
 begin the informational response
 
void begin_tag (const std::string &tag_name, std::map< std::string, std::string, std::less<> > *attrs=nullptr) override
 
 BESVersionInfo ()
 constructs a basic text information response object to write version information
 
void dump (std::ostream &strm) const override
 dumps information about this object
 
void end_response () override
 
void end_tag (const std::string &tag_name) override
 
virtual bool is_buffered ()
 return whether the information is to be buffered or not.
 
void print (std::ostream &strm) override
 print the information from this informational object to the specified stream
 
void transmit (BESTransmitter *transmitter, BESDataHandlerInterface &dhi) override
 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
 

Detailed Description

brief represents simple text information in a response object, such as version and help information.

Uses the default add_data and print methods, where the print method, if the response is going to a browser, sets the MIME type to text.

See also
BESXMLInfo
BESResponseObject

Definition at line 47 of file BESVersionInfo.h.

Constructor & Destructor Documentation

◆ BESVersionInfo()

BESVersionInfo::BESVersionInfo ( )

constructs a basic text information response object to write version information

See also
BESXMLInfo
BESResponseObject

Definition at line 49 of file BESVersionInfo.cc.

◆ ~BESVersionInfo()

BESVersionInfo::~BESVersionInfo ( )
override

Definition at line 55 of file BESVersionInfo.cc.

Member Function Documentation

◆ add_break()

void BESVersionInfo::add_break ( unsigned long num_breaks)
inlineoverridevirtual

Implements BESInfo.

Definition at line 94 of file BESVersionInfo.h.

◆ add_data()

void BESVersionInfo::add_data ( const std::string & s)
inlineoverridevirtual

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

Parameters
sinformation to be added to this informational response object

Reimplemented from BESInfo.

Definition at line 86 of file BESVersionInfo.h.

◆ add_data_from_file()

void BESVersionInfo::add_data_from_file ( const std::string & key,
const std::string & name )
inlineoverridevirtual

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.

Parameters
keyKey from the initialization file specifying the file to be
nameA description of what is the information being loaded

Reimplemented from BESInfo.

Definition at line 98 of file BESVersionInfo.h.

◆ add_exception()

void BESVersionInfo::add_exception ( const BESError & error,
const std::string & admin )
inlineoverridevirtual

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
eThe exception to add to the informational response object
adminThe contact information for the person responsible for this error

Reimplemented from BESInfo.

Definition at line 102 of file BESVersionInfo.h.

◆ add_library()

void BESVersionInfo::add_library ( const std::string & n,
const std::string & v )
virtual

Definition at line 60 of file BESVersionInfo.cc.

◆ add_module()

void BESVersionInfo::add_module ( const std::string & n,
const std::string & v )
virtual

Definition at line 65 of file BESVersionInfo.cc.

◆ add_service()

void BESVersionInfo::add_service ( const std::string & n,
const std::list< std::string > & vers )
virtual

Definition at line 70 of file BESVersionInfo.cc.

◆ add_space()

void BESVersionInfo::add_space ( unsigned long num_spaces)
inlineoverridevirtual

Implements BESInfo.

Definition at line 90 of file BESVersionInfo.h.

◆ add_tag()

void BESVersionInfo::add_tag ( const std::string & tag_name,
const std::string & tag_data,
std::map< std::string, std::string, std::less<> > * attrs = nullptr )
inlineoverridevirtual

Implements BESInfo.

Definition at line 70 of file BESVersionInfo.h.

◆ begin_response() [1/2]

void BESInfo::begin_response ( const std::string & response_name,
std::map< std::string, std::string, std::less<> > * attrs,
BESDataHandlerInterface & dhi )
virtualinherited

begin the informational response

basic setup of the response from abstract class

Parameters
response_namename of the response this information represents
dhiinformation about the request and response

Reimplemented in BESXMLInfo.

Definition at line 108 of file BESInfo.cc.

◆ begin_response() [2/2]

void BESVersionInfo::begin_response ( const std::string & response_name,
BESDataHandlerInterface & dhi )
inlineoverridevirtual

begin the informational response

basic setup of the response from abstract class

Parameters
response_namename of the response this information represents
dhiinformation about the request and response

Reimplemented from BESInfo.

Definition at line 61 of file BESVersionInfo.h.

◆ begin_tag()

void BESVersionInfo::begin_tag ( const std::string & tag_name,
std::map< std::string, std::string, std::less<> > * attrs = nullptr )
inlineoverridevirtual

Reimplemented from BESInfo.

Definition at line 76 of file BESVersionInfo.h.

◆ dump()

void BESVersionInfo::dump ( std::ostream & strm) const
overridevirtual

dumps information about this object

Displays the pointer value of this instance along with information about this version information object

Parameters
strmC++ i/o stream to dump the information to

Reimplemented from BESInfo.

Definition at line 98 of file BESVersionInfo.cc.

◆ end_response()

void BESVersionInfo::end_response ( )
inlineoverridevirtual

Reimplemented from BESInfo.

Definition at line 65 of file BESVersionInfo.h.

◆ end_tag()

void BESVersionInfo::end_tag ( const std::string & tag_name)
inlineoverridevirtual

Reimplemented from BESInfo.

Definition at line 81 of file BESVersionInfo.h.

◆ is_buffered()

virtual bool BESInfo::is_buffered ( )
inlinevirtualinherited

return whether the information is to be buffered or not.

Returns
true if information is buffered, false if not

Definition at line 116 of file BESInfo.h.

◆ print()

void BESVersionInfo::print ( std::ostream & strm)
inlineoverridevirtual

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.

Parameters
strmoutput to this file descriptor if information buffered.

Reimplemented from BESInfo.

Definition at line 110 of file BESVersionInfo.h.

◆ transmit()

void BESVersionInfo::transmit ( BESTransmitter * transmitter,
BESDataHandlerInterface & dhi )
inlineoverridevirtual

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?

Parameters
transmitterThe type of transmitter to use to transmit the info
dhiinformation to help with the transmission

Implements BESInfo.

Definition at line 106 of file BESVersionInfo.h.

Member Data Documentation

◆ _buffered

bool BESInfo::_buffered
protectedinherited

Definition at line 67 of file BESInfo.h.

◆ _response_name

std::string BESInfo::_response_name
protectedinherited

Definition at line 71 of file BESInfo.h.

◆ _response_started

bool BESInfo::_response_started
protectedinherited

Definition at line 68 of file BESInfo.h.

◆ _strm

std::ostream* BESInfo::_strm
protectedinherited

Definition at line 65 of file BESInfo.h.

◆ _strm_owned

bool BESInfo::_strm_owned
protectedinherited

Definition at line 66 of file BESInfo.h.

◆ _tags

std::stack<std::string> BESInfo::_tags
protectedinherited

Definition at line 70 of file BESInfo.h.


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