34#include "D4StreamMarshaller.h"
35#include "D4StreamUnMarshaller.h"
44#undef CLEAR_LOCAL_DATA
53 BaseType::operator=(rhs);
58void D4Opaque::clear_local_data() {
60 d_buf.erase(d_buf.begin(), d_buf.end());
67void D4Opaque::compute_checksum(Crc32 &checksum) { checksum.
AddData(d_buf.data(), d_buf.size()); }
73 m.put_opaque_dap4(
reinterpret_cast<char *
>(d_buf.data()), d_buf.size());
75#ifdef CLEAR_LOCAL_DATA
82unsigned int D4Opaque::buf2val(
void **val) {
89 *val =
new vector<uint8_t>;
91 *
static_cast<vector<uint8_t> *
>(*val) = d_buf;
93 return sizeof(vector<uint8_t> *);
96unsigned int D4Opaque::val2buf(
void *val,
bool) {
99 d_buf = *
static_cast<dods_opaque *
>(val);
101 return sizeof(dods_opaque *);
119std::vector<BaseType *> *D4Opaque::transform_to_dap2(
AttrTable *) {
120 DBG(cerr << __func__ <<
"() - Transform not implemented DAP4 Opaque type." << endl;);
124void D4Opaque::print_val(ostream &out,
string space,
bool print_decl_p) {
126 print_decl(out, space,
false);
130 std::ostream_iterator<unsigned int> out_it(out,
",");
131 std::copy(d_buf.begin(), d_buf.end() - 1, out_it);
132 out << (
unsigned int)d_buf.back();
139void D4Opaque::dump(ostream &strm)
const {
140 strm << DapIndent::LMarg <<
"D4Opaque::dump - (" << (
void *)
this <<
")" << endl;
142 BaseType::dump(strm);
144 ostream_iterator<uint8_t> out_it(strm,
" ");
145 std::copy(d_buf.begin(), d_buf.end(), out_it);
147 DapIndent::UnIndent();
void AddData(const uint8_t *pData, const uint32_t length)
Contains the attributes for a dataset.
virtual dods_opaque value() const
virtual bool set_value(const dods_opaque &value)
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
Read data from the stream made by D4StreamMarshaller.
top level DAP object to house generic methods
virtual bool read_p()
Has this variable been read?
virtual void clear_local_data()
The basic data type for the DODS DAP types. */.