libdap++  Updated for version 3.13.1
Structure.h
Go to the documentation of this file.
1 
2 // -*- mode: c++; c-basic-offset:4 -*-
3 
4 // This file is part of libdap, A C++ implementation of the OPeNDAP Data
5 // Access Protocol.
6 
7 // Copyright (c) 2002,2003 OPeNDAP, Inc.
8 // Author: James Gallagher <jgallagher@opendap.org>
9 //
10 // This library is free software; you can redistribute it and/or
11 // modify it under the terms of the GNU Lesser General Public
12 // License as published by the Free Software Foundation; either
13 // version 2.1 of the License, or (at your option) any later version.
14 //
15 // This library is distributed in the hope that it will be useful,
16 // but WITHOUT ANY WARRANTY; without even the implied warranty of
17 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 // Lesser General Public License for more details.
19 //
20 // You should have received a copy of the GNU Lesser General Public
21 // License along with this library; if not, write to the Free Software
22 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
23 //
24 // You can contact OPeNDAP, Inc. at PO Box 112, Saunderstown, RI. 02874-0112.
25 
26 // (c) COPYRIGHT URI/MIT 1995-1999
27 // Please read the full copyright statement in the file COPYRIGHT_URI.
28 //
29 // Authors:
30 // jhrg,jimg James Gallagher <jgallagher@gso.uri.edu>
31 
32 // Interface for the class Structure. A structure contains a single set of
33 // variables, all at the same lexical level. Of course, a structure may
34 // contain other structures... The variables contained in a structure are
35 // stored by instances of this class in a SLList of BaseType pointers.
36 //
37 // jhrg 9/14/94
38 
39 #ifndef _structure_h
40 #define _structure_h 1
41 
42 #ifndef __POWERPC__
43 #endif
44 
45 #include <vector>
46 
47 #include "Constructor.h"
48 
49 namespace libdap
50 {
51 
52 class DDS;
53 class ConstraintEvaluator;
54 
85 class Structure: public Constructor
86 {
87 private:
88 #if 0
89  BaseType *m_leaf_match(const string &name, btp_stack *s = 0);
90  BaseType *m_exact_match(const string &name, btp_stack *s = 0);
91 #endif
92 
93 protected:
94 #if 0
95  void m_duplicate(const Structure &s);
96 #endif
97 
98 public:
99  Structure(const string &n);
100  Structure(const string &n, const string &d);
101 
102  Structure(const Structure &rhs);
103  virtual ~Structure();
104 
105  Structure &operator=(const Structure &rhs);
106  virtual BaseType *ptr_duplicate();
107 
108 #if 0
109  virtual int element_count(bool leaves = false);
110 #endif
111  virtual bool is_linear();
112 
113 #if 0
114  virtual void set_send_p(bool state);
115  virtual void set_read_p(bool state);
116 #endif
117 #if 0
118  virtual void set_in_selection(bool state);
119 #endif
120  virtual void set_leaf_sequence(int level = 1);
121 #if 0
122  virtual unsigned int width(bool constrained = false);
123  virtual unsigned int width(bool constrained);
124 #endif
125 #if 0
126  virtual void intern_data(ConstraintEvaluator &eval, DDS &dds);
127  virtual bool serialize(ConstraintEvaluator &eval, DDS &dds,
128  Marshaller &m, bool ce_eval = true);
129  virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse = false);
130 #endif
131 #if 0
132  // Do not store values in memory as for C; force users to work with the
133  // C++ objects as defined by the DAP.
134 
135  virtual unsigned int val2buf(void *val, bool reuse = false);
136  virtual unsigned int buf2val(void **val);
137 #endif
138 
139 #if 0
140  virtual BaseType *var(const string &name, bool exact_match = true, btp_stack *s = 0);
141  virtual BaseType *var(const string &n, btp_stack &s);
142 #endif
143 #if 0
144  virtual void add_var(BaseType *bt, Part part = nil);
145  virtual void add_var_nocopy(BaseType *bt, Part part = nil);
146 
147  virtual void del_var(const string &name);
148 #endif
149 #if 0
150  virtual bool read() ;
151 #endif
152 #if 0
153  virtual void print_val(FILE *out, string space = "",
154  bool print_decl_p = true);
155  virtual void print_val(ostream &out, string space = "",
156  bool print_decl_p = true);
157 #endif
158 #if 0
159  virtual bool check_semantics(string &msg, bool all = false);
160 #endif
161  virtual void dump(ostream &strm) const ;
162 };
163 
164 } // namespace libdap
165 
166 #endif // _structure_h
virtual void set_in_selection(bool state)
Set the in_selection property.
Definition: Constructor.cc:625
abstract base class used to unmarshall/deserialize dap data objects
Definition: UnMarshaller.h:54
Structure & operator=(const Structure &rhs)
Definition: Structure.cc:143
void m_duplicate(const Constructor &s)
Definition: Constructor.cc:59
virtual BaseType * ptr_duplicate()
Definition: Structure.cc:137
virtual BaseType * var(const string &name, bool exact_match=true, btp_stack *s=0)
btp_stack no longer needed; use back pointers (BaseType::get_parent())
Definition: Constructor.cc:183
Part
Names the parts of multi-section constructor data types.
Definition: BaseType.h:95
virtual void intern_data(ConstraintEvaluator &eval, DDS &dds)
Definition: Constructor.cc:402
Structure(const string &n)
Definition: Structure.cc:106
virtual void add_var_nocopy(BaseType *bt, Part part=nil)
Definition: Constructor.cc:346
Holds a structure (aggregate) type.
Definition: Structure.h:85
virtual void add_var(BaseType *bt, Part part=nil)
Definition: Constructor.cc:321
virtual int element_count(bool leaves=false)
Count the members of constructor types.
Definition: Constructor.cc:110
stack< BaseType * > btp_stack
Definition: BaseType.h:233
virtual void set_leaf_sequence(int level=1)
Traverse Structure, set Sequence leaf nodes.
Definition: Structure.cc:224
virtual bool serialize(ConstraintEvaluator &eval, DDS &dds, Marshaller &m, bool ce_eval=true)
Move data to the net.
Definition: Constructor.cc:416
virtual bool read()
simple implementation of read that iterates through vars and calls read on them
Definition: Constructor.cc:389
virtual bool check_semantics(string &msg, bool all=false)
Compare an object's current state with the semantics of its type.
Definition: Constructor.cc:583
virtual bool deserialize(UnMarshaller &um, DDS *dds, bool reuse=false)
Receive data from the net.
Definition: Constructor.cc:451
virtual void print_val(FILE *out, string space="", bool print_decl_p=true)
Prints the value of the variable.
Definition: Constructor.cc:494
virtual unsigned int val2buf(void *, bool)
Loads class data.
Definition: Constructor.h:99
string name() const
Returns the name of the class instance.
Definition: BaseType.cc:254
BaseType * m_leaf_match(const string &name, btp_stack *s=0)
Definition: Constructor.cc:208
virtual unsigned int width(bool constrained=false)
Definition: Constructor.cc:165
Evaluate a constraint expression.
virtual unsigned int buf2val(void **)
Reads the class data.
Definition: Constructor.h:102
The basic data type for the DODS DAP types.
Definition: BaseType.h:199
abstract base class used to marshal/serialize dap data objects
Definition: Marshaller.h:53
virtual bool is_linear()
Check to see whether this variable can be printed simply.
Definition: Structure.cc:172
BaseType * m_exact_match(const string &name, btp_stack *s=0)
Definition: Constructor.cc:235
virtual void del_var(const string &name)
Definition: Constructor.cc:362
virtual void set_send_p(bool state)
Definition: Constructor.cc:124
virtual void dump(ostream &strm) const
dumps information about this object
Definition: Structure.cc:598
virtual ~Structure()
Definition: Structure.cc:128
virtual void set_read_p(bool state)
Sets the value of the read_p property.
Definition: Constructor.cc:134