40#include "config_hdf.h"
47#ifdef HAVE_SYS_PARAM_H
54#include <libdap/Error.h>
55#include <libdap/escaping.h>
56#include <libdap/Sequence.h>
57#include <libdap/debug.h>
60#include "HDFStructure.h"
65HDFStructure::HDFStructure(
const string &n,
const string &d) :
69HDFStructure::~HDFStructure() {
71BaseType *HDFStructure::ptr_duplicate() {
75 const string & hdf_file);
77void HDFStructure::set_read_p(
bool state) {
79 BaseType::set_read_p(state);
82bool HDFStructure::read() {
84 int status = read_tagref(-1, -1, err);
86 throw Error(unknown_error,
"Could not read from dataset.");
94bool HDFStructure::read_tagref(int32 , int32 ref,
int &err) {
99 string hdf_file = dataset();
100 string hdf_name = this->name();
102 BESDEBUG(
"h4",
" hdf_name = " << hdf_name << endl);
113 vgin.seek(hdf_name.c_str());
119 LoadStructureFromVgroup(
this, vgroup, hdf_file);
151 BESDEBUG(
"h4",
"Entering HDFStructure::transfer_attributes for variable " << name() << endl);
154 Vars_iter var = var_begin();
155 while (var != var_end()) {
157 BESDEBUG(
"h4",
"Processing the attributes for: " << (*var)->name() <<
" a " << (*var)->type_name() << endl);
158 (*var)->transfer_attributes(at);
161 BESDEBUG(
"h4",
"Got this exception: " << e.get_error_message() << endl);
167 AttrTable *mine = at->get_attr_table(name());
170 mine->set_is_global_attribute(
false);
171 AttrTable::Attr_iter at_p = mine->attr_begin();
172 while (at_p != mine->attr_end()) {
173 if (mine->get_attr_type(at_p) == Attr_container)
174 get_attr_table().append_container(
new AttrTable(*mine->get_attr_table(at_p)), mine->get_name(at_p));
176 get_attr_table().append_attr(mine->get_name(at_p), mine->get_type(at_p), mine->get_attr_vector(at_p));
virtual void transfer_attributes(libdap::AttrTable *at_container)