OPeNDAP Hyrax Back End Server (BES)  Updated for version 3.8.3
hdfdesc.cc File Reference

DAP attributes and structure description generation code. More...

#include "config_hdf.h"
#include <cstdio>
#include <cassert>
#include <libgen.h>
#include <string>
#include <fstream>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <functional>
#include <unistd.h>
#include <sys/types.h>
#include <dirent.h>
#include <iomanip>
#include <mfhdf.h>
#include <DDS.h>
#include <DAS.h>
#include <escaping.h>
#include <parser.h>
#include <InternalErr.h>
#include <debug.h>
#include <BESDebug.h>
#include <BESLog.h>
#include "hcstream.h"
#include "hdfclass.h"
#include "hcerr.h"
#include "dhdferr.h"
#include "HDFArray.h"
#include "HDFSequence.h"
#include "HDFTypeFactory.h"
#include "HDFGrid.h"
#include "dodsutil.h"
#include "hdf-dods.h"
#include "hdf-maps.h"
#include "HDFByte.h"
#include "HDFInt16.h"
#include "HDFUInt16.h"
#include "HDFInt32.h"
#include "HDFUInt32.h"
#include "HDFFloat32.h"
#include "HDFFloat64.h"
#include "HDFStr.h"
#include "HE2CF.h"
#include "HDFSP.h"
#include "HDFSPArray_RealField.h"
#include "HDFSPArrayGeoField.h"
#include "HDFSPArrayMissField.h"
#include "HDFSPArrayAddCVField.h"
#include "HDFSPArray_VDField.h"
#include "HDFCFStrField.h"
#include "HDFCFStr.h"
#include "HDFCFUtil.h"
Include dependency graph for hdfdesc.cc:

Go to the source code of this file.

Macros

#define ATTR_STRING_QUOTE_FIX
 
#define HANDLE_CASE(tid, type)
 
#define HANDLE_CASE(tid, type)
 
#define HANDLE_CASE(tid, type)
 
#define SIGNED_BYTE_TO_INT32   1
 

Functions

void AddHDFAttr (DAS &das, const string &varname, const vector< hdf_attr > &hav)
 
void AddHDFAttr (DAS &das, const string &varname, const vector< string > &anv)
 
void change_das_mod08_scale_offset (DAS &das, HDFSP::File *spf)
 
int check_special_eosfile (const string &filename, string &grid_name, int32 sdfd, int32 fileid)
 
void hdfeos_delete_buffer (void *buffer)
 
yy_buffer_state * hdfeos_scan_string (const char *str)
 
void * hdfeos_string (const char *yy_str)
 
void hdfeos_switch_to_buffer (void *new_buffer)
 
int hdfeosparse (libdap::parser_arg *arg)
 
template<class T >
string num2string (T n)
 
void read_das (DAS &das, const string &filename)
 
bool read_das_hdfhybrid (DAS &das, const string &filename, int32 sdfd, int32 fileid, HDFSP::File **h4filepptr)
 
bool read_das_hdfsp (DAS &das, const string &filename, int32 sdfd, int32 fileid, HDFSP::File **h4filepptr)
 
bool read_das_special_eos2 (DAS &das, const string &filename, int32 sdid, int32 fileid, bool ecs_metadata, HDFSP::File **h4filepptr)
 
bool read_das_special_eos2_core (DAS &das, HDFSP::File *spf, const string &filename, bool ecs_metadata)
 
void read_dds (DDS &dds, const string &filename)
 
bool read_dds_hdfhybrid (DDS &dds, const string &filename, int32 sdfd, int32 fileid, HDFSP::File *h4file)
 
bool read_dds_hdfsp (DDS &dds, const string &filename, int32 sdfd, int32 fileid, HDFSP::File *h4file)
 
bool read_dds_special_1d_grid (DDS &dds, HDFSP::File *spf, const string &filename, int32 sdfd, int32 fileid)
 
void read_dds_spfields (DDS &dds, const string &filename, const int sdfd, HDFSP::SDField *spsds, SPType sptype)
 
void read_dds_spvdfields (DDS &dds, const string &filename, const int fileid, int32 vdref, int32 numrec, HDFSP::VDField *spvd)
 

Detailed Description

DAP attributes and structure description generation code.

Definition in file hdfdesc.cc.

Macro Definition Documentation

#define ATTR_STRING_QUOTE_FIX

Definition at line 155 of file hdfdesc.cc.

#define HANDLE_CASE (   tid,
  type 
)
Value:
case tid: \
bt = new (type)((*it_g)->getNewName(),filename); \
break;

Referenced by read_dds_special_1d_grid(), read_dds_spfields(), and read_dds_spvdfields().

#define HANDLE_CASE (   tid,
  type 
)
Value:
case tid: \
bt = new (type)(spsds->getNewName(),filename); \
break;
#define HANDLE_CASE (   tid,
  type 
)
Value:
case tid: \
bt = new (type)(spvd->getNewName(),filename); \
break;
#define SIGNED_BYTE_TO_INT32   1

Definition at line 105 of file hdfdesc.cc.

Function Documentation

void AddHDFAttr ( DAS &  das,
const string &  varname,
const vector< hdf_attr > &  hav 
)

Definition at line 4279 of file hdfdesc.cc.

References DAPTypeName(), hdfeos_delete_buffer(), hdfeos_string(), hdfeosparse(), BESLog::TheLog(), and THROW.

Here is the call graph for this function:

void AddHDFAttr ( DAS &  das,
const string &  varname,
const vector< string > &  anv 
)

Definition at line 4373 of file hdfdesc.cc.

References THROW.

void change_das_mod08_scale_offset ( DAS &  das,
HDFSP::File spf 
)

Definition at line 2995 of file hdfdesc.cc.

References HDFSP::SD::getFields(), HDFSP::File::getSD(), HDFCFUtil::print_attr(), and HDFCFUtil::print_type().

Here is the call graph for this function:

int check_special_eosfile ( const string &  filename,
string &  grid_name,
int32  sdfd,
int32  fileid 
)

Definition at line 3628 of file hdfdesc.cc.

References basename().

Here is the call graph for this function:

void hdfeos_delete_buffer ( void *  buffer)

Definition at line 2045 of file lex.hdfeos.cc.

References hdfeos_delete_buffer().

Referenced by AddHDFAttr(), read_das_hdfsp(), and read_das_special_eos2_core().

Here is the call graph for this function:

yy_buffer_state* hdfeos_scan_string ( const char *  str)
void* hdfeos_string ( const char *  yy_str)

Definition at line 2033 of file lex.hdfeos.cc.

References hdfeos_scan_string().

Referenced by AddHDFAttr(), read_das_hdfsp(), and read_das_special_eos2_core().

Here is the call graph for this function:

void hdfeos_switch_to_buffer ( void *  new_buffer)

Definition at line 2039 of file lex.hdfeos.cc.

References hdfeos_switch_to_buffer().

Here is the call graph for this function:

int hdfeosparse ( libdap::parser_arg *  arg)
template<class T >
string num2string ( n)

Definition at line 157 of file hdfdesc.cc.

void read_das ( DAS &  das,
const string &  filename 
)

Definition at line 3913 of file hdfdesc.cc.

References basename(), NULL, and THROW.

Referenced by HDF4RequestHandler::hdf4_build_das(), HDF4RequestHandler::hdf4_build_data(), and HDF4RequestHandler::hdf4_build_dds().

Here is the call graph for this function:

bool read_das_hdfhybrid ( DAS &  das,
const string &  filename,
int32  sdfd,
int32  fileid,
HDFSP::File **  h4filepptr 
)
bool read_das_special_eos2 ( DAS &  das,
const string &  filename,
int32  sdid,
int32  fileid,
bool  ecs_metadata,
HDFSP::File **  h4filepptr 
)

Definition at line 2755 of file hdfdesc.cc.

References BESDEBUG, NULL, HDFSP::File::Prepare(), HDFSP::File::Read(), read_das_special_eos2_core(), and HDFSP::Exception::what().

Here is the call graph for this function:

bool read_das_special_eos2_core ( DAS &  das,
HDFSP::File spf,
const string &  filename,
bool  ecs_metadata 
)
void read_dds ( DDS &  dds,
const string &  filename 
)

Definition at line 3900 of file hdfdesc.cc.

References basename(), and THROW.

Referenced by HDF4RequestHandler::hdf4_build_data(), and HDF4RequestHandler::hdf4_build_dds().

Here is the call graph for this function:

bool read_dds_hdfhybrid ( DDS &  dds,
const string &  filename,
int32  sdfd,
int32  fileid,
HDFSP::File h4file 
)
bool read_dds_special_1d_grid ( DDS &  dds,
HDFSP::File spf,
const string &  filename,
int32  sdfd,
int32  fileid 
)

Definition at line 3074 of file hdfdesc.cc.

References BESDEBUG, HDFSP::SD::getFields(), HDFSP::File::getSD(), HANDLE_CASE, NULL, and OTHERHDF.

Here is the call graph for this function:

void read_dds_spfields ( DDS &  dds,
const string &  filename,
const int  sdfd,
HDFSP::SDField spsds,
SPType  sptype 
)
void read_dds_spvdfields ( DDS &  dds,
const string &  filename,
const int  fileid,
int32  vdref,
int32  numrec,
HDFSP::VDField spvd 
)

Definition at line 3497 of file hdfdesc.cc.

References BESDEBUG, HDFSP::VDField::getFieldOrder(), HDFSP::Field::getName(), HDFSP::Field::getNewName(), HDFSP::Field::getType(), HANDLE_CASE, and NULL.

Referenced by read_dds_hdfsp().

Here is the call graph for this function: