00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 #ifndef _vector_h
00036 #define _vector_h 1
00037
00038 #ifndef _basetype_h
00039 #include "BaseType.h"
00040 #endif
00041
00042 #ifndef _dds_h
00043 #include "DDS.h"
00044 #endif
00045
00046 #ifndef constraint_evaluator_h
00047 #include "ConstraintEvaluator.h"
00048 #endif
00049
00075 class Vector: public BaseType
00076 {
00077 private:
00078 int _length;
00079 BaseType *_var;
00080
00081
00082 char *_buf;
00083 vector<string> d_str;
00084 vector<BaseType *> _vec;
00085
00086 protected:
00087
00088 void _duplicate(const Vector &v);
00089
00090 public:
00091 Vector(const string &n = "", BaseType *v = 0, const Type &t = dods_null_c);
00092 Vector(const Vector &rhs);
00093
00094 virtual ~Vector();
00095
00096 Vector &operator=(const Vector &rhs);
00097 virtual BaseType *ptr_duplicate() = 0;
00098
00099 virtual int element_count(bool leaves);
00100
00101 virtual void set_send_p(bool state);
00102
00103 virtual void set_read_p(bool state);
00104
00105 virtual unsigned int width();
00106
00107 virtual int length() const;
00108
00109 virtual void set_length(int l);
00110
00111 virtual void intern_data(const string &dataset, ConstraintEvaluator &eval,
00112 DDS &dds);
00113 virtual bool serialize(const string &dataset, ConstraintEvaluator &eval,
00114 DDS &dds, Marshaller &m, bool ce_eval = true);
00115 virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false);
00116
00117 virtual unsigned int val2buf(void *val, bool reuse = false);
00118 virtual unsigned int buf2val(void **val);
00119
00120 void set_vec(unsigned int i, BaseType *val);
00121
00122 void vec_resize(int l);
00123
00124 virtual bool set_value(dods_byte *val, int sz);
00125 virtual bool set_value(vector<dods_byte> &val, int sz);
00126 virtual bool set_value(dods_int16 *val, int sz);
00127 virtual bool set_value(vector<dods_int16> &val, int sz);
00128 virtual bool set_value(dods_uint16 *val, int sz);
00129 virtual bool set_value(vector<dods_uint16> &val, int sz);
00130 virtual bool set_value(dods_int32 *val, int sz);
00131 virtual bool set_value(vector<dods_int32> &val, int sz);
00132 virtual bool set_value(dods_uint32 *val, int sz);
00133 virtual bool set_value(vector<dods_uint32> &val, int sz);
00134 virtual bool set_value(dods_float32 *val, int sz);
00135 virtual bool set_value(vector<dods_float32> &val, int sz);
00136 virtual bool set_value(dods_float64 *val, int sz);
00137 virtual bool set_value(vector<dods_float64> &val, int sz);
00138 virtual bool set_value(string *val, int sz);
00139 virtual bool set_value(vector<string> &val, int sz);
00140
00141 virtual void value(dods_byte *b) const;
00142 virtual void value(dods_int16 *b) const;
00143 virtual void value(dods_uint16 *b) const;
00144 virtual void value(dods_int32 *b) const;
00145 virtual void value(dods_uint32 *b) const;
00146 virtual void value(dods_float32 *b) const;
00147 virtual void value(dods_float64 *b) const;
00148 virtual void value(vector<string> &b) const;
00149
00150 virtual void *value();
00151
00152 virtual BaseType *var(const string &name = "", bool exact_match = true,
00153 btp_stack *s = 0);
00154 virtual BaseType *var(const string &name, btp_stack &s);
00155 virtual BaseType *var(unsigned int i);
00156
00157 virtual void add_var(BaseType *v, Part p = nil);
00158 virtual bool check_semantics(string &msg, bool all = false);
00159
00160 virtual void dump(ostream &strm) const ;
00161 };
00162
00163 #endif