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