75 d_length = v.d_length;
91 if (v.d_compound_buf.empty()) {
92 d_compound_buf = v.d_compound_buf;
97 d_compound_buf.resize(d_length);
98 for (
int i = 0; i < d_length; ++i) {
103 d_compound_buf[i] = v.d_compound_buf[i]->ptr_duplicate();
115 d_capacity = v.d_capacity;
130 switch (d_proto->
type()) {
163 assert(
"Vector::var: Unrecognized type");
184 throw InternalErr(__FILE__, __LINE__,
"create_cardinal_data_buffer_for_type: Logic error: _var is null!");
189 throw InternalErr(__FILE__, __LINE__,
"create_cardinal_data_buffer_for_type: incorrectly used on Vector whose type was not a cardinal (simple data types).");
195 unsigned int bytesPerElt = d_proto->
width();
196 unsigned int bytesNeeded = bytesPerElt * numEltsOfType;
197 d_buf =
new char[bytesNeeded];
199 d_capacity = numEltsOfType;
214 template<
class CardType>
218 throw InternalErr(__FILE__, __LINE__,
"Logic error: Vector::set_cardinal_values_internal() called with negative numElts!");
221 throw InternalErr(__FILE__, __LINE__,
"Logic error: Vector::set_cardinal_values_internal() called with null fromArray!");
225 memcpy(d_buf, fromArray, numElts *
sizeof(CardType));
245 BaseType(n, t, is_dap4), d_length(-1), d_proto(0), d_buf(0), d_compound_buf(0), d_capacity(0)
250 DBG2(cerr <<
"Entering Vector ctor for object: " <<
this << endl);
274 BaseType(n, d, t, is_dap4), d_length(-1), d_proto(0), d_buf(0), d_compound_buf(0), d_capacity(0)
279 DBG2(cerr <<
"Entering Vector ctor for object: " <<
this << endl);
288 DBG2(cerr <<
"Entering Vector const ctor for object: " <<
this <<
289 endl);
DBG2(cerr <<
"RHS: " << &rhs << endl);
296 DBG2(cerr <<
"Entering ~Vector (" <<
this <<
")" << endl);
304 DBG2(cerr <<
"Exiting ~Vector" << endl);
312 dynamic_cast<BaseType &
> (*this) = rhs;
390 DBG2(cerr <<
"Vector::var: Looking for " << name << endl);
396 if (name ==
"" || d_proto->
name() ==
name) {
428 return d_proto->
var(name, s);
449 switch (d_proto->
type()) {
481 return d_compound_buf[i];
485 throw Error (
"Vector::var: Unrecognized type");
503 throw InternalErr(__FILE__, __LINE__,
"Cannot get width since *this* object is not holding data.");
537 throw InternalErr(__FILE__, __LINE__,
"Vector::vec_resize() is applicable to compound types only");
539 d_compound_buf.resize((l > 0) ? l : 0, 0);
561 DBG(cerr <<
"Vector::intern_data: " <<
name() << endl);
568 switch (d_proto->
type()) {
588 throw InternalErr(__FILE__, __LINE__,
"Array of Array not supported.");
594 DBG(cerr <<
"Vector::intern_data: found ctor" << endl);
597 if (d_compound_buf.capacity() == 0)
598 throw InternalErr(__FILE__, __LINE__,
"The capacity of *this* vector is 0.");
600 for (
int i = 0; i < num; ++i)
606 throw InternalErr(__FILE__, __LINE__,
"Unknown datatype.");
642 switch (d_proto->
type()) {
657 if (d_str.capacity() == 0)
658 throw InternalErr(__FILE__, __LINE__,
"The capacity of the string vector is 0");
662 for (i = 0; i < num; ++i)
673 if (d_compound_buf.capacity() == 0)
674 throw InternalErr(__FILE__, __LINE__,
"The capacity of *this* vector is 0.");
678 for (i = 0; i < num; ++i)
679 d_compound_buf[i]->
serialize(eval, dds, m,
false);
684 throw InternalErr(__FILE__, __LINE__,
"Unknown datatype.");
713 switch (d_proto->
type()) {
723 DBG(cerr <<
"Vector::deserialize: num = " << num << endl);
724 DBG(cerr <<
"Vector::deserialize: length = " <<
length() << endl);
729 if (num != (
unsigned int)
length())
730 throw InternalErr(__FILE__, __LINE__,
"The server sent declarations and data with mismatched sizes.");
732 if (!d_buf || !reuse) {
736 DBG(cerr <<
"Vector::deserialize: allocating "
737 <<
width() <<
" bytes for an array of "
746 DBG(cerr <<
"Vector::deserialize: read " << num <<
" elements\n");
757 if (num != (
unsigned int)
length())
758 throw InternalErr(__FILE__, __LINE__,
"The client sent declarations and data with mismatched sizes.");
760 d_str.resize((num > 0) ? num : 0);
763 for (i = 0; i < num; ++i) {
781 if (num != (
unsigned int)
length())
782 throw InternalErr(__FILE__, __LINE__,
"The client sent declarations and data with mismatched sizes.");
786 for (i = 0; i < num; ++i) {
788 d_compound_buf[i]->deserialize(um, dds);
794 throw InternalErr(__FILE__, __LINE__,
"Unknown type!");
803 switch (d_proto->
type()) {
826 for (int64_t i = 0, e =
length(); i < e; ++i)
827 checksum.
AddData(reinterpret_cast<const uint8_t*>(d_str[i].data()), d_str[i].
length());
839 throw InternalErr(__FILE__, __LINE__,
"Unknown or unsupported datatype (" + d_proto->
type_name() +
").");
849 switch (d_proto->
type()) {
874 assert(d_compound_buf.capacity() != 0);
876 for (
int i = 0, e =
length(); i < e; ++i)
883 throw InternalErr(__FILE__, __LINE__,
"Unknown or unsupported datatype (" + d_proto->
type_name() +
").");
894 if (filter && !eval.eval_selection(dmr,
dataset()))
899 switch (d_proto->
type()) {
917 if (d_proto->
width() == 1)
933 assert((int64_t)d_str.capacity() >= num);
935 for (int64_t i = 0; i < num; ++i)
941 throw InternalErr(__FILE__, __LINE__,
"Array of Array not allowed.");
946 assert(d_compound_buf.capacity() >= 0);
948 for (int64_t i = 0; i < num; ++i)
949 d_compound_buf[i]->
serialize(m, dmr, filter);
954 throw InternalErr(__FILE__, __LINE__,
"Grid is not part of DAP4.");
957 throw InternalErr(__FILE__, __LINE__,
"Unknown datatype.");
972 DBG(cerr <<
"Vector::deserialize, " <<
name() <<
", length(): " <<
length() << endl);
974 switch (d_proto->
type()) {
992 if (d_proto->
width() == 1)
1009 d_str.resize((len > 0) ? len : 0);
1012 for (int64_t i = 0; i < len; ++i) {
1020 throw InternalErr(__FILE__, __LINE__,
"Array of Array not allowed.");
1027 for (int64_t i = 0, end =
length(); i < end; ++i) {
1029 d_compound_buf[i]->deserialize(um, dmr);
1036 throw InternalErr(__FILE__, __LINE__,
"Grid is not part of DAP4.");
1039 throw InternalErr(__FILE__, __LINE__,
"Unknown type.");
1083 throw InternalErr(__FILE__, __LINE__,
"The incoming pointer does not contain any data.");
1085 switch (d_proto->
type()) {
1102 if (d_buf && !reuse)
1106 if (!d_buf || !reuse)
1110 memcpy(d_buf, val,
width(
true));
1118 d_str.resize(d_length);
1119 d_capacity = d_length;
1120 for (
int i = 0; i < d_length; ++i)
1121 d_str[i] = *(static_cast<string *> (val) + i);
1126 throw InternalErr(__FILE__, __LINE__,
"Vector::val2buf: bad type");
1168 throw InternalErr(__FILE__, __LINE__,
"NULL pointer.");
1170 unsigned int wid =
static_cast<unsigned int> (
width(
true ));
1177 switch (d_proto->
type()) {
1194 throw InternalErr(__FILE__, __LINE__,
"Vector::buf2val: Logic error: called when cardinal type data buffer was empty!");
1196 *val =
new char[wid];
1198 memcpy(*val, d_buf, wid);
1205 throw InternalErr(__FILE__, __LINE__,
"Vector::buf2val: Logic error: called when string data buffer was empty!");
1207 *val =
new string[d_length];
1209 for (
int i = 0; i < d_length; ++i)
1210 *(static_cast<string *> (*val) + i) = d_str[i];
1217 throw InternalErr(__FILE__, __LINE__,
"Vector::buf2val: bad type");
1260 if (i >= static_cast<unsigned int> (d_length))
1261 throw InternalErr(__FILE__, __LINE__,
"Invalid data: index too large.");
1263 throw InternalErr(__FILE__, __LINE__,
"Invalid data: null pointer to BaseType object.");
1264 if (val->
type() != d_proto->
type())
1265 throw InternalErr(__FILE__, __LINE__,
"invalid data: type of incoming object does not match *this* vector type.");
1267 if (i >= d_compound_buf.capacity())
1270 d_compound_buf[i] = val;
1289 for (
unsigned int i = 0; i < d_compound_buf.size(); ++i) {
1290 delete d_compound_buf[i];
1291 d_compound_buf[i] = 0;
1295 d_compound_buf.resize(0);
1326 throw InternalErr(__FILE__, __LINE__,
"reserve_value_capacity: Logic error: _var is null!");
1328 switch (d_proto->
type()) {
1352 d_str.reserve(numElements);
1353 d_capacity = numElements;
1357 throw InternalErr(__FILE__, __LINE__,
"reserve_value_capacity: Arrays not supported!");
1365 d_compound_buf.reserve(numElements);
1366 d_capacity = numElements;
1370 throw InternalErr(__FILE__, __LINE__,
"reserve_value_capacity: Unknown type!");
1419 static const string funcName =
"set_value_slice_from_row_major_vector:";
1422 Vector& rowMajorData =
const_cast<Vector&
>(rowMajorDataC);
1424 bool typesMatch = rowMajorData.
var() && d_proto && (rowMajorData.
var()->
type() == d_proto->
type());
1426 throw InternalErr(__FILE__, __LINE__, funcName +
"Logic error: types do not match so cannot be copied!");
1430 if (!rowMajorData.
read_p()) {
1432 funcName +
"Logic error: the Vector to copy data from has !read_p() and should have been read in!");
1436 if (rowMajorData.
length() < 0) {
1439 +
"Logic error: the Vector to copy data from has length() < 0 and was probably not initialized!");
1447 +
"Logic error: the Vector to copy from has a data capacity less than its length, can't copy!");
1452 if (d_capacity < (startElement + rowMajorData.
length())) {
1454 funcName +
"Logic error: the capacity of this Vector cannot hold all the data in the from Vector!");
1458 switch (d_proto->
type()) {
1475 throw InternalErr(__FILE__, __LINE__, funcName +
"Logic error: this->_buf was unexpectedly null!");
1477 if (!rowMajorData.d_buf) {
1478 throw InternalErr(__FILE__, __LINE__, funcName +
"Logic error: rowMajorData._buf was unexpectedly null!");
1481 int varWidth = d_proto->
width();
1482 char* pFromBuf = rowMajorData.d_buf;
1483 int numBytesToCopy = rowMajorData.
width(
true);
1484 char* pIntoBuf = d_buf + (startElement * varWidth);
1485 memcpy(pIntoBuf, pFromBuf, numBytesToCopy);
1492 for (
unsigned int i = 0; i < static_cast<unsigned int>(rowMajorData.
length()); ++i) {
1493 d_str[startElement + i] = rowMajorData.d_str[i];
1505 funcName +
"Unimplemented method for Vectors of type: array, opaque, structure, sequence or grid.");
1509 throw InternalErr(__FILE__, __LINE__, funcName +
": Unknown type!");
1515 return (
unsigned int) rowMajorData.
length();
1526 template <
typename T>
1527 static bool types_match(
Type t, T *cpp_var)
1533 return typeid(cpp_var) ==
typeid(
dods_byte*);
1536 return typeid(cpp_var) ==
typeid(
dods_int8*);
1538 return typeid(cpp_var) ==
typeid(
dods_int16*);
1542 return typeid(cpp_var) ==
typeid(
dods_int32*);
1546 return typeid(cpp_var) ==
typeid(
dods_int64*);
1572 template <
typename T>
1575 if (!v || !types_match(d_proto->
type() ==
dods_enum_c ?
static_cast<D4Enum*
>(d_proto)->element_type() : d_proto->
type(), v))
1582 template <
typename T>
1588 if (!v || !types_match(d_proto->
type() ==
dods_enum_c ?
static_cast<D4Enum*
>(d_proto)->element_type() : d_proto->
type(), v))
1624 m_set_cardinal_values_internal<dods_byte> (val, sz);
1630 m_set_cardinal_values_internal<dods_byte> (val, sz);
1650 m_set_cardinal_values_internal<dods_int8> (val, sz);
1668 m_set_cardinal_values_internal<dods_int16> (val, sz);
1686 m_set_cardinal_values_internal<dods_int32> (val, sz);
1704 m_set_cardinal_values_internal<dods_int64> (val, sz);
1722 m_set_cardinal_values_internal<dods_uint16> (val, sz);
1740 m_set_cardinal_values_internal<dods_uint32> (val, sz);
1758 m_set_cardinal_values_internal<dods_uint64> (val, sz);
1776 m_set_cardinal_values_internal<dods_float32> (val, sz);
1794 m_set_cardinal_values_internal<dods_float64> (val, sz);
1815 for (
register int t = 0; t < sz; t++) {
1833 for (
register int t = 0; t < sz; t++) {
1864 template <
typename T>
1870 for (vector<unsigned int>::iterator i = indices->begin(), e = indices->end(); i != e; ++i) {
1871 unsigned long currentIndex = *i;
1872 if(currentIndex > (
unsigned int)
length()){
1874 s <<
"Vector::value() - Subset index[" << i - subsetIndex->begin() <<
"] = " << currentIndex <<
" references a value that is " <<
1875 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1876 throw Error(s.str());
1878 b[i - indices->begin()] =
reinterpret_cast<T*
>(d_buf )[currentIndex];
1881 for (
unsigned long i = 0, e = indices->size(); i < e; ++i) {
1882 unsigned long currentIndex = (*indices)[i];
1883 if (currentIndex > (
unsigned int)
length()) {
1885 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
1886 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1887 throw Error(s.str());
1889 b[i] =
reinterpret_cast<T*
>(d_buf )[currentIndex];
1910 for (vector<unsigned int>::iterator i = subsetIndex->begin(); i != subsetIndex->end(); ++i) {
1911 unsigned long currentIndex = *i;
1912 if(currentIndex > (
unsigned int)
length()){
1914 s <<
"Vector::value() - Subset index[" << i - subsetIndex->begin() <<
"] = " << currentIndex <<
" references a value that is " <<
1915 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1916 throw Error(s.str());
1918 b[i] =
reinterpret_cast<dods_byte*
>(d_buf )[currentIndex];
1921 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
1922 unsigned long currentIndex = (*subsetIndex)[i] ;
1923 if(currentIndex> (
unsigned int)
length()){
1925 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
1926 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1927 throw Error(s.str());
1929 b[i] =
reinterpret_cast<dods_byte*
>(d_buf )[currentIndex];
1938 for (vector<unsigned int>::iterator i = subsetIndex->begin(); i != subsetIndex->end(); ++i) {
1939 unsigned long currentIndex = *i;
1940 if(currentIndex > (
unsigned int)
length()){
1942 s <<
"Vector::value() - Subset index[" << i - subsetIndex->begin() <<
"] = " << currentIndex <<
" references a value that is " <<
1943 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1944 throw Error(s.str());
1946 b[i] =
reinterpret_cast<dods_byte*
>(d_buf )[currentIndex];
1949 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
1950 unsigned long currentIndex = (*subsetIndex)[i] ;
1951 if(currentIndex> (
unsigned int)
length()){
1953 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
1954 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1955 throw Error(s.str());
1957 b[i] =
reinterpret_cast<dods_int8*
>(d_buf )[currentIndex];
1964 unsigned long currentIndex;
1966 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
1967 currentIndex = (*subsetIndex)[i] ;
1968 if(currentIndex> (
unsigned int)
length()){
1970 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
1971 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1972 throw Error(s.str());
1974 b[i] =
reinterpret_cast<dods_uint16*
>(d_buf )[currentIndex];
1982 unsigned long currentIndex;
1984 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
1985 currentIndex = (*subsetIndex)[i] ;
1986 if(currentIndex> (
unsigned int)
length()){
1988 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
1989 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
1990 throw Error(s.str());
1992 b[i] =
reinterpret_cast<dods_int16*
>(d_buf )[currentIndex];
1999 unsigned long currentIndex;
2001 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
2002 currentIndex = (*subsetIndex)[i] ;
2003 if(currentIndex> (
unsigned int)
length()){
2005 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
2006 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
2007 throw Error(s.str());
2009 b[i] =
reinterpret_cast<dods_uint32*
>(d_buf )[currentIndex];
2016 unsigned long currentIndex;
2018 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
2019 currentIndex = (*subsetIndex)[i] ;
2020 if(currentIndex> (
unsigned int)
length()){
2022 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
2023 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
2024 throw Error(s.str());
2026 b[i] =
reinterpret_cast<dods_int32*
>(d_buf )[currentIndex];
2033 unsigned long currentIndex;
2035 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
2036 currentIndex = (*subsetIndex)[i] ;
2037 if(currentIndex> (
unsigned int)
length()){
2039 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
2040 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
2041 throw Error(s.str());
2044 b[i] =
reinterpret_cast<dods_float32*
>(d_buf )[currentIndex];
2051 unsigned long currentIndex;
2053 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
2054 currentIndex = (*subsetIndex)[i] ;
2055 if(currentIndex> (
unsigned int)
length()){
2057 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
2058 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
2059 throw Error(s.str());
2061 b[i] =
reinterpret_cast<dods_float64*
>(d_buf )[currentIndex];
2069 unsigned long currentIndex;
2072 for(
unsigned long i=0; i<subsetIndex->size() ;++i){
2073 currentIndex = (*subsetIndex)[i] ;
2074 if(currentIndex > (
unsigned int)
length()){
2076 s <<
"Vector::value() - Subset index[" << i <<
"] = " << currentIndex <<
" references a value that is " <<
2077 "outside the bounds of the internal storage [ length()= " <<
length() <<
" ] name: '" <<
name() <<
"'. ";
2078 throw Error(s.str());
2080 b[i] = d_str[currentIndex];
2085 template <
typename T>
2090 if (v && types_match(d_proto->
type() ==
dods_enum_c ?
static_cast<D4Enum*
>(d_proto)->element_type() : d_proto->
type(), v))
2091 memcpy(v, d_buf,
length() *
sizeof(T));
2204 void *buffer =
new char[
width(
true)];
2206 memcpy(buffer, d_buf,
width(
true));
2254 if (!v->
name().empty())
2261 DBG(cerr <<
"Vector::add_var: Added variable " << v <<
" ("
2285 if (!v->
name().empty())
2292 DBG(cerr <<
"Vector::add_var_no_copy: Added variable " << v <<
" ("
2312 strm <<
DapIndent::LMarg <<
"Vector::dump - (" << (
void *)
this <<
")" << endl;
2319 d_proto->
dump(strm);
2327 for (
unsigned i = 0; i < d_compound_buf.size(); ++i) {
2328 if (d_compound_buf[i])
2329 d_compound_buf[i]->dump(strm);
2336 for (
unsigned i = 0; i < d_str.size(); i++) {
2341 switch (d_proto->
type()) {
2345 strm.write(d_buf, d_length);
virtual bool read()
Read data into a local buffer.
virtual bool read_p()
Has this variable been read?
virtual void put_int(int val)=0
abstract base class used to unmarshall/deserialize dap data objects
virtual unsigned int width(bool constrained=false) const
How many bytes does this use Return the number of bytes of storage this variable uses. For scalar types, this is pretty simple (an int32 uses 4 bytes, etc.). For arrays and Constructors, it is a bit more complex. Note that a scalar String variable uses sizeof(String*) bytes, not the length of the string. In other words, the value returned is independent of the type. Also note width() of a String array returns the number of elements in the array times sizeof(String*). That is, each different array size is a different data type.
virtual void add_var_nocopy(BaseType *v, Part p=nil)
virtual unsigned int get_value_capacity() const
void set_vec(unsigned int i, BaseType *val)
Sets element i to value val.
Part
Names the parts of multi-section constructor data types.
virtual void set_name(const string &n)
Sets the name of the class instance.
virtual void put_str(const string &val)=0
Holds a one-dimensional collection of DAP2 data types.
virtual void dump(ostream &strm) const
dumps information about this object
virtual void get_vector_float32(char *val, int64_t num_elem)
Read data from the stream made by D4StreamMarshaller.
virtual int length() const
virtual void compute_checksum(Crc32 &checksum)
include the data for this variable in the checksum DAP4 includes a checksum with every data response...
virtual void set_read_p(bool state)
Indicates that the data is ready to send.
virtual void add_var(BaseType *v, Part p=nil)
Add the BaseType pointer to this constructor type instance.
virtual void get_str(string &val)
virtual int element_count(bool leaves)
Count the members of constructor types.
void m_set_cardinal_values_internal(const CardType *fromArray, int numElts)
virtual unsigned int set_value_slice_from_row_major_vector(const Vector &rowMajorData, unsigned int startElement)
virtual void put_vector_float32(char *val, int64_t num_elem)
Write a fixed size vector.
Type
Identifies the data type.
Type type() const
Returns the type of the class instance.
stack< BaseType * > btp_stack
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Serialize a Vector.
virtual void set_parent(BaseType *parent)
A class for software fault reporting.
string dataset() const
Returns the name of the dataset used to create this instance.
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
virtual void get_str(string &val)=0
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
Returns a pointer to a member of a constructor class.
virtual void compute_checksum(Crc32 &checksum)=0
include the data for this variable in the checksum DAP4 includes a checksum with every data response...
bool set_value(T *v, int sz)
set the value of a byte array
string type_name() const
Returns the type of the class instance as a string.
Holds a DAP4 enumeration.
virtual bool is_constructor_type() const
Returns true if the instance is a constructor (i.e., Structure, Sequence or Grid) type variable...
virtual int element_count(bool leaves=false)
Count the members of constructor types.
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
virtual void set_send_p(bool state)
void set_vec_nocopy(unsigned int i, BaseType *val)
Sets element i to value val.
virtual void dump(ostream &strm) const
dumps information about this object
bool m_is_cardinal_type() const
virtual void reserve_value_capacity()
Vector & operator=(const Vector &rhs)
virtual void set_read_p(bool state)
Sets the value of the read_p property.
Vector(const string &n, BaseType *v, const Type &t, bool is_dap4=false)
The Vector constructor.
virtual unsigned int val2buf(void *val, bool reuse=false)
Reads data into the Vector buffer. Thrown if called for Structure, Sequence or Grid.
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
void m_delete_cardinal_data_buffer()
void AddData(const uint8_t *pData, const uint32_t length)
virtual unsigned int val2buf(void *val, bool reuse=false)=0
Loads class data.
string name() const
Returns the name of the class instance.
virtual void put_vector(char *val, int num, Vector &vec)=0
virtual BaseType * ptr_duplicate()=0
string www2id(const string &in, const string &escape, const string &except)
Evaluate a constraint expression.
virtual void get_vector_float64(char *val, int64_t num_elem)
static ostream & LMarg(ostream &strm)
virtual void set_send_p(bool state)
Indicates that the data is ready to send.
unsigned int m_create_cardinal_data_buffer_for_type(unsigned int numEltsOfType)
virtual void put_vector(char *val, int64_t num_bytes)
Write a fixed size vector.
The basic data type for the DODS DAP types.
abstract base class used to marshal/serialize dap data objects
virtual void set_name(const std::string &name)
void m_duplicate(const Vector &v)
virtual unsigned int buf2val(void **val)
virtual void get_int(int &val)=0
bool eval_selection(DDS &dds, const std::string &dataset)
Evaluate a boolean-valued constraint expression. This is main method for the evaluator ans is called ...
virtual void set_length(int l)
A class for error processing.
virtual void put_vector_float64(char *val, int64_t num_elem)
Write a fixed size vector of float64s.
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
read data into a variable for later use
virtual void get_vector(char **val, unsigned int &num, Vector &vec)=0
virtual void put_str(const string &val)
virtual void get_vector(char **, unsigned int &, Vector &)
virtual unsigned int width(bool constrained=false) const
Returns the width of the data, in bytes.
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.