46 #ifndef constraint_evaluator_h 47 #include "ConstraintEvaluator.h" 89 vector<BaseType *> d_compound_buf;
94 unsigned int d_capacity;
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;
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);
269 virtual BaseType *
var(
const string &name, btp_stack &s);
277 virtual void dump(ostream &strm)
const ;
virtual string name() const
Returns the name of the class instance.
abstract base class used to unmarshall/deserialize dap data objects
void set_vec(unsigned int i, BaseType *val)
Sets element i to value val.
Part
Names the parts of multi-section constructor data types.
Holds a one-dimensional collection of DAP2 data types.
virtual unsigned int width(bool constrained=false) const
Returns the width of the data, in bytes.
virtual void intern_data()
Read data into this variable.
virtual void clear_local_data()
Read data from the stream made by D4StreamMarshaller.
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 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)
Type
Identifies the data type.
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Serialize a Vector.
top level DAP object to house generic methods
virtual BaseType * var(const string &name="", bool exact_match=true, btp_stack *s=0)
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
vector< string > & get_str()
vector< BaseType * > & get_compound_buf()
Marshaller that knows how to marshal/serialize dap data objects to a C++ iostream using DAP4's receiv...
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.
bool m_is_cardinal_type() const
virtual void reserve_value_capacity()
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.
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()
virtual unsigned int get_value_capacity() const
Evaluate a constraint expression.
virtual BaseType * ptr_duplicate()=0
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)
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)
Sets the name of the class instance.
virtual int length() const
virtual unsigned int buf2val(void **val)
Copies data from the Vector buffer.
virtual void set_length(int l)
virtual void dump(ostream &strm) const
dumps information about this object