34#include "D4StreamMarshaller.h"
35#include "D4StreamUnMarshaller.h"
42#undef CLEAR_LOCAL_DATA
49D4Opaque::operator=(
const D4Opaque &rhs)
55 dynamic_cast<BaseType &
>(*this) = rhs;
66 d_buf.erase(d_buf.begin(), d_buf.end());
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
108 *val =
new vector<uint8_t>;
110 *
static_cast<vector<uint8_t>*
>(*val) = d_buf;
112 return sizeof(vector<uint8_t>*);
120 d_buf = *
static_cast<dods_opaque*
>(val);
122 return sizeof(dods_opaque*);
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;
164 strm << DapIndent::LMarg <<
"D4Opaque::dump - ("
165 << (
void *)
this <<
")" << endl ;
166 DapIndent::Indent() ;
169 ostream_iterator<uint8_t> out_it (strm,
" ");
170 std::copy ( d_buf.begin(), d_buf.end(), out_it );
172 DapIndent::UnIndent() ;
void AddData(const uint8_t *pData, const uint32_t length)
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.
virtual void dump(ostream &strm) const
dumps information about this object
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
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)
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)
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)