35 #include "D4StreamMarshaller.h" 36 #include "D4StreamUnMarshaller.h" 43 #undef CLEAR_LOCAL_DATA 50 D4Opaque::operator=(
const D4Opaque &rhs)
56 dynamic_cast<BaseType &
>(*this) = rhs;
64 D4Opaque::clear_local_data()
67 d_buf.erase(d_buf.begin(), d_buf.end());
75 D4Opaque::compute_checksum(
Crc32 &checksum)
77 checksum.
AddData(&d_buf[0], d_buf.size());
86 m.put_opaque_dap4( reinterpret_cast<char*>(&d_buf[0]), d_buf.size() ) ;
88 #ifdef CLEAR_LOCAL_DATA 101 D4Opaque::buf2val(
void **val)
109 *val =
new vector<uint8_t>;
111 *
static_cast<vector<uint8_t>*
>(*val) = d_buf;
113 return sizeof(vector<uint8_t>*);
117 D4Opaque::val2buf(
void *val,
bool)
121 d_buf = *
static_cast<dods_opaque*
>(val);
123 return sizeof(dods_opaque*);
131 D4Opaque::set_value(
const dods_opaque &value)
141 D4Opaque::dods_opaque
142 D4Opaque::value()
const 147 std::vector<BaseType *> *
149 DBG(cerr << __func__ <<
"() - Transform not implemented DAP4 Opaque type." << endl;);
155 D4Opaque::print_val(ostream &out,
string space,
bool print_decl_p)
157 if (print_decl_p) print_decl(out, space,
false);
161 std::ostream_iterator<unsigned int> out_it(out,
",");
162 std::copy(d_buf.begin(), d_buf.end() - 1, out_it);
163 out << (
unsigned int) d_buf.back();
166 if (print_decl_p) out <<
";" << endl;
170 D4Opaque::dump(ostream &strm)
const 172 strm << DapIndent::LMarg <<
"D4Opaque::dump - (" 173 << (
void *)
this <<
")" << endl ;
174 DapIndent::Indent() ;
175 BaseType::dump(strm) ;
177 ostream_iterator<uint8_t> out_it (strm,
" ");
178 std::copy ( d_buf.begin(), d_buf.end(), out_it );
180 DapIndent::UnIndent() ;
Contains the attributes for a dataset.
Read data from the stream made by D4StreamMarshaller.
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)