libdap Updated for version 3.21.1
libdap4 is an implementation of OPeNDAP's DAP protocol.
libdap::D4RValue Class Reference

#include <D4RValue.h>

Collaboration diagram for libdap::D4RValue:
Collaboration graph

Public Types

enum  value_kind { unknown , basetype , function , constant }
 

Public Member Functions

 D4RValue ()
 
 D4RValue (BaseType *btp)
 
 D4RValue (const D4RValue &src)
 
 D4RValue (D4Function f, D4RValueList *args)
 
 D4RValue (double r)
 
 D4RValue (long long i)
 
 D4RValue (std::string s)
 
 D4RValue (std::vector< dods_byte > &byte_args)
 
 D4RValue (std::vector< dods_float32 > &byte_float32)
 
 D4RValue (std::vector< dods_float64 > &byte_float64)
 
 D4RValue (std::vector< dods_int16 > &byte_int16)
 
 D4RValue (std::vector< dods_int32 > &byte_int32)
 
 D4RValue (std::vector< dods_int64 > &byte_int64)
 
 D4RValue (std::vector< dods_int8 > &byte_int8)
 
 D4RValue (std::vector< dods_uint16 > &byte_uint16)
 
 D4RValue (std::vector< dods_uint32 > &byte_uint32)
 
 D4RValue (std::vector< dods_uint64 > &byte_uint64)
 
 D4RValue (unsigned long long ui)
 
value_kind get_kind () const
 What kind of thing holds the value Values in DAP4 constraints are either constants, dataset variables or function results. It might be nice to know the source of a given value in order to optimize the evaluation of certain kinds of expressions.
 
D4RValueoperator= (D4RValue &rhs)
 
virtual BaseTypevalue ()
 Get the value for a RValue object.
 
virtual BaseTypevalue (DMR &dmr)
 Get the value for a RValue object Return the BaseType * for a given RValue. For a dataset variable, read the variable's value and, for a function, evaluate that function. Since read() is called for a dataset variable each time this method is called, if the variable is part of a Sequence, the next value in the sequence will be returned. However, since this code also sets the read_p property after calling read(), if the variable does not have a new value, read() will not be called (using the read_p property, the read() method is called only when the variable has a new value to be read.
 
virtual ~D4RValue ()
 

Friends

class D4RValueList
 

Detailed Description

Holds the RValues for the D4 function parser and for the filter expression evaluator.

Definition at line 79 of file D4RValue.h.

Member Enumeration Documentation

◆ value_kind

Enumerator
unknown 
basetype 
function 
constant 

Definition at line 81 of file D4RValue.h.

Constructor & Destructor Documentation

◆ D4RValue() [1/18]

libdap::D4RValue::D4RValue ( )
inline

Definition at line 99 of file D4RValue.h.

◆ D4RValue() [2/18]

libdap::D4RValue::D4RValue ( const D4RValue & src)
inline

Definition at line 100 of file D4RValue.h.

◆ D4RValue() [3/18]

libdap::D4RValue::D4RValue ( BaseType * btp)
inline

Definition at line 101 of file D4RValue.h.

◆ D4RValue() [4/18]

libdap::D4RValue::D4RValue ( D4Function f,
D4RValueList * args )
inline

Definition at line 102 of file D4RValue.h.

◆ D4RValue() [5/18]

libdap::D4RValue::D4RValue ( unsigned long long ui)

Definition at line 96 of file D4RValue.cc.

◆ D4RValue() [6/18]

libdap::D4RValue::D4RValue ( long long i)

Definition at line 103 of file D4RValue.cc.

◆ D4RValue() [7/18]

libdap::D4RValue::D4RValue ( double r)

Definition at line 109 of file D4RValue.cc.

◆ D4RValue() [8/18]

libdap::D4RValue::D4RValue ( std::string s)

Definition at line 115 of file D4RValue.cc.

◆ D4RValue() [9/18]

libdap::D4RValue::D4RValue ( std::vector< dods_byte > & byte_args)

Definition at line 121 of file D4RValue.cc.

◆ D4RValue() [10/18]

libdap::D4RValue::D4RValue ( std::vector< dods_int8 > & byte_int8)

Definition at line 127 of file D4RValue.cc.

◆ D4RValue() [11/18]

libdap::D4RValue::D4RValue ( std::vector< dods_uint16 > & byte_uint16)

Definition at line 133 of file D4RValue.cc.

◆ D4RValue() [12/18]

libdap::D4RValue::D4RValue ( std::vector< dods_int16 > & byte_int16)

Definition at line 139 of file D4RValue.cc.

◆ D4RValue() [13/18]

libdap::D4RValue::D4RValue ( std::vector< dods_uint32 > & byte_uint32)

Definition at line 145 of file D4RValue.cc.

◆ D4RValue() [14/18]

libdap::D4RValue::D4RValue ( std::vector< dods_int32 > & byte_int32)

Definition at line 151 of file D4RValue.cc.

◆ D4RValue() [15/18]

libdap::D4RValue::D4RValue ( std::vector< dods_uint64 > & byte_uint64)

Definition at line 157 of file D4RValue.cc.

◆ D4RValue() [16/18]

libdap::D4RValue::D4RValue ( std::vector< dods_int64 > & byte_int64)

Definition at line 163 of file D4RValue.cc.

◆ D4RValue() [17/18]

libdap::D4RValue::D4RValue ( std::vector< dods_float32 > & byte_float32)

Definition at line 169 of file D4RValue.cc.

◆ D4RValue() [18/18]

libdap::D4RValue::D4RValue ( std::vector< dods_float64 > & byte_float64)

Definition at line 175 of file D4RValue.cc.

◆ ~D4RValue()

libdap::D4RValue::~D4RValue ( )
virtual

Definition at line 181 of file D4RValue.cc.

Member Function Documentation

◆ get_kind()

value_kind libdap::D4RValue::get_kind ( ) const
inline

What kind of thing holds the value Values in DAP4 constraints are either constants, dataset variables or function results. It might be nice to know the source of a given value in order to optimize the evaluation of certain kinds of expressions.

Returns
The 'value_kind' of this value.

Definition at line 139 of file D4RValue.h.

◆ operator=()

D4RValue & libdap::D4RValue::operator= ( D4RValue & rhs)
inline

Definition at line 122 of file D4RValue.h.

◆ value() [1/2]

BaseType * libdap::D4RValue::value ( )
virtual

Get the value for a RValue object.

This version of value() will not work for function RValues, but has the advantage that it can be used more easily for the D4RValue objects built for, and stored in, D4Filter- Clause instances.

See also
D4RValue::value(DMR&)
Returns
The value wrapped in a BaseType*

Definition at line 272 of file D4RValue.cc.

◆ value() [2/2]

BaseType * libdap::D4RValue::value ( DMR & dmr)
virtual

Get the value for a RValue object Return the BaseType * for a given RValue. For a dataset variable, read the variable's value and, for a function, evaluate that function. Since read() is called for a dataset variable each time this method is called, if the variable is part of a Sequence, the next value in the sequence will be returned. However, since this code also sets the read_p property after calling read(), if the variable does not have a new value, read() will not be called (using the read_p property, the read() method is called only when the variable has a new value to be read.

Note
Unlike the DAP2 functions, we have an easier-to-follow memory model for function values. The values (BaseType*) returned by this method will be packaged up in a RValueList and deleted when that list is deleted. Constant values and function result values will be deleted at that time; variables will not. Thus Server Functions should always allocate storage for their return values.
Todo
Could move the operation that wraps a constant in a BaseType to this method while providing other ways to access the value(s) (methods to determine if the rvalue is a constant and what DAP type it is, e.g.). This would provide an optimization for the filter evaluator which may access the values many times. We might also modify the server side functions so they could access constant values more efficiently.
Parameters
dmrThe DMR to pass to a function.
Returns
A BaseType* that holds the value.

Definition at line 244 of file D4RValue.cc.

Friends And Related Symbol Documentation

◆ D4RValueList

friend class D4RValueList
friend

Definition at line 96 of file D4RValue.h.


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