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

#include <FoDapJsonTransform.h>

Inheritance diagram for FoDapJsonTransform:
Inheritance graph
Collaboration diagram for FoDapJsonTransform:
Collaboration graph

Public Member Functions

virtual void dump (std::ostream &strm) const
 dumps information about this transformation object for debugging purposes
 
 FoDapJsonTransform (libdap::DDS *dds)
 Get the JSON encoding for a DDS.
 
template<typename T>
void json_simple_type_array (ostream *strm, libdap::Array *a, string indent, bool sendData)
 
template<typename T>
unsigned int json_simple_type_array_worker (ostream *strm, T *values, unsigned int indx, vector< unsigned int > *shape, unsigned int currentDim)
 
virtual void transform (std::ostream &ostrm, bool sendData)
 

Detailed Description

Used to transform a DDS into a w10n JSON metadata or w10n JSON data document. The output is written to a local file whose name is passed as a parameter to the constructor.

Definition at line 51 of file FoDapJsonTransform.h.

Constructor & Destructor Documentation

◆ FoDapJsonTransform()

FoDapJsonTransform::FoDapJsonTransform ( libdap::DDS * dds)

Get the JSON encoding for a DDS.

Set up the JSON output transform object. This constructor builds an object that will build a JSON encoding for a DDS. This class can return both the entire DDS, including data, and a metadata-only response.

Note
The 'transform' method is used to build the response and a bool flag is passed to it to select data or metadata. However, if that flag is true and the DDS does not already contain data, the result is undefined.
Parameters
ddsDDS object
Exceptions
BESInternalErrorif the DDS* is null or if localfile is empty.

Definition at line 287 of file FoDapJsonTransform.cc.

◆ ~FoDapJsonTransform()

virtual FoDapJsonTransform::~FoDapJsonTransform ( )
inlinevirtual

Definition at line 87 of file FoDapJsonTransform.h.

Member Function Documentation

◆ dump()

void FoDapJsonTransform::dump ( std::ostream & strm) const
virtual

dumps information about this transformation object for debugging purposes

Displays the pointer value of this instance plus instance data, including all of the FoJson objects converted from DAP objects that are to be sent to the netcdf file.

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

Implements BESObj.

Definition at line 301 of file FoDapJsonTransform.cc.

◆ json_simple_type_array()

template<typename T>
void FoDapJsonTransform::json_simple_type_array ( ostream * strm,
libdap::Array * a,
string indent,
bool sendData )

Writes the json representation of the passed DAP Array of simple types. If the parameter "sendData" evaluates to true then data will also be sent.

Definition at line 112 of file FoDapJsonTransform.cc.

◆ json_simple_type_array_worker()

template<typename T>
unsigned int FoDapJsonTransform::json_simple_type_array_worker ( ostream * strm,
T * values,
unsigned int indx,
vector< unsigned int > * shape,
unsigned int currentDim )

@TODO Handle String and URL Arrays including backslash escaping double quotes in values.

Definition at line 76 of file FoDapJsonTransform.cc.


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