OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
BESDataHandlerInterface.h
Go to the documentation of this file.
1 // BESDataHandlerInterface.h
2 
3 // This file is part of bes, A C++ back-end server implementation framework
4 // for the OPeNDAP Data Access Protocol.
5 
6 // Copyright (c) 2004-2009 University Corporation for Atmospheric Research
7 // Author: Patrick West <pwest@ucar.edu> and Jose Garcia <jgarcia@ucar.edu>
8 //
9 // This library is free software; you can redistribute it and/or
10 // modify it under the terms of the GNU Lesser General Public
11 // License as published by the Free Software Foundation; either
12 // version 2.1 of the License, or (at your option) any later version.
13 //
14 // This library is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 // Lesser General Public License for more details.
18 //
19 // You should have received a copy of the GNU Lesser General Public
20 // License along with this library; if not, write to the Free Software
21 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 //
23 // You can contact University Corporation for Atmospheric Research at
24 // 3080 Center Green Drive, Boulder, CO 80301
25 
26 // (c) COPYRIGHT University Corporation for Atmospheric Research 2004-2005
27 // Please read the full copyright statement in the file COPYRIGHT_UCAR.
28 //
29 // Authors:
30 // pwest Patrick West <pwest@ucar.edu>
31 // jgarcia Jose Garcia <jgarcia@ucar.edu>
32 
33 #ifndef BESDataHandlerInterface_h_
34 #define BESDataHandlerInterface_h_ 1
35 
36 #include <string>
37 #include <list>
38 #include <map>
39 #include <iostream>
40 
41 using std::string ;
42 using std::list ;
43 using std::map ;
44 using std::ostream ;
45 
46 class BESResponseHandler ;
47 class BESResponseObject ;
48 class BESInfo ;
49 
50 #include "BESObj.h"
51 #include "BESContainer.h"
52 #include "BESInternalError.h"
53 
61 {
62 private:
63  ostream *output_stream ;
64 
65  // These were causing multiple compiler warnings, so I removed the implementations since
66  // it's clear they are private to be disallowed from autogeneration for now
67  // and this just not declaring an impl solves it. (mpj 2/26/10)
69  /* : BESObj(),
70  output_stream( 0 ),
71  response_handler( 0 ),
72  container( 0 ),
73  executed( false ),
74  error_info( 0 ) {}
75  */
76 
77  BESDataHandlerInterface & operator=(const BESDataHandlerInterface &rhs);
78  /* {
79  return *this;
80  }
81  */
82 
83 public:
85  : output_stream( 0 ),
86  response_handler( 0 ),
87  container( 0 ),
88  executed( false ),
89  error_info( 0 ) {}
90 
91  void make_copy( const BESDataHandlerInterface &copy_from ) ;
92  void clean() ;
93 
94  void set_output_stream( ostream *strm )
95  {
96  if( output_stream )
97  {
98  string err = "output stream has already been set" ;
99  throw BESInternalError( err, __FILE__, __LINE__ ) ;
100  }
101  output_stream = strm ;
102  }
103  ostream &get_output_stream()
104  {
105  if( !output_stream )
106  throw BESInternalError( "output stream has not yet been set, cannot use", __FILE__, __LINE__ ) ;
107  return *output_stream ;
108  }
109 
112 
113  list<BESContainer *> containers ;
114  list<BESContainer *>::iterator containers_iterator ;
115 
119 
123  {
125  if( containers_iterator != containers.end() )
127  else
128  container = NULL ;
129  }
130 
134  {
136  if( containers_iterator != containers.end() )
138  else
139  container = NULL ;
140  }
141 
144  string action ;
145  string action_name ;
146  bool executed ;
147 
151 
155  map<string, string> data ;
156  const map<string, string> &data_c() const { return data ; }
157  typedef map<string, string>::const_iterator data_citer ;
158 
162 
163  void dump( ostream &strm ) const ;
164 
165 } ;
166 
167 #endif // BESDataHandlerInterface_h_
168