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
49
BESDataHandlerInterface::make_copy
(
const
BESDataHandlerInterface
©_from )
50
{
51
this->
data
= copy_from.
data
;
52
this->output_stream = copy_from.output_stream ;
53
this->
transmit_protocol
= copy_from.
transmit_protocol
;
54
}
55
63
void
64
BESDataHandlerInterface::clean
()
65
{
66
if
(
response_handler
)
67
{
68
delete
response_handler
;
69
}
70
response_handler
= 0 ;
71
}
72
80
BESResponseObject
*
81
BESDataHandlerInterface::get_response_object
()
82
{
83
BESResponseObject
*response = 0 ;
84
85
if
(
response_handler
)
86
{
87
response =
response_handler
->
get_response_object
() ;
88
}
89
return
response ;
90
}
91
99
void
100
BESDataHandlerInterface::dump
( ostream &strm )
const
101
{
102
strm <<
BESIndent::LMarg
<<
"BESDataHandlerInterface::dump"
<< endl ;
103
BESIndent::Indent
() ;
104
if
(
response_handler
)
105
{
106
strm <<
BESIndent::LMarg
<<
"response handler:"
<< endl ;
107
BESIndent::Indent
() ;
108
response_handler
->
dump
( strm ) ;
109
BESIndent::UnIndent
() ;
110
}
111
else
112
{
113
strm <<
BESIndent::LMarg
<<
"response handler: not set"
<< endl ;
114
}
115
116
if
(
container
)
117
{
118
strm <<
BESIndent::LMarg
<<
"current container:"
<< endl ;
119
BESIndent::Indent
() ;
120
container
->
dump
( strm ) ;
121
BESIndent::UnIndent
() ;
122
}
123
else
124
{
125
strm <<
BESIndent::LMarg
<<
"current container: not set"
<< endl ;
126
}
127
128
if
(
containers
.size() )
129
{
130
strm <<
BESIndent::LMarg
<<
"container list:"
<< endl ;
131
BESIndent::Indent
() ;
132
list<BESContainer *>::const_iterator i =
containers
.begin() ;
133
list<BESContainer *>::const_iterator ie =
containers
.end() ;
134
for
( ; i != ie; i++ )
135
{
136
(*i)->dump( strm ) ;
137
}
138
BESIndent::UnIndent
() ;
139
}
140
else
141
{
142
strm <<
BESIndent::LMarg
<<
"container list: empty"
<< endl ;
143
}
144
145
strm <<
BESIndent::LMarg
<<
"action: "
<<
action
<< endl ;
146
strm <<
BESIndent::LMarg
<<
"action name: "
<<
action_name
<< endl ;
147
strm <<
BESIndent::LMarg
<<
"transmit protocol: "
<<
transmit_protocol
<< endl ;
148
if
(
data
.size() )
149
{
150
strm <<
BESIndent::LMarg
<<
"data:"
<< endl ;
151
BESIndent::Indent
() ;
152
data_citer
i =
data
.begin() ;
153
data_citer
ie =
data
.end() ;
154
for
( ; i != ie; i++ )
155
{
156
strm <<
BESIndent::LMarg
<< (*i).first <<
": "
157
<< (*i).second << endl ;
158
}
159
BESIndent::UnIndent
() ;
160
}
161
else
162
{
163
strm <<
BESIndent::LMarg
<<
"data: none"
<< endl ;
164
}
165
166
if
(
error_info
)
167
{
168
strm <<
BESIndent::LMarg
<<
"error info:"
<< endl ;
169
BESIndent::Indent
() ;
170
error_info
->
dump
( strm ) ;
171
BESIndent::UnIndent
() ;
172
}
173
else
174
{
175
strm <<
BESIndent::LMarg
<<
"error info: null"
<< endl ;
176
}
177
BESIndent::UnIndent
() ;
178
}
179
dispatch
BESDataHandlerInterface.cc
Generated by
1.8.3.1