46#ifndef constraint_evaluator_h
47#include "ConstraintEvaluator.h"
87 char *d_buf =
nullptr;
89 vector<BaseType *> d_compound_buf;
94 unsigned int d_capacity = 0;
96 friend class MarshallerTest;
104 template <
typename T>
void value_worker(T *v)
const;
105 template <
typename T>
void value_worker(vector<unsigned int> *indices, T *b)
const;
107 template <
typename T>
bool set_value_worker(T *v,
int sz);
108 template <
typename T>
bool set_value_worker(vector<T> &v,
int sz);
112 void m_duplicate(
const Vector &v);
122 Vector(
const string &n,
const string &d,
BaseType *v,
const Type &t,
bool is_dap4 =
false);
160 return d_compound_buf;
164 virtual bool is_dap2_only_type();
167 virtual BaseType *prototype()
const {
return d_proto; }
177 virtual unsigned int width(
bool constrained =
false)
const;
179 virtual int length()
const;
184 virtual void intern_data(ConstraintEvaluator &eval, DDS &dds);
185 virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m,
bool ce_eval =
true);
187 virtual bool serialize_no_release(ConstraintEvaluator &eval, DDS &dds, Marshaller &m,
bool ce_eval =
true);
189 virtual bool deserialize(UnMarshaller &um, DDS *dds,
bool reuse =
false);
194 virtual void serialize(D4StreamMarshaller &m, DMR &dmr,
bool filter =
false);
196 virtual void serialize_no_release(D4StreamMarshaller &m, DMR &dmr,
bool filter =
false);
198 virtual void deserialize(D4StreamUnMarshaller &um, DMR &dmr);
200 virtual unsigned int val2buf(
void *val,
bool reuse =
false);
201 virtual unsigned int buf2val(
void **val);
217 virtual bool set_value(dods_byte *val,
int sz);
218 virtual bool set_value(dods_int8 *val,
int sz);
219 virtual bool set_value(dods_int16 *val,
int sz);
220 virtual bool set_value(dods_uint16 *val,
int sz);
221 virtual bool set_value(dods_int32 *val,
int sz);
222 virtual bool set_value(dods_uint32 *val,
int sz);
223 virtual bool set_value(dods_int64 *val,
int sz);
224 virtual bool set_value(dods_uint64 *val,
int sz);
225 virtual bool set_value(dods_float32 *val,
int sz);
226 virtual bool set_value(dods_float64 *val,
int sz);
227 virtual bool set_value(
string *val,
int sz);
230 virtual bool set_value(vector<dods_byte> &val,
int sz);
231 virtual bool set_value(vector<dods_int8> &val,
int sz);
232 virtual bool set_value(vector<dods_int16> &val,
int sz);
233 virtual bool set_value(vector<dods_uint16> &val,
int sz);
234 virtual bool set_value(vector<dods_int32> &val,
int sz);
235 virtual bool set_value(vector<dods_uint32> &val,
int sz);
236 virtual bool set_value(vector<dods_int64> &val,
int sz);
237 virtual bool set_value(vector<dods_uint64> &val,
int sz);
238 virtual bool set_value(vector<dods_float32> &val,
int sz);
239 virtual bool set_value(vector<dods_float64> &val,
int sz);
240 virtual bool set_value(vector<string> &val,
int sz);
242 virtual void value(dods_byte *b)
const;
243 virtual void value(dods_int8 *b)
const;
244 virtual void value(dods_int16 *b)
const;
245 virtual void value(dods_uint16 *b)
const;
246 virtual void value(dods_int32 *b)
const;
247 virtual void value(dods_uint32 *b)
const;
248 virtual void value(dods_int64 *b)
const;
249 virtual void value(dods_uint64 *b)
const;
250 virtual void value(dods_float32 *b)
const;
251 virtual void value(dods_float64 *b)
const;
252 virtual void value(vector<string> &b)
const;
254 virtual void value(vector<unsigned int> *indices, dods_byte *b)
const;
255 virtual void value(vector<unsigned int> *indices, dods_int8 *b)
const;
256 virtual void value(vector<unsigned int> *indices, dods_int16 *b)
const;
257 virtual void value(vector<unsigned int> *indices, dods_uint16 *b)
const;
258 virtual void value(vector<unsigned int> *indices, dods_int32 *b)
const;
259 virtual void value(vector<unsigned int> *indices, dods_uint32 *b)
const;
260 virtual void value(vector<unsigned int> *indices, dods_int64 *b)
const;
261 virtual void value(vector<unsigned int> *indices, dods_uint64 *b)
const;
262 virtual void value(vector<unsigned int> *indices, dods_float32 *b)
const;
263 virtual void value(vector<unsigned int> *indices, dods_float64 *b)
const;
264 virtual void value(vector<unsigned int> *index, vector<string> &b)
const;
266 virtual void *
value();
268 virtual BaseType *
var(
const string &
name =
"",
bool exact_match =
true, btp_stack *s = 0);
277 virtual void dump(ostream &strm)
const ;
The basic data type for the DODS DAP types.
virtual string name() const
Returns the name of the class instance.
BaseType(const string &n, const Type &t, bool is_dap4=false)
The BaseType constructor.
Holds a one-dimensional collection of DAP2 data types.
virtual void add_var(BaseType *v, Part p=nil)
Add the BaseType pointer to this constructor type instance.
virtual void set_length(int l)
vector< BaseType * > & get_compound_buf()
virtual unsigned int get_value_capacity() const
void set_vec_nocopy(unsigned int i, BaseType *val)
Sets element i to value val. Set the ith element to val. Extend the vector if needed.
void m_set_cardinal_values_internal(const CardType *fromArray, int numElts)
virtual int length() const
virtual BaseType * ptr_duplicate()=0
virtual unsigned int set_value_slice_from_row_major_vector(const Vector &rowMajorData, unsigned int startElement)
virtual void set_read_p(bool state)
Indicates that the data is ready to send.
virtual void set_send_p(bool state)
Indicates that the data is ready to send.
void set_vec(unsigned int i, BaseType *val)
Sets element i to value val.
virtual unsigned int width(bool constrained=false) const
Returns the width of the data, in bytes.
virtual unsigned int val2buf(void *val, bool reuse=false)
Reads data into the Vector buffer.
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Serialize a Vector.
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 dump(ostream &strm) const
dumps information about this object
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
virtual void set_name(const std::string &name)
Sets the name of the class instance.
virtual int element_count(bool leaves)
Count the members of constructor types.
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
virtual void intern_data()
Read data into this variable.
bool m_is_cardinal_type() const
virtual void clear_local_data()
vector< string > & get_str()
void m_delete_cardinal_data_buffer()
virtual void reserve_value_capacity()
unsigned int m_create_cardinal_data_buffer_for_type(unsigned int numEltsOfType)
virtual unsigned int buf2val(void **val)
Copies data from the Vector buffer.
Vector(const string &n, BaseType *v, const Type &t, bool is_dap4=false)
The Vector constructor.
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
top level DAP object to house generic methods
Type
Identifies the data type.
Part
Names the parts of multi-section constructor data types.