~ubuntu-branches/ubuntu/vivid/libdap/vivid

« back to all changes in this revision

Viewing changes to tests/ResponseBuilder.h

  • Committer: Package Import Robot
  • Author(s): Alastair McKinstry
  • Date: 2013-10-17 22:12:11 UTC
  • mfrom: (1.1.3)
  • Revision ID: package-import@ubuntu.com-20131017221211-re1r37k4d6wrtmeq
Tags: 3.12.0-1
* New upstream release.
  - No longer need curl-types-remove.patch 
* Add debian/watch file.
* Fix typo in hardening flags; Change  to =all,-pie ; 
  Use DEB_LDFLAGS_MAINT_APPEND. Closes: #697387.
* Enable parallel build. Closes: #723938.
* Depend on libcurl4-gnutls-dev | libcurl-dev. Closes: #722701.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
// -*- mode: c++; c-basic-offset:4 -*-
 
3
 
 
4
// This file is part of libdap, A C++ implementation of the OPeNDAP Data
 
5
// Access Protocol.
 
6
 
 
7
// Copyright (c) 2011 OPeNDAP, Inc.
 
8
// Author: James Gallagher <jgallagher@opendap.org>
 
9
//
 
10
// This library is free software; you can redistribute it and/or
 
11
// modify it under the terms of the GNU Lesser General Public
 
12
// License as published by the Free Software Foundation; either
 
13
// version 2.1 of the License, or (at your option) any later version.
 
14
//
 
15
// This library is distributed in the hope that it will be useful,
 
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 
18
// Lesser General Public License for more details.
 
19
//
 
20
// You should have received a copy of the GNU Lesser General Public
 
21
// License along with this library; if not, write to the Free Software
 
22
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
 
23
//
 
24
// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
 
25
 
 
26
#ifndef _response_builder_h
 
27
#define _response_builder_h
 
28
 
 
29
#include <string>
 
30
 
 
31
class libdap::ConstraintEvaluator;
 
32
class libdap::DDS;
 
33
 
 
34
/**
 
35
 * Used for testing only. This duplicates code in the bes/dap module.
 
36
 * jhrg 6/11/13
 
37
 */
 
38
 
 
39
class ResponseBuilder
 
40
{
 
41
public:
 
42
    friend class ResponseBuilderTest;
 
43
 
 
44
protected:
 
45
    std::string d_dataset;              /// Name of the dataset/database
 
46
    std::string d_ce;               /// Constraint expression
 
47
    std::string d_btp_func_ce;   /// The BTP functions, extracted from the CE
 
48
    int d_timeout;              /// Response timeout after N seconds
 
49
    std::string d_default_protocol;     /// Version std::string for the library's default protocol version
 
50
 
 
51
    void initialize();
 
52
 
 
53
public:
 
54
 
 
55
    /** Make an empty instance. Use the set_*() methods to load with needed
 
56
        values. You must call at least set_dataset_name() or be requesting
 
57
        version information. */
 
58
    ResponseBuilder() {
 
59
        initialize();
 
60
    }
 
61
 
 
62
    virtual ~ResponseBuilder();
 
63
 
 
64
    virtual std::string get_ce() const;
 
65
    virtual void set_ce(std::string _ce);
 
66
 
 
67
    virtual std::string get_dataset_name() const;
 
68
    virtual void set_dataset_name(const std::string _dataset);
 
69
 
 
70
    virtual void dataset_constraint(std::ostream &out, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool ce_eval = true);
 
71
    virtual void send_data(std::ostream &data_stream, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool with_mime_headers = true);
 
72
};
 
73
 
 
74
#endif // _response_builder_h