bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
CachedSequence.h
1// -*- mode: c++; c-basic-offset:4 -*-
2
3// This file is part of libdap, A C++ implementation of the OPeNDAP Data
4// Access Protocol.
5
6// Copyright (c) 2016 OPeNDAP, Inc.
7// Author: James Gallagher <jgallagher@opendap.org>
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., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22//
23// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
24
25#ifndef _cached_sequence_h
26#define _cached_sequence_h 1
27
28#include <libdap/Sequence.h>
29
30namespace libdap {
31class ConstraintEvaluator;
32class DDS;
33class Marshaller;
34}
35
36// namespace bes {
37
42class CachedSequence: public libdap::Sequence
43{
44private:
45protected:
46 unsigned int d_value_index;
47
48 void load_prototypes_with_values(libdap::BaseTypeRow &btr, bool safe = true);
49
50public:
59 CachedSequence(const string &n) : Sequence(n), d_value_index(0) { }
60
71 CachedSequence(const string &n, const string &d) : Sequence(n, d), d_value_index(0) { }
72
74 CachedSequence(const CachedSequence &rhs) : Sequence(rhs), d_value_index(0) { }
75
76 virtual ~CachedSequence() { }
77
78 virtual BaseType *ptr_duplicate() { return new CachedSequence(*this); }
79
80 CachedSequence &operator=(const CachedSequence &rhs) {
81 if (this == &rhs)
82 return *this;
83
84 static_cast<Sequence &>(*this) = rhs; // run Sequence=
85
86 return *this;
87 }
88
89 virtual bool read_row(int row, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool ce_eval);
90
91 virtual void intern_data(libdap::ConstraintEvaluator &eval, libdap::DDS &dds);
92 virtual bool serialize(libdap::ConstraintEvaluator &eval, libdap::DDS &dds, libdap::Marshaller &m, bool ce_eval = true);
93
94 virtual void dump(ostream &strm) const;
95};
96
97// } // namespace bes
98
99#endif //_cached_sequence_h
Specialization of Sequence for cached responses.
virtual void intern_data(libdap::ConstraintEvaluator &eval, libdap::DDS &dds)
Specialization that resets CachedSequence's 'value index' state variable.
virtual void dump(ostream &strm) const
dumps information about this object
CachedSequence(const CachedSequence &rhs)
The Sequence copy constructor.
CachedSequence(const string &n, const string &d)
The Sequence server-side constructor.
virtual bool read_row(int row, libdap::DDS &dds, libdap::ConstraintEvaluator &eval, bool ce_eval)
Read row number row of the Sequence.
virtual bool serialize(libdap::ConstraintEvaluator &eval, libdap::DDS &dds, libdap::Marshaller &m, bool ce_eval=true)
Specialization that resets CachedSequence's 'value index' state variable.
CachedSequence(const string &n)
The Sequence constructor.