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
00036
00037
00038
00039 #ifndef _structure_h
00040 #define _structure_h 1
00041
00042 #ifndef __POWERPC__
00043 #endif
00044
00045 #include <vector>
00046
00047
00048 #ifndef _basetype_h
00049 #include "BaseType.h"
00050 #endif
00051
00052 #ifndef _constructor_h
00053 #include "Constructor.h"
00054 #endif
00055
00056 #ifndef _dds_h
00057 #include "DDS.h"
00058 #endif
00059
00060 #ifndef constraint_evaluator_h
00061 #include "ConstraintEvaluator.h"
00062 #endif
00063
00064
00065
00066
00067 namespace libdap
00068 {
00069
00102 class Structure: public Constructor
00103 {
00104 private:
00105 BaseType *m_leaf_match(const string &name, btp_stack *s = 0);
00106 BaseType *m_exact_match(const string &name, btp_stack *s = 0);
00107
00108 protected:
00109 void _duplicate(const Structure &s);
00110
00111 public:
00112 Structure(const string &n);
00113 Structure(const string &n, const string &d);
00114
00115 Structure(const Structure &rhs);
00116 virtual ~Structure();
00117
00118 Structure &operator=(const Structure &rhs);
00119 virtual BaseType *ptr_duplicate();
00120
00121 virtual int element_count(bool leaves = false);
00122 virtual bool is_linear();
00123
00124 virtual void set_send_p(bool state);
00125 virtual void set_read_p(bool state);
00126 virtual void set_in_selection(bool state);
00127 virtual void set_leaf_sequence(int level = 1);
00128
00129 virtual unsigned int width();
00130
00131 virtual void intern_data(ConstraintEvaluator &eval, DDS &dds);
00132 virtual bool serialize(ConstraintEvaluator &eval, DDS &dds,
00133 Marshaller &m, bool ce_eval = true);
00134 virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false);
00135
00136
00137
00138
00139 virtual unsigned int val2buf(void *val, bool reuse = false);
00140 virtual unsigned int buf2val(void **val);
00141
00142 virtual BaseType *var(const string &name, bool exact_match = true,
00143 btp_stack *s = 0);
00144
00145 virtual BaseType *var(const string &n, btp_stack &s);
00146
00147 virtual void add_var(BaseType *bt, Part part = nil);
00148 virtual void del_var(const string &name);
00149
00150 virtual bool read() ;
00151
00152 virtual void print_val(FILE *out, string space = "",
00153 bool print_decl_p = true);
00154
00155 virtual void print_val(ostream &out, string space = "",
00156 bool print_decl_p = true);
00157
00158 virtual bool check_semantics(string &msg, bool all = false);
00159
00160 virtual void dump(ostream &strm) const ;
00161 };
00162
00163 }
00164
00165 #endif // _structure_h