35 #include "D4StreamMarshaller.h" 36 #include "D4StreamUnMarshaller.h" 42 #include "DapIndent.h" 44 #undef CLEAR_LOCAL_DATA 51 D4Opaque::operator=(
const D4Opaque &rhs)
57 dynamic_cast<BaseType &
>(*this) = rhs;
65 D4Opaque::clear_local_data()
68 d_buf.erase(d_buf.begin(), d_buf.end());
76 D4Opaque::compute_checksum(
Crc32 &checksum)
78 checksum.
AddData(&d_buf[0], d_buf.size());
87 m.put_opaque_dap4( reinterpret_cast<char*>(&d_buf[0]), d_buf.size() ) ;
89 #ifdef CLEAR_LOCAL_DATA 102 D4Opaque::buf2val(
void **val)
110 *val =
new vector<uint8_t>;
112 *
static_cast<vector<uint8_t>*
>(*val) = d_buf;
114 return sizeof(vector<uint8_t>*);
118 D4Opaque::val2buf(
void *val,
bool)
122 d_buf = *
static_cast<dods_opaque*
>(val);
124 return sizeof(dods_opaque*);
132 D4Opaque::set_value(
const dods_opaque &value)
142 D4Opaque::dods_opaque
143 D4Opaque::value()
const 148 std::vector<BaseType *> *
150 DBG(cerr << __func__ <<
"() - Transform not implemented DAP4 Opaque type." << endl;);
156 D4Opaque::print_val(ostream &out,
string space,
bool print_decl_p)
158 if (print_decl_p) print_decl(out, space,
false);
162 std::ostream_iterator<unsigned int> out_it(out,
",");
163 std::copy(d_buf.begin(), d_buf.end() - 1, out_it);
164 out << (
unsigned int) d_buf.back();
167 if (print_decl_p) out <<
";" << endl;
171 D4Opaque::dump(ostream &strm)
const 173 strm << DapIndent::LMarg <<
"D4Opaque::dump - (" 174 << (
void *)
this <<
")" << endl ;
175 DapIndent::Indent() ;
176 BaseType::dump(strm) ;
178 ostream_iterator<uint8_t> out_it (strm,
" ");
179 std::copy ( d_buf.begin(), d_buf.end(), out_it );
181 DapIndent::UnIndent() ;
Contains the attributes for a dataset.
Read data from the stream made by D4StreamMarshaller.
top level DAP object to house generic methods
virtual void get_opaque_dap4(char **val, int64_t &len)
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
void AddData(const uint8_t *pData, const uint32_t length)