OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
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
60
class
BESDataHandlerInterface
:
public
BESObj
{
61
private
:
62
ostream *output_stream;
63
64
// These were causing multiple compiler warnings, so I removed the implementations since
65
// it's clear they are private to be disallowed from auto generation for now
66
// and this just not declaring an impl solves it. (mpj 2/26/10)
67
BESDataHandlerInterface
(
BESDataHandlerInterface
&from);
68
69
BESDataHandlerInterface
& operator=(
const
BESDataHandlerInterface
&rhs);
70
71
public
:
72
BESDataHandlerInterface
() :
73
output_stream(0),
response_handler
(0),
container
(0),
executed
(false),
error_info
(0)
74
{
75
}
76
77
void
make_copy
(
const
BESDataHandlerInterface
©_from);
78
void
clean
();
79
80
void
set_output_stream
(ostream *strm)
81
{
82
if
(output_stream) {
83
string
err =
"output stream has already been set"
;
84
throw
BESInternalError
(err, __FILE__, __LINE__);
85
}
86
output_stream = strm;
87
}
88
89
ostream &
get_output_stream
()
90
{
91
if
(!output_stream)
92
throw
BESInternalError
(
"output stream has not yet been set, cannot use"
, __FILE__, __LINE__);
93
return
*output_stream;
94
}
95
96
BESResponseHandler
*
response_handler
;
97
BESResponseObject
*
get_response_object
();
98
99
list<BESContainer *>
containers
;
100
list<BESContainer *>::iterator
containers_iterator
;
101
104
BESContainer
*
container
;
105
108
void
first_container
()
109
{
110
containers_iterator
=
containers
.begin();
111
if
(
containers_iterator
!=
containers
.end())
112
container
= (*
containers_iterator
);
113
else
114
container
= NULL;
115
}
116
119
void
next_container
()
120
{
121
containers_iterator
++;
122
if
(
containers_iterator
!=
containers
.end())
123
container
= (*
containers_iterator
);
124
else
125
container
= NULL;
126
}
127
130
string
action
;
131
string
action_name
;
132
bool
executed
;
133
136
string
transmit_protocol
;
137
141
map<string, string>
data
;
142
const
map<string, string> &
data_c
()
const
143
{
144
return
data
;
145
}
146
147
typedef
map<string, string>::const_iterator
data_citer
;
148
151
BESInfo
*
error_info
;
152
153
void
dump
(ostream &strm)
const
;
154
155
};
156
157
#endif // BESDataHandlerInterface_h_
dispatch
BESDataHandlerInterface.h
Generated by
1.8.4