bes  Updated for version 3.20.5
FoDapJsonTransform Class Reference

#include <FoDapJsonTransform.h>

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 More...
 
 FoDapJsonTransform (libdap::DDS *dds)
 Get the JSON encoding for a DDS. More...
 
virtual void transform (std::ostream &ostrm, bool sendData)
 Transforms each of the marked variables of the DDS to JSON. More...
 

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 281 of file FoDapJsonTransform.cc.

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 295 of file FoDapJsonTransform.cc.

◆ transform()

void FoDapJsonTransform::transform ( std::ostream &  ostrm,
bool  sendData 
)
virtual

Transforms each of the marked variables of the DDS to JSON.

For each variable in the DDS, write out that variable and its attributes as JSON. Each OPeNDAP data type translates into a particular JSON type. Also write out any global attributes stored at the top level of the DataDDS.

Note
If sendData is true but the DDS does not contain data, the result is undefined.
Parameters
ostrmWrite the JSON to this stream
sendDataTrue if data should be sent, False to send only metadata.

Definition at line 319 of file FoDapJsonTransform.cc.


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