bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
|
A parameterized subclass of libdap::Array that allows us to apply constraints on NcML-specified data prior to serialization. All the code is in the .h, so no .cc is defined. More...
#include <NCMLArray.h>
Public Member Functions | |
virtual void | cacheCurrentConstraints () |
virtual void | cacheSuperclassStateIfNeeded () |
virtual void | cacheUnconstrainedDimensions () |
virtual void | copyDataFrom (libdap::Array &from) |
virtual Shape | getSuperShape () const |
virtual bool | haveConstraintsChangedSinceLastRead () const |
virtual bool | isConstrained () const |
virtual bool | isDataCached () const |
NCMLArray (const NCMLArray< T > &proto) | |
NCMLArray (const string &name) | |
NCMLArray< T > & | operator= (const NCMLArray< T > &rhs) |
virtual NCMLArray< T > * | ptr_duplicate () |
virtual bool | read () |
virtual bool | read_p () |
virtual void | set_read_p (bool state) |
virtual bool | set_value (dods_byte *val, int sz) |
virtual bool | set_value (dods_float32 *val, int sz) |
virtual bool | set_value (dods_float64 *val, int sz) |
virtual bool | set_value (dods_int16 *val, int sz) |
virtual bool | set_value (dods_int32 *val, int sz) |
virtual bool | set_value (dods_uint16 *val, int sz) |
virtual bool | set_value (dods_uint32 *val, int sz) |
virtual bool | set_value (string *val, int sz) |
virtual bool | set_value (vector< dods_byte > &val, int sz) |
virtual bool | set_value (vector< dods_float32 > &val, int sz) |
virtual bool | set_value (vector< dods_float64 > &val, int sz) |
virtual bool | set_value (vector< dods_int16 > &val, int sz) |
virtual bool | set_value (vector< dods_int32 > &val, int sz) |
virtual bool | set_value (vector< dods_uint16 > &val, int sz) |
virtual bool | set_value (vector< dods_uint32 > &val, int sz) |
virtual bool | set_value (vector< string > &val, int sz) |
virtual | ~NCMLArray () |
Protected Member Functions | |
virtual void | cacheValuesIfNeeded () |
virtual void | createAndSetConstrainedValueBuffer () |
Protected Attributes | |
Shape * | _currentConstraints |
Shape * | _noConstraints |
A parameterized subclass of libdap::Array that allows us to apply constraints on NcML-specified data prior to serialization. All the code is in the .h, so no .cc is defined.
This class caches the full set of data values of basic type T for the unconstrained super Array shape. It forces read_p() to ALWAYS be false to force a call of this->read() prior to any serialization of super Vector's data buffer.
In a read() call, if constraints have been applied to the Array superclass, this class will effect the Vector superclass data buffer (Vector._buf) in order to calculate and store the constrained data into Vector._buf so serialize() passes the constrained data properly. It maintains a copy of the full set of data, however, in case constraints are later removed or changed. It maintains a copy of the constrained shape used to generate the current Vector._buf so that on subsequent read() calls it can check to see if the constraints have changed and if so recompute Vector._buf.
We use a template on the underlying data type stored, such as dods_byte, dods_int32, etc. Note that this can ALSO be std::string, in which case Vector does special processing. We need to be aware of this in processing data.
NOTE: I examined the way this class is used and I think that, in fact, it is only currently used for new variable arrays (in which the data is provided in the source ncml file) and NEVER for existing arrays (which would mean massive copying of data). Now I may well be wrong about this assessment, but at the moment that what it looks like to me. ndp - 8/7/15
Definition at line 86 of file NCMLArray.h.
|
inline |
Definition at line 92 of file NCMLArray.h.
|
inlineexplicit |
Definition at line 97 of file NCMLArray.h.
|
inlineexplicit |
Definition at line 102 of file NCMLArray.h.
|
inlinevirtual |
Destroy any locally cached data
Definition at line 109 of file NCMLArray.h.
|
virtualinherited |
Store the current super Array shape as the current constraints so we remember
Definition at line 176 of file NCMLBaseArray.cc.
|
virtualinherited |
Required by subclasses to copy the original data values locally
Definition at line 201 of file NCMLBaseArray.cc.
|
virtualinherited |
Definition at line 187 of file NCMLBaseArray.cc.
|
inlineprotectedvirtual |
The first time we get a read(), we want to grab the current state of the superclass Array and Vector and cache them locally before we apply any needed constraints. ASSUME: that the current value of the _buf in Vector super is the FULL set of values for the UNCONSTRAINED Array. We also grab the dimensions from the super Array, but realize that these may be already constrained. For this reason, we cache the UNCONSTRAINED shape (i.e. the d.size() for all dimensions) as well as the full set of current dimensions, constrained or not. The latter tells of if constraints have been applied and if we need to compute a new _buf in read().
Implements ncml_module::NCMLBaseArray.
Definition at line 298 of file NCMLArray.h.
|
inlinevirtual |
Copy the rep from the given Array. This includes:
Implements ncml_module::NCMLBaseArray.
Definition at line 143 of file NCMLArray.h.
|
inlineprotectedvirtual |
If we have constraints that are not the same as the constraints on the last read() call (or if this is first read() call), use the super Array's current constrained dimension values to set Vector->val2buf() with the proper constrained data. ASSUMES: cacheSuperclassStateIfNeeded() has already been called once so that this instance's state contains all the unconstrained data values and shape.
Implements ncml_module::NCMLBaseArray.
Definition at line 345 of file NCMLArray.h.
|
virtualinherited |
Get the current dimensions of our superclass Array as a Shape object.
Definition at line 152 of file NCMLBaseArray.cc.
|
virtualinherited |
Return whether the constraints used to create Vector._buf for the last read() have changed, meaning we need to recompute Vector._buf using the new values.
Definition at line 164 of file NCMLBaseArray.cc.
|
virtualinherited |
Return whether the superclass Array has been constrained along any dimensions.
Definition at line 158 of file NCMLBaseArray.cc.
|
inlinevirtual |
Implements ncml_module::NCMLBaseArray.
Definition at line 174 of file NCMLArray.h.
|
inline |
Definition at line 115 of file NCMLArray.h.
|
inlinevirtual |
Override virtual constructor, deep clone
Definition at line 131 of file NCMLArray.h.
|
virtualinherited |
If there are no constraints and this is the first call to read(), we will do nothing, assuming the sueprclasses have everything under control.
If there are constraints, this function will create the correct buffer in Vector with the constrained data, generated from cached local values gathered to be from the unconstrained state.
The first call to read() will assume the CURRENT Vector buffer has ALL values (unconstrained) and store a local copy before generating a Vector buffer for the current constraints.
After this call, the caller can be assured that the Vector's data buffer has properly constrained data matching the current super Array's constraints. Subsequent calls to read() will see if the constraints used to create the Vector data buffer have changed and if so recompute a new Vector buffer from the locally cached values.
Definition at line 132 of file NCMLBaseArray.cc.
|
virtualinherited |
Override to return false if we have uncomputed constraints and only true if the current constraints match the Vector value buffer.
Definition at line 119 of file NCMLBaseArray.cc.
|
virtualinherited |
Override to disable setting of this flag. We will leave it false unless the constraints match the Vector value buffer.
Definition at line 126 of file NCMLBaseArray.cc.
|
inlinevirtual |
Definition at line 204 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 254 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 264 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 214 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 234 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 224 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 244 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 274 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 209 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 259 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 269 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 219 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 239 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 229 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 249 of file NCMLArray.h.
|
inlinevirtual |
Definition at line 279 of file NCMLArray.h.
|
protectedinherited |
Definition at line 162 of file NCMLBaseArray.h.
|
protectedinherited |
Definition at line 158 of file NCMLBaseArray.h.