35#include "D4StreamMarshaller.h"
36#include "D4StreamUnMarshaller.h"
44#undef CLEAR_LOCAL_DATA
51D4Opaque::operator=(
const D4Opaque &rhs)
55 BaseType::operator=(rhs);
64 d_buf.erase(d_buf.begin(), d_buf.end());
74 checksum.
AddData(d_buf.data(), d_buf.size());
83 m.put_opaque_dap4(
reinterpret_cast<char*
>(d_buf.data()), d_buf.size() ) ;
85#ifdef CLEAR_LOCAL_DATA
106 *val =
new vector<uint8_t>;
108 *
static_cast<vector<uint8_t>*
>(*val) = d_buf;
110 return sizeof(vector<uint8_t>*);
118 d_buf = *
static_cast<dods_opaque*
>(val);
120 return sizeof(dods_opaque*);
144std::vector<BaseType *> *
146 DBG(cerr << __func__ <<
"() - Transform not implemented DAP4 Opaque type." << endl;);
154 if (print_decl_p)
print_decl(out, space,
false);
158 std::ostream_iterator<unsigned int> out_it(out,
",");
159 std::copy(d_buf.begin(), d_buf.end() - 1, out_it);
160 out << (
unsigned int) d_buf.back();
163 if (print_decl_p) out <<
";" << endl;
169 strm << DapIndent::LMarg <<
"D4Opaque::dump - ("
170 << (
void *)
this <<
")" << endl ;
171 DapIndent::Indent() ;
174 ostream_iterator<uint8_t> out_it (strm,
" ");
175 std::copy ( d_buf.begin(), d_buf.end(), out_it );
177 DapIndent::UnIndent() ;
void AddData(const uint8_t *pData, const uint32_t length)
Contains the attributes for a dataset.
virtual bool read()
Read data into a local buffer.
virtual void print_decl(FILE *out, string space=" ", bool print_semi=true, bool constraint_info=false, bool constrained=false)
Print an ASCII representation of the variable structure.
virtual bool read_p()
Has this variable been read?
virtual void set_read_p(bool state)
Sets the value of the read_p property.
void dump(ostream &strm) const override
dumps information about this object
virtual std::vector< BaseType * > * transform_to_dap2(AttrTable *parent_attr_table)
DAP4 to DAP2 transform.
virtual bool deserialize(UnMarshaller &, DDS *, bool=false)
Receive data from the net.
virtual void compute_checksum(Crc32 &checksum)
include the data for this variable in the checksum DAP4 includes a checksum with every data response....
virtual unsigned int buf2val(void **val)
Reads the class data.
virtual void clear_local_data()
virtual bool serialize(ConstraintEvaluator &, DDS &, Marshaller &, bool=true)
Move data to the net, then remove them from the object.
virtual void dump(std::ostream &strm) const
dumps information about this object
virtual dods_opaque value() const
virtual unsigned int val2buf(void *val, bool reuse=false)
Loads class data.
virtual bool set_value(const dods_opaque &value)
virtual void print_val(FILE *, std::string="", bool=true)
Prints the value of the variable.
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.
virtual void get_opaque_dap4(char **val, int64_t &len)
top level DAP object to house generic methods