bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
NCMLBaseArray.h
1
2// This file is part of the "NcML Module" project, a BES module designed
3// to allow NcML files to be used to be used as a wrapper to add
4// AIS to existing datasets of any format.
5//
6// Copyright (c) 2009 OPeNDAP, Inc.
7// Author: Michael Johnson <m.johnson@opendap.org>
8//
9// For more information, please also see the main website: http://opendap.org/
10//
11// This library is free software; you can redistribute it and/or
12// modify it under the terms of the GNU Lesser General Public
13// License as published by the Free Software Foundation; either
14// version 2.1 of the License, or (at your option) any later version.
15//
16// This library is distributed in the hope that it will be useful,
17// but WITHOUT ANY WARRANTY; without even the implied warranty of
18// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19// Lesser General Public License for more details.
20//
21// You should have received a copy of the GNU Lesser General Public
22// License along with this library; if not, write to the Free Software
23// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
24//
25// Please see the files COPYING and COPYRIGHT for more information on the GLPL.
26//
27// You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
29#ifndef __NCML_MODULE__NCMLBASEARRAY_H__
30#define __NCML_MODULE__NCMLBASEARRAY_H__
31
32#include <libdap/Array.h>
33#include <memory>
34#include "Shape.h"
35
41namespace ncml_module {
42
43class NCMLBaseArray: public libdap::Array {
44public:
45 // class methods
46
47#if 0
63 static unique_ptr< NCMLBaseArray > createFromArray(const libdap::Array& proto);
64#endif
65
66public:
67 // Instance methods
68 NCMLBaseArray();
69 explicit NCMLBaseArray(const std::string& name);
70 explicit NCMLBaseArray(const NCMLBaseArray& proto);
71
72 virtual ~NCMLBaseArray();
73
74 NCMLBaseArray& operator=(const NCMLBaseArray& rhs);
75
79 virtual bool read_p();
80
84 virtual void set_read_p(bool state);
85
104 virtual bool read();
105
107 virtual Shape getSuperShape() const;
108
113 virtual bool isConstrained() const;
114
119 virtual bool haveConstraintsChangedSinceLastRead() const;
120
122 virtual void cacheCurrentConstraints();
123
124 virtual void cacheUnconstrainedDimensions();
125
127 virtual void cacheSuperclassStateIfNeeded();
128
130 virtual void cacheValuesIfNeeded() = 0;
131
136 virtual void copyDataFrom(libdap::Array& from)=0;
137
139 virtual bool isDataCached() const = 0;
140
146
147private:
148
150 void copyLocalRepFrom(const NCMLBaseArray& proto);
151
153 void destroy() noexcept;
154
155protected:
156 // Data rep
157 // The Shape for the case of NO constraints on the data, or null if not set yet.
158 Shape* _noConstraints;
159
160 // The Shape for the CURRENT dimensions in super Array, used to calculate the transmission buffer
161 // for read() and also to check if haveConstraintsChangedSinceLastRead(). Null if not set yet.
162 Shape* _currentConstraints;
163};
164
165}
166
167#endif /* __NCML_MODULE__NCMLBASEARRAY_H__ */
virtual void copyDataFrom(libdap::Array &from)=0
virtual Shape getSuperShape() const
virtual bool isConstrained() const
virtual void cacheSuperclassStateIfNeeded()
virtual void cacheCurrentConstraints()
virtual void createAndSetConstrainedValueBuffer()=0
virtual void set_read_p(bool state)
virtual bool haveConstraintsChangedSinceLastRead() const
virtual bool isDataCached() const =0
virtual void cacheValuesIfNeeded()=0
A wrapper class for a vector of Array::dimension structs.
Definition Shape.h:58
STL class.
NcML Parser for adding/modifying/removing metadata (attributes) to existing local datasets using NcML...