00001 // BESDataHandlerInterface.h 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 Atmostpheric 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 #ifndef BESDataHandlerInterface_h_ 00034 #define BESDataHandlerInterface_h_ 1 00035 00036 #include <string> 00037 #include <list> 00038 #include <map> 00039 #include <iostream> 00040 00041 using std::string ; 00042 using std::list ; 00043 using std::map ; 00044 using std::ostream ; 00045 00046 class BESResponseHandler ; 00047 class BESInfo ; 00048 00049 #include "BESContainer.h" 00050 00057 typedef struct _BESDataHandlerInterface 00058 { 00059 _BESDataHandlerInterface() 00060 : response_handler( 0 ), 00061 container( 0 ), 00062 error_info( 0 ) {} 00063 00064 BESResponseHandler *response_handler ; 00065 00066 list<BESContainer> containers ; 00067 list<BESContainer>::iterator containers_iterator ; 00068 00071 BESContainer *container ; 00072 00075 void first_container() 00076 { 00077 containers_iterator = containers.begin(); 00078 if( containers_iterator != containers.end() ) 00079 container = &(*containers_iterator) ; 00080 else 00081 container = NULL ; 00082 } 00083 00086 void next_container() 00087 { 00088 containers_iterator++ ; 00089 if( containers_iterator != containers.end() ) 00090 container = &(*containers_iterator) ; 00091 else 00092 container = NULL ; 00093 } 00094 00097 string action ; 00098 string action_name ; 00099 00102 string transmit_protocol ; 00103 00107 map<string, string> data ; 00108 const map<string, string> &data_c() const { return data ; } 00109 typedef map<string, string>::const_iterator data_citer ; 00110 00113 BESInfo *error_info ; 00114 00115 void dump( ostream &strm ) const ; 00116 00117 } BESDataHandlerInterface ; 00118 00137 inline ostream & 00138 operator<<( ostream &strm, const BESDataHandlerInterface &dhi ) 00139 { 00140 dhi.dump( strm ) ; 00141 return strm ; 00142 } 00143 00144 #endif // BESDataHandlerInterface_h_ 00145