34 #include "D4StreamMarshaller.h" 35 #include "D4StreamUnMarshaller.h" 42 #undef CLEAR_LOCAL_DATA 49 D4Opaque::operator=(
const D4Opaque &rhs)
55 dynamic_cast<BaseType &
>(*this) = rhs;
63 D4Opaque::clear_local_data()
66 d_buf.erase(d_buf.begin(), d_buf.end());
74 D4Opaque::compute_checksum(
Crc32 &checksum)
76 checksum.
AddData(&d_buf[0], d_buf.size());
85 m.put_opaque_dap4( reinterpret_cast<char*>(&d_buf[0]), d_buf.size() ) ;
87 #ifdef CLEAR_LOCAL_DATA 100 D4Opaque::buf2val(
void **val)
108 *val =
new vector<uint8_t>;
110 *
static_cast<vector<uint8_t>*
>(*val) = d_buf;
112 return sizeof(vector<uint8_t>*);
116 D4Opaque::val2buf(
void *val,
bool)
120 d_buf = *
static_cast<dods_opaque*
>(val);
122 return sizeof(dods_opaque*);
130 D4Opaque::set_value(
const dods_opaque &value)
140 D4Opaque::dods_opaque
141 D4Opaque::value()
const 147 D4Opaque::print_val(ostream &out,
string space,
bool print_decl_p)
149 if (print_decl_p) print_decl(out, space,
false);
153 std::ostream_iterator<unsigned int> out_it(out,
",");
154 std::copy(d_buf.begin(), d_buf.end() - 1, out_it);
155 out << (
unsigned int) d_buf.back();
158 if (print_decl_p) out <<
";" << endl;
162 D4Opaque::dump(ostream &strm)
const 164 strm << DapIndent::LMarg <<
"D4Opaque::dump - (" 165 << (
void *)
this <<
")" << endl ;
166 DapIndent::Indent() ;
167 BaseType::dump(strm) ;
169 ostream_iterator<uint8_t> out_it (strm,
" ");
170 std::copy ( d_buf.begin(), d_buf.end(), out_it );
172 DapIndent::UnIndent() ;
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)