|
libdap++ Updated for version 3.11.4
|
marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using XDR More...
#include <XDRStreamMarshaller.h>


Public Member Functions | |
| virtual void | checksum_update (const void *data, unsigned long len) |
| virtual void | dump (ostream &strm) const |
| dump the contents of this object to the specified ostream | |
| virtual string | get_checksum () |
| virtual void | put_byte (dods_byte val) |
| virtual void | put_float32 (dods_float32 val) |
| virtual void | put_float64 (dods_float64 val) |
| virtual void | put_int (int val) |
| virtual void | put_int16 (dods_int16 val) |
| virtual void | put_int32 (dods_int32 val) |
| virtual void | put_opaque (char *val, unsigned int len) |
| virtual void | put_str (const string &val) |
| virtual void | put_uint16 (dods_uint16 val) |
| virtual void | put_uint32 (dods_uint32 val) |
| virtual void | put_url (const string &val) |
| virtual void | put_vector (char *val, int num, Vector &vec) |
| virtual void | put_vector (char *val, int num, int width, Vector &vec) |
| virtual void | reset_checksum () |
| XDRStreamMarshaller (ostream &out, bool checksum=false, bool write_data=true) | |
| virtual | ~XDRStreamMarshaller () |
Definition at line 67 of file XDRStreamMarshaller.h.
| libdap::XDRStreamMarshaller::XDRStreamMarshaller | ( | ostream & | out, |
| bool | checksum = false, |
||
| bool | write_data = true |
||
| ) |
Build an instance of XDRStreamMarshaller. Bind the C++ stream out to this instance. If the checksum parameter is true, initialize a checksum buffer and enable the use of the reset_checksum() and get_checksum() methods.
| out | Write to this stream object. |
| checksum | If true, compute checksums. False by default |
| write_data | If true, write data values. True by default |
Definition at line 61 of file XDRStreamMarshaller.cc.
References libdap::XDR_DAP_BUFF_SIZE.
| libdap::XDRStreamMarshaller::~XDRStreamMarshaller | ( | ) | [virtual] |
Definition at line 97 of file XDRStreamMarshaller.cc.
| void libdap::XDRStreamMarshaller::checksum_update | ( | const void * | data, |
| unsigned long | len | ||
| ) | [virtual] |
Definition at line 151 of file XDRStreamMarshaller.cc.
Referenced by put_byte(), put_float32(), put_float64(), put_int(), put_int16(), put_int32(), put_opaque(), put_str(), put_uint16(), put_uint32(), and put_vector().
| void libdap::XDRStreamMarshaller::dump | ( | ostream & | strm | ) | const [virtual] |
This method is implemented by all derived classes to dump their contents, in other words, any state they might have, private variables, etc...
The inline function below can be used to dump the contents of an OPeNDAOObj object. For example, the object Animal is derived from DapObj. A user could do the following:
Animal *a = new dog( "Sparky" ) ; cout << a << endl ;
And the dump method for dog could display the name passed into the constructor, the (this) pointer of the object, etc...
| strm | C++ i/o stream to dump the object to |
Implements libdap::Marshaller.
Definition at line 512 of file XDRStreamMarshaller.cc.
References libdap::DapIndent::LMarg().

| string libdap::XDRStreamMarshaller::get_checksum | ( | ) | [virtual] |
Get the current checksum. It is not possible to continue computing the checksum once this has been called.
| InternalErr | if called when the object was created without checksum support or if called when the checksum has already been returned. |
Definition at line 125 of file XDRStreamMarshaller.cc.
Referenced by libdap::ResponseBuilder::dataset_constraint(), libdap::Structure::serialize(), and libdap::Grid::serialize().
| void libdap::XDRStreamMarshaller::put_byte | ( | dods_byte | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 165 of file XDRStreamMarshaller.cc.
References checksum_update(), and DBG.

| void libdap::XDRStreamMarshaller::put_float32 | ( | dods_float32 | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 227 of file XDRStreamMarshaller.cc.
References checksum_update().

| void libdap::XDRStreamMarshaller::put_float64 | ( | dods_float64 | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 247 of file XDRStreamMarshaller.cc.
References checksum_update().

| void libdap::XDRStreamMarshaller::put_int | ( | int | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 380 of file XDRStreamMarshaller.cc.
References checksum_update().
Referenced by put_vector().

| void libdap::XDRStreamMarshaller::put_int16 | ( | dods_int16 | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 187 of file XDRStreamMarshaller.cc.
References checksum_update(), and XDR_INT16.

| void libdap::XDRStreamMarshaller::put_int32 | ( | dods_int32 | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 207 of file XDRStreamMarshaller.cc.
References checksum_update(), and XDR_INT32.

| void libdap::XDRStreamMarshaller::put_opaque | ( | char * | val, |
| unsigned int | len | ||
| ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 357 of file XDRStreamMarshaller.cc.
References checksum_update(), and libdap::XDR_DAP_BUFF_SIZE.

| void libdap::XDRStreamMarshaller::put_str | ( | const string & | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 307 of file XDRStreamMarshaller.cc.
References checksum_update(), and delete_xdrstdio().
Referenced by put_url().

| void libdap::XDRStreamMarshaller::put_uint16 | ( | dods_uint16 | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 267 of file XDRStreamMarshaller.cc.
References checksum_update(), and XDR_UINT16.

| void libdap::XDRStreamMarshaller::put_uint32 | ( | dods_uint32 | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 287 of file XDRStreamMarshaller.cc.
References checksum_update(), and XDR_UINT32.

| void libdap::XDRStreamMarshaller::put_url | ( | const string & | val | ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 352 of file XDRStreamMarshaller.cc.
References put_str().

| void libdap::XDRStreamMarshaller::put_vector | ( | char * | val, |
| int | num, | ||
| int | width, | ||
| Vector & | vec | ||
| ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 450 of file XDRStreamMarshaller.cc.
References checksum_update(), delete_xdrstdio(), put_int(), libdap::BaseType::type(), libdap::Vector::var(), and libdap::XDRUtils::xdr_coder().

| void libdap::XDRStreamMarshaller::put_vector | ( | char * | val, |
| int | num, | ||
| Vector & | vec | ||
| ) | [virtual] |
Implements libdap::Marshaller.
Definition at line 401 of file XDRStreamMarshaller.cc.
References checksum_update(), delete_xdrstdio(), and put_int().

| void libdap::XDRStreamMarshaller::reset_checksum | ( | ) | [virtual] |
Initialize the checksum buffer. This resets the checksum calculation.
| InternalErr | if called when the object was created without checksum support. |
Definition at line 109 of file XDRStreamMarshaller.cc.
Referenced by libdap::ResponseBuilder::dataset_constraint(), libdap::Structure::serialize(), and libdap::Grid::serialize().