BESDataHandlerInterface.cc
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "BESDataHandlerInterface.h"
00034 #include "BESContainer.h"
00035 #include "BESResponseHandler.h"
00036 #include "BESInfo.h"
00037 #include "BESIndent.h"
00038
00048 void
00049 BESDataHandlerInterface::make_copy( const BESDataHandlerInterface ©_from )
00050 {
00051 this->data = copy_from.data ;
00052 this->output_stream = copy_from.output_stream ;
00053 this->transmit_protocol = copy_from.transmit_protocol ;
00054 }
00055
00063 void
00064 BESDataHandlerInterface::clean()
00065 {
00066 if( response_handler )
00067 {
00068 delete response_handler ;
00069 }
00070 response_handler = 0 ;
00071 }
00072
00080 BESResponseObject *
00081 BESDataHandlerInterface::get_response_object()
00082 {
00083 BESResponseObject *response = 0 ;
00084
00085 if( response_handler )
00086 {
00087 response = response_handler->get_response_object() ;
00088 }
00089 return response ;
00090 }
00091
00092 void
00093 BESDataHandlerInterface::dump( ostream &strm ) const
00094 {
00095 strm << BESIndent::LMarg << "BESDataHandlerInterface::dump" << endl ;
00096 BESIndent::Indent() ;
00097 if( response_handler )
00098 {
00099 strm << BESIndent::LMarg << "response handler:" << endl ;
00100 BESIndent::Indent() ;
00101 response_handler->dump( strm ) ;
00102 BESIndent::UnIndent() ;
00103 }
00104 else
00105 {
00106 strm << BESIndent::LMarg << "response handler: not set" << endl ;
00107 }
00108
00109 if( container )
00110 {
00111 strm << BESIndent::LMarg << "current container:" << endl ;
00112 BESIndent::Indent() ;
00113 container->dump( strm ) ;
00114 BESIndent::UnIndent() ;
00115 }
00116 else
00117 {
00118 strm << BESIndent::LMarg << "current container: not set" << endl ;
00119 }
00120
00121 if( containers.size() )
00122 {
00123 strm << BESIndent::LMarg << "container list:" << endl ;
00124 BESIndent::Indent() ;
00125 list<BESContainer *>::const_iterator i = containers.begin() ;
00126 list<BESContainer *>::const_iterator ie = containers.end() ;
00127 for( ; i != ie; i++ )
00128 {
00129 (*i)->dump( strm ) ;
00130 }
00131 BESIndent::UnIndent() ;
00132 }
00133 else
00134 {
00135 strm << BESIndent::LMarg << "container list: empty" << endl ;
00136 }
00137
00138 strm << BESIndent::LMarg << "action: " << action << endl ;
00139 strm << BESIndent::LMarg << "action name: " << action_name << endl ;
00140 strm << BESIndent::LMarg << "transmit protocol: " << transmit_protocol << endl ;
00141 if( data.size() )
00142 {
00143 strm << BESIndent::LMarg << "data:" << endl ;
00144 BESIndent::Indent() ;
00145 data_citer i = data.begin() ;
00146 data_citer ie = data.end() ;
00147 for( ; i != ie; i++ )
00148 {
00149 strm << BESIndent::LMarg << (*i).first << ": "
00150 << (*i).second << endl ;
00151 }
00152 BESIndent::UnIndent() ;
00153 }
00154 else
00155 {
00156 strm << BESIndent::LMarg << "data: none" << endl ;
00157 }
00158
00159 if( error_info )
00160 {
00161 strm << BESIndent::LMarg << "error info:" << endl ;
00162 BESIndent::Indent() ;
00163 error_info->dump( strm ) ;
00164 BESIndent::UnIndent() ;
00165 }
00166 else
00167 {
00168 strm << BESIndent::LMarg << "error info: null" << endl ;
00169 }
00170 BESIndent::UnIndent() ;
00171 }
00172