OPeNDAP Hyrax Back End Server (BES)
Updated for version 3.8.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
BESDataHandlerInterface.cc
Go to the documentation of this file.
1
// BESDataHandlerInterface.cc
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
#include "
BESDataHandlerInterface.h
"
34
#include "
BESContainer.h
"
35
#include "
BESResponseHandler.h
"
36
#include "
BESInfo.h
"
37
#include "
BESIndent.h
"
38
48
void
BESDataHandlerInterface::make_copy
(
const
BESDataHandlerInterface
©_from)
49
{
50
this->
data
= copy_from.
data
;
51
this->output_stream = copy_from.output_stream;
52
this->
transmit_protocol
= copy_from.
transmit_protocol
;
53
}
54
62
void
BESDataHandlerInterface::clean
()
63
{
64
if
(
response_handler
) {
65
delete
response_handler
;
66
}
67
response_handler
= 0;
68
}
69
77
BESResponseObject
*
78
BESDataHandlerInterface::get_response_object
()
79
{
80
BESResponseObject
*response = 0;
81
82
if
(
response_handler
) {
83
response =
response_handler
->
get_response_object
();
84
}
85
return
response;
86
}
87
95
void
BESDataHandlerInterface::dump
(ostream &strm)
const
96
{
97
strm <<
BESIndent::LMarg
<<
"BESDataHandlerInterface::dump"
<< endl;
98
BESIndent::Indent
();
99
if
(
response_handler
) {
100
strm <<
BESIndent::LMarg
<<
"response handler:"
<< endl;
101
BESIndent::Indent
();
102
response_handler
->
dump
(strm);
103
BESIndent::UnIndent
();
104
}
105
else
{
106
strm <<
BESIndent::LMarg
<<
"response handler: not set"
<< endl;
107
}
108
109
if
(
container
) {
110
strm <<
BESIndent::LMarg
<<
"current container:"
<< endl;
111
BESIndent::Indent
();
112
container
->
dump
(strm);
113
BESIndent::UnIndent
();
114
}
115
else
{
116
strm <<
BESIndent::LMarg
<<
"current container: not set"
<< endl;
117
}
118
119
if
(
containers
.size()) {
120
strm <<
BESIndent::LMarg
<<
"container list:"
<< endl;
121
BESIndent::Indent
();
122
list<BESContainer *>::const_iterator i =
containers
.begin();
123
list<BESContainer *>::const_iterator ie =
containers
.end();
124
for
(; i != ie; i++) {
125
(*i)->dump(strm);
126
}
127
BESIndent::UnIndent
();
128
}
129
else
{
130
strm <<
BESIndent::LMarg
<<
"container list: empty"
<< endl;
131
}
132
133
strm <<
BESIndent::LMarg
<<
"action: "
<<
action
<< endl;
134
strm <<
BESIndent::LMarg
<<
"action name: "
<<
action_name
<< endl;
135
strm <<
BESIndent::LMarg
<<
"transmit protocol: "
<<
transmit_protocol
<< endl;
136
if
(
data
.size()) {
137
strm <<
BESIndent::LMarg
<<
"data:"
<< endl;
138
BESIndent::Indent
();
139
data_citer
i =
data
.begin();
140
data_citer
ie =
data
.end();
141
for
(; i != ie; i++) {
142
strm <<
BESIndent::LMarg
<< (*i).first <<
": "
<< (*i).second << endl;
143
}
144
BESIndent::UnIndent
();
145
}
146
else
{
147
strm <<
BESIndent::LMarg
<<
"data: none"
<< endl;
148
}
149
150
if
(
error_info
) {
151
strm <<
BESIndent::LMarg
<<
"error info:"
<< endl;
152
BESIndent::Indent
();
153
error_info
->
dump
(strm);
154
BESIndent::UnIndent
();
155
}
156
else
{
157
strm <<
BESIndent::LMarg
<<
"error info: null"
<< endl;
158
}
159
BESIndent::UnIndent
();
160
}
161
dispatch
BESDataHandlerInterface.cc
Generated by
1.8.4