00001 // BESDataHandlerInterface.cc 00002 00003 // This file is part of bes, A C++ back-end server implementation framework 00004 // for the OPeNDAP Data Access Protocol. 00005 00006 // Copyright (c) 2004,2005 University Corporation for Atmospheric Research 00007 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu> 00008 // 00009 // This library is free software; you can redistribute it and/or 00010 // modify it under the terms of the GNU Lesser General Public 00011 // License as published by the Free Software Foundation; either 00012 // version 2.1 of the License, or (at your option) any later version. 00013 // 00014 // This library is distributed in the hope that it will be useful, 00015 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00017 // Lesser General Public License for more details. 00018 // 00019 // You should have received a copy of the GNU Lesser General Public 00020 // License along with this library; if not, write to the Free Software 00021 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00022 // 00023 // You can contact University Corporation for Atmospheric Research at 00024 // 3080 Center Green Drive, Boulder, CO 80301 00025 00026 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005 00027 // Please read the full copyright statement in the file COPYRIGHT_UCAR. 00028 // 00029 // Authors: 00030 // pwest Patrick West <pwest@ucar.edu> 00031 // jgarcia Jose Garcia <jgarcia@ucar.edu> 00032 00033 #include "BESDataHandlerInterface.h" 00034 #include "BESContainer.h" 00035 #include "BESResponseHandler.h" 00036 #include "BESInfo.h" 00037 #include "BESIndent.h" 00038 00039 void 00040 BESDataHandlerInterface::dump( ostream &strm ) const 00041 { 00042 strm << BESIndent::LMarg << "BESDataHandlerInterface::dump" << endl ; 00043 BESIndent::Indent() ; 00044 if( response_handler ) 00045 { 00046 strm << BESIndent::LMarg << "response handler:" << endl ; 00047 BESIndent::Indent() ; 00048 response_handler->dump( strm ) ; 00049 BESIndent::UnIndent() ; 00050 } 00051 else 00052 { 00053 strm << BESIndent::LMarg << "response handler: not set" << endl ; 00054 } 00055 00056 if( container ) 00057 { 00058 strm << BESIndent::LMarg << "current container:" << endl ; 00059 BESIndent::Indent() ; 00060 container->dump( strm ) ; 00061 BESIndent::UnIndent() ; 00062 } 00063 else 00064 { 00065 strm << BESIndent::LMarg << "current container: not set" << endl ; 00066 } 00067 00068 if( containers.size() ) 00069 { 00070 strm << BESIndent::LMarg << "container list:" << endl ; 00071 BESIndent::Indent() ; 00072 list<BESContainer *>::const_iterator i = containers.begin() ; 00073 list<BESContainer *>::const_iterator ie = containers.end() ; 00074 for( ; i != ie; i++ ) 00075 { 00076 (*i)->dump( strm ) ; 00077 } 00078 BESIndent::UnIndent() ; 00079 } 00080 else 00081 { 00082 strm << BESIndent::LMarg << "container list: empty" << endl ; 00083 } 00084 00085 strm << BESIndent::LMarg << "action: " << action << endl ; 00086 strm << BESIndent::LMarg << "action name: " << action_name << endl ; 00087 strm << BESIndent::LMarg << "transmit protocol: " << transmit_protocol << endl ; 00088 if( data.size() ) 00089 { 00090 strm << BESIndent::LMarg << "data:" << endl ; 00091 BESIndent::Indent() ; 00092 data_citer i = data.begin() ; 00093 data_citer ie = data.end() ; 00094 for( ; i != ie; i++ ) 00095 { 00096 strm << BESIndent::LMarg << (*i).first << ": " 00097 << (*i).second << endl ; 00098 } 00099 BESIndent::UnIndent() ; 00100 } 00101 else 00102 { 00103 strm << BESIndent::LMarg << "data: none" << endl ; 00104 } 00105 00106 if( error_info ) 00107 { 00108 strm << BESIndent::LMarg << "error info:" << endl ; 00109 BESIndent::Indent() ; 00110 error_info->dump( strm ) ; 00111 BESIndent::UnIndent() ; 00112 } 00113 else 00114 { 00115 strm << BESIndent::LMarg << "error info: null" << endl ; 00116 } 00117 BESIndent::UnIndent() ; 00118 } 00119