bes Updated for version 3.21.1
The Backend Server (BES) is the lower two tiers of the Hyrax data server
CachedSequence Class Reference

Specialization of Sequence for cached responses. More...

#include <CachedSequence.h>

Inheritance diagram for CachedSequence:
Inheritance graph
Collaboration diagram for CachedSequence:
Collaboration graph

Public Member Functions

 CachedSequence (const CachedSequence &rhs)
 The Sequence copy constructor.
 
 CachedSequence (const string &n)
 The Sequence constructor.
 
 CachedSequence (const string &n, const string &d)
 The Sequence server-side constructor.
 
virtual void dump (ostream &strm) const
 dumps information about this object
 
virtual void intern_data (libdap::ConstraintEvaluator &eval, libdap::DDS &dds)
 Specialization that resets CachedSequence's 'value index' state variable.
 
CachedSequenceoperator= (const CachedSequence &rhs)
 
virtual BaseType * ptr_duplicate ()
 
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.
 

Protected Member Functions

void load_prototypes_with_values (libdap::BaseTypeRow &btr, bool safe=true)
 

Protected Attributes

unsigned int d_value_index
 

Detailed Description

Specialization of Sequence for cached responses.

Assumes that the data are loaded into the Sequence using set_value()

Definition at line 42 of file CachedSequence.h.

Constructor & Destructor Documentation

◆ CachedSequence() [1/3]

CachedSequence::CachedSequence ( const string & n)
inline

The Sequence constructor.

The Sequence constructor requires only the name of the variable to be created. The name may be omitted, which will create a nameless variable. This may be adequate for some applications.

Parameters
nA string containing the name of the variable to be created.

Definition at line 59 of file CachedSequence.h.

◆ CachedSequence() [2/3]

CachedSequence::CachedSequence ( const string & n,
const string & d )
inline

The Sequence server-side constructor.

The Sequence server-side constructor requires the name of the variable to be created and the dataset name from which this variable is being created.

Parameters
nA string containing the name of the variable to be created.
dA string containing the name of the dataset from which this variable is being created.

Definition at line 71 of file CachedSequence.h.

◆ CachedSequence() [3/3]

CachedSequence::CachedSequence ( const CachedSequence & rhs)
inline

The Sequence copy constructor.

Definition at line 74 of file CachedSequence.h.

◆ ~CachedSequence()

virtual CachedSequence::~CachedSequence ( )
inlinevirtual

Definition at line 76 of file CachedSequence.h.

Member Function Documentation

◆ dump()

void CachedSequence::dump ( ostream & strm) const
virtual

dumps information about this object

Displays the pointer value of this instance and information about this instance.

Parameters
strmC++ i/o stream to dump the information to
Returns
void

Definition at line 232 of file CachedSequence.cc.

◆ intern_data()

void CachedSequence::intern_data ( libdap::ConstraintEvaluator & eval,
libdap::DDS & dds )
virtual

Specialization that resets CachedSequence's 'value index' state variable.

This specialization resets the index into the 'value' field and calls the parent class' method.

Parameters
eval
dds

Definition at line 216 of file CachedSequence.cc.

◆ load_prototypes_with_values()

void CachedSequence::load_prototypes_with_values ( libdap::BaseTypeRow & btr,
bool safe = true )
protected

Definition at line 59 of file CachedSequence.cc.

◆ operator=()

CachedSequence & CachedSequence::operator= ( const CachedSequence & rhs)
inline

Definition at line 80 of file CachedSequence.h.

◆ ptr_duplicate()

virtual BaseType * CachedSequence::ptr_duplicate ( )
inlinevirtual

Definition at line 78 of file CachedSequence.h.

◆ read_row()

bool CachedSequence::read_row ( int row,
libdap::DDS & dds,
libdap::ConstraintEvaluator & eval,
bool ce_eval )
virtual

Read row number row of the Sequence.

This version of read_row() gets the next row of data from the internal 'values' of the Sequence (d_values field) and loads them into the prototype variables so that the stock serialize() code can be used to write them out.

Note
This code can likely replace the class TabularSequence in bes/functions. It is a more general version of that because it should work for nested sequences too.
The first row is row number zero. A Sequence with 100 rows will have row numbers 0 to 99. This method makes use of the get_row_number() method (added in libdap 3.17.1) that wraps the d_row_number field. The field uses -1 as a sentinel meaning 'before the start' so the value must be incremented to '0' before it can be used to read a row.
Returns
A boolean value, with TRUE indicating that read_row should be called again because there's more data to be read. FALSE indicates the end of the Sequence.
Parameters
rowThe row number to read.
ddsA reference to the DDS for this dataset.
evalUse this as the constraint expression evaluator.
ce_evalIf True, evaluate any CE, otherwise do not.

Definition at line 142 of file CachedSequence.cc.

◆ serialize()

bool CachedSequence::serialize ( libdap::ConstraintEvaluator & eval,
libdap::DDS & dds,
libdap::Marshaller & m,
bool ce_eval = true )
virtual

Specialization that resets CachedSequence's 'value index' state variable.

This specialization resets the index into the 'value' field and calls the parent class' method.

Parameters
eval
dds
m
ce_eval
Returns
The value of the parent class' serialize() method.

Definition at line 199 of file CachedSequence.cc.

Member Data Documentation

◆ d_value_index

unsigned int CachedSequence::d_value_index
protected

Definition at line 46 of file CachedSequence.h.


The documentation for this class was generated from the following files: